Topic on Extension talk:LDAP Authentication

Summary by Ciencia Al Poder
62.192.2.194 (talkcontribs)

Hi,

I have a mediawiki for internal Company use only. The ldap authentication extension is configured to let anyone automatically login and read the wiki who has got a Domain account. This is working without issues.

Since I activated debug- and db-error logs for the whole wiki for monitoring purporses there is a DB-Error that bothers me. It looks like this and is logged twice each time a user logs in:

[cookie] setcookie: "company_wikiUserID", "99", "1499157222", "/", "", "", "1"
[cookie] setcookie: "company_wikiUserName", "Username", "1499157222", "/", "", "", "1"
[cookie] setcookie: "company_wikiToken", "", "1483518822", "/", "", "", "1"
[cookie] setcookie: "company_wikiUserID", "99", "1499157222", "/", "", "", "1"
[cookie] setcookie: "company_wikiUserName", "Username", "1499157222", "/", "", "", "1"
[cookie] setcookie: "company_wikiToken", "", "1483518822", "/", "", "", "1"

[Bug56269] Exception thrown with an uncommited database transaction: [6f314852] /load.php?debug=false&lang=de&modules=site&only=styles&skin=monobook&* DBQueryError from line 1246 of /var/www/mediawiki-1.25.1/includes/db/Database.php: A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script

Query: UPDATE `ldap_domains` SET domain = 'domain.local' WHERE user_id = '99'

Function: LdapAuthenticationPlugin::saveDomain

Error: 1213 Deadlock found when trying to get lock; try restarting transaction (localhost)

#0 /var/www/mediawiki-1.25.1/includes/db/Database.php(1205): DatabaseBase->reportQueryError('Deadlock found ...', 1213, 'UPDATE `ldap_d...', 'LdapAuthenticat...', false)
#1 /var/www/mediawiki-1.25.1/includes/db/Database.php(2153): DatabaseBase->query('UPDATE `ldap_d...', 'LdapAuthenticat...')
#2 /var/www/mediawiki-1.25.1/extensions/LdapAuthentication/LdapAuthentication.php(2069): DatabaseBase->update('ldap_domains', Array, Array, 'LdapAuthenticat...')
#3 /var/www/mediawiki-1.25.1/extensions/LdapAuthentication/LdapAuthentication.php(1240): LdapAuthenticationPlugin::saveDomain(Object(User), 'domain.local')
#4 /var/www/mediawiki-1.25.1/extensions/LdapAuthentication/LdapAutoAuthentication.php(63): LdapAuthenticationPlugin->updateUser(Object(User))
#5 [internal function]: LdapAutoAuthentication::Authenticate(Object(User))
#6 /var/www/mediawiki-1.25.1/includes/Hooks.php(209): call_user_func_array('LdapAutoAuthent...', Array)
#7 /var/www/mediawiki-1.25.1/includes/User.php(365): Hooks::run('UserLoadAfterLo...', Array)
#8 /var/www/mediawiki-1.25.1/includes/User.php(2583): User->load()
#9 /var/www/mediawiki-1.25.1/extensions/FormMailer/FormMailer.php(54): User->getRealName()
#10 [internal function]: wfSetupFormMailer()
#11 /var/www/mediawiki-1.25.1/includes/Setup.php(678): call_user_func('wfSetupFormMail...')
#12 /var/www/mediawiki-1.25.1/includes/WebStart.php(138): require_once('/var/www/mediaw...')
#13 /var/www/mediawiki-1.25.1/load.php(30): require('/var/www/mediaw...')
#14 {main}

My Setup:

  • OS: Debian 8.4
  • Mediawiki: 1.25.1
  • PHP: 5.6.20
  • DBMS: MySQL 5.5.49
  • Web Server: Apache 2.4.10
  • Directory Server: Active Directory (2008 - 2012 R2)

How can I solve that Deadlock Error?

62.192.2.194 (talkcontribs)

Sorry I forgot to mention that LDAP Authentication is Version 2.1.0 REL 1.25.

Ciencia Al Poder (talkcontribs)
62.192.2.194 (talkcontribs)

Hi,

thanks for the reply. I managed to solve the error after the hint to the formmailer extension was given.

The problem was simply put that two variables (via User->getRealName()) were set at the wrong place of the formmailer-script (I edited that script a few months ago). After putting those into an if-clause, the error disappeared.