Page MenuHomePhabricator

LDAP Authentication updating tables on load.php entry point
Closed, InvalidPublic

Description

Apparently the extension is updating tables on load.php requests. This is very bad, and can cause database contention (or deadlocks in this case).

From Topic: DB Error on Login:

[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}

Event Timeline

Krinkle subscribed.

The trigger is wfSetupFormMailer , which isn't defined anywhere in Wikimedia Git.
https://www.mediawiki.org/wiki/Extension:FormMailer

The call path starts at https://github.com/wikimedia/mediawiki/blob/1.25.1/includes/Setup.php#L678 which is the runner of wgExtensionFunctions. Untagging from ResourceLoader as this is not related to ResourceLoader.

Hmm, so maybe Extension:FormMailer is the culprit of this one, not LDAP Authentication. Extension:FormMailer doesn't live on our repositories so, if that's the case, this task can be marked as invalid