Topic on Extension talk:LDAP Authentication

DB Query Errors on second login

6
Hasechris (talkcontribs)

Hello,

i keep getting Errors on login with ldap user from Active Directory. Generally the login always works aka i have the User Preference etc buttons on the upper right. But the second and ongoing login from a ldap User will generate DB Query Errors.

The interesting part is in the attached debug_data.txt:

    Query: INSERT INTO `comwiki-ldap_domains` (domain,user_id) VALUES (NULL,'4')

On the first Login this Query will be run towards my DB. Then the value of domain is empty; the next login will produce the attached Error.

Version:

LDAP Authentication Plugin 2.1.0 (4c9bdab)16:24, 21. Apr. 2017
Software Version
MediaWiki 1.29.0 (8b5beb3)
PHP 5.5.14 (apache2handler)
MySQL 5.6.24-log
ICU 52.1

Greeting from Germany

Thanks in advance

Christian Hase

This post was hidden by Hasechris (history)
Hasechris (talkcontribs)

Debug output:

    [cookie] already deleted setcookie: "forceHTTPS", "", "1477383977", "/", "", "", "1" 
    [DBQuery] wikidb REPLACE /* SqlBagOStuff::setMulti */ INTO `comwiki-objectcache` (keyname,value,exptime) VALUES ('wikidb-comwiki-:MWSession:ltl8srq3pkcr4la1hhb7hkh9a5mgc3bb'','20171025092617')
    [error] [9a4104b9e8f72ce750b716bf] /index.php?title=Special:UserLogin&returnto=Main+Page ErrorException from line 1168 of /srv/www/htdocs/extensions/LdapAuthentication/LdapAuthenticationPlugin.php: PHP Notice: Undefined index: wsDomain
    [DBQuery] wikidb SELECT /* LdapAuthenticationPlugin::loadDomain 10.155.65.56 */ domain FROM `comwiki-ldap_domains` WHERE user_id = '4' LIMIT 1
    [DBQuery] wikidb INSERT /* LdapAuthenticationPlugin::saveDomain 10.155.65.56 */ INTO `comwiki-ldap_domains` (domain,user_id) VALUES (NULL,'4')
    [DBQuery] LdapAuthenticationPlugin::saveDomain	<hostname> (edited)	1048	Column 'domain' cannot be null (<hostname> (edited))	INSERT INTO `comwiki-ldap_domains` (domain,user_id) VALUES (NULL,'4') 
    [DBQuery] SQL ERROR: Column 'domain' cannot be null (<hostname> (edited)) 
    [session] SessionBackend "ltl8srq3pkcr4la1hhb7hkh9a5mgc3bb" data dirty due to dirty(): AuthManagerSpecialPage->performAuthenticationStep/MediaWiki\Auth\AuthManager->beginAuthentication/MediaWiki\Auth\AuthManager->continueAuthentication/MediaWiki\Session\Session->remove/MediaWiki\Session\SessionBackend->dirty
    [DBQuery] wikidb ROLLBACK /* MWExceptionHandler::rollbackMasterChangesAndLog 10.155.65.56 */ 
    [exception] [9a4104b9e8f72ce750b716bf] /index.php?title=Special:UserLogin&returnto=Main+Page Wikimedia\Rdbms\DBQueryError from line 1075 of /srv/www/htdocs/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
    Query: INSERT INTO `comwiki-ldap_domains` (domain,user_id) VALUES (NULL,'4') Function: LdapAuthenticationPlugin::saveDomain
    Error: 1048 Column 'domain' cannot be null (<hostname> (edited))
    [DBQuery] wikidb BEGIN /* Wikimedia\Rdbms\Database::query (LCStoreDB::get) 10.155.65.56 */
Hasechris (talkcontribs)

The Error dump:

   [9a4104b9e8f72ce750b716bf] /index.php?title=Special:UserLogin&returnto=Main+Page Wikimedia\Rdbms\DBQueryError from line 1075 of /srv/www/htdocs/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
   Query: INSERT INTO `comwiki-ldap_domains` (domain,user_id) VALUES (NULL,'4')
   Function: LdapAuthenticationPlugin::saveDomain
   Error: 1048 Column 'domain' cannot be null (mgtcom012.a41mgt.local)
   Backtrace:
   
   #0 /srv/www/htdocs/includes/libs/rdbms/database/Database.php(933): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
   #1 /srv/www/htdocs/includes/libs/rdbms/database/Database.php(1515): Wikimedia\Rdbms\Database->query(string, string)
   #2 /srv/www/htdocs/extensions/LdapAuthentication/LdapAuthenticationPlugin.php(2003): Wikimedia\Rdbms\Database->insert(string, array, string)
   #3 /srv/www/htdocs/extensions/LdapAuthentication/LdapAuthenticationPlugin.php(1168): LdapAuthenticationPlugin::saveDomain(User, NULL)
   #4 /srv/www/htdocs/includes/auth/AuthPluginPrimaryAuthenticationProvider.php(145): LdapAuthenticationPlugin->updateUser(User)
   #5 [internal function]: MediaWiki\Auth\AuthPluginPrimaryAuthenticationProvider->onUserLoggedIn(User)
   #6 /srv/www/htdocs/includes/Hooks.php(186): call_user_func_array(array, array)
   #7 /srv/www/htdocs/includes/auth/AuthManager.php(2388): Hooks::run(string, array)
   #8 /srv/www/htdocs/includes/auth/AuthManager.php(690): MediaWiki\Auth\AuthManager->setSessionDataForUser(User, boolean)
   #9 /srv/www/htdocs/includes/auth/AuthManager.php(382): MediaWiki\Auth\AuthManager->continueAuthentication(array)
   #10 /srv/www/htdocs/includes/specialpage/AuthManagerSpecialPage.php(353): MediaWiki\Auth\AuthManager->beginAuthentication(array, string)
   #11 /srv/www/htdocs/includes/specialpage/AuthManagerSpecialPage.php(482): AuthManagerSpecialPage->performAuthenticationStep(string, array)
   #12 [internal function]: AuthManagerSpecialPage->handleFormSubmit(array, VFormHTMLForm)
   #13 /srv/www/htdocs/includes/htmlform/HTMLForm.php(663): call_user_func(array, array, VFormHTMLForm)
   #14 /srv/www/htdocs/includes/specialpage/AuthManagerSpecialPage.php(416): HTMLForm->trySubmit()
   #15 /srv/www/htdocs/includes/specialpage/LoginSignupSpecialPage.php(305): AuthManagerSpecialPage->trySubmit()
   #16 /srv/www/htdocs/includes/specialpage/SpecialPage.php(522): LoginSignupSpecialPage->execute(NULL)
   #17 /srv/www/htdocs/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
   #18 /srv/www/htdocs/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
   #19 /srv/www/htdocs/includes/MediaWiki.php(862): MediaWiki->performRequest()
   #20 /srv/www/htdocs/includes/MediaWiki.php(523): MediaWiki->main()
   #21 /srv/www/htdocs/index.php(43): MediaWiki->run()
   #22 {main}
206.55.83.201 (talkcontribs)

check php logs :

PHP Notice:  Undefined index: wsDomain in /wikimedia/wiki/extensions/LdapAuthentication/LdapAuthenticationPlugin.php on line 1165

edit /wikimedia/extensions/LdapAuthentication/LdapAuthenticationPlugin.php at line 1165

# We must set a user option if we want token based logins to work

                if ( $user->getToken( false ) ) {

                        $this->printDebug( "User has a token, setting domain in user options.", NONSENSITIVE );

                #       self::saveDomain( $user, $_SESSION['wsDomain'] );

                        self::saveDomain( $user, $this->getDomain() );

                }

(lien: https://www.mediawiki.org/wiki/Topic:Syi70fsge0l1lhq3)

It woks for me.

Reply to "DB Query Errors on second login"