Page MenuHomePhabricator

Renaming users on officewiki throws an error even after the rename happens
Open, Needs TriagePublic

Description

(Forgive me if this is the wrong project :) )

I just renamed KStine (WMF) to KStineRowe (WMF) on office.wikimedia.org. The rename went through, but instead of a confirmation, I just received this error:

A database query error has occurred. This may indicate a bug in the software.

[XIBO6wpAICkAAGjD2acAAACU] 2019-03-06 22:51:24: Fatal exception of type "Wikimedia\Rdbms\DBTransactionError"

Note that I did immediately attempt to rename the account again, but received the much more readable error The user "KStine (WMF)" does not exist.

Event Timeline

message
[XIBO6wpAICkAAGjD2acAAACU] /wiki/Special:RenameUser   Wikimedia\Rdbms\DBTransactionError from line 1382 of /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/database/Database.php: Explicit transaction still active. A caller may have caught an error. Open transactions: RenameuserSQL::rename

exception.file
/srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/database/Database.php:1382

exception.message
Explicit transaction still active. A caller may have caught an error. Open transactions: RenameuserSQL::rename

exception.trace
#0 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1348): Wikimedia\Rdbms\Database->assertNoOpenTransactions()
#1 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1779): Closure$Wikimedia\Rdbms\LoadBalancer::approveMasterChanges(Wikimedia\Rdbms\DatabaseMysqli)
#2 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1367): Wikimedia\Rdbms\LoadBalancer->forEachOpenMasterConnection(Closure$Wikimedia\Rdbms\LoadBalancer::approveMasterChanges;2940)
#3 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/lbfactory/LBFactory.php(223): Wikimedia\Rdbms\LoadBalancer->approveMasterChanges(array)
#4 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/lbfactory/LBFactoryMulti.php(405): Closure$Wikimedia\Rdbms\LBFactory::forEachLBCallMethod(Wikimedia\Rdbms\LoadBalancer, string, array)
#5 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/lbfactory/LBFactory.php(226): Wikimedia\Rdbms\LBFactoryMulti->forEachLB(Closure$Wikimedia\Rdbms\LBFactory::forEachLBCallMethod;2717, array)
#6 /srv/mediawiki/php-1.33.0-wmf.20/includes/libs/rdbms/lbfactory/LBFactory.php(274): Wikimedia\Rdbms\LBFactory->forEachLBCallMethod(string, array)
#7 /srv/mediawiki/php-1.33.0-wmf.20/includes/MediaWiki.php(598): Wikimedia\Rdbms\LBFactory->commitMasterChanges(string, array)
#8 /srv/mediawiki/php-1.33.0-wmf.20/includes/MediaWiki.php(568): MediaWiki::preOutputCommit(RequestContext, Closure$MediaWiki::main;2916)
#9 /srv/mediawiki/php-1.33.0-wmf.20/includes/MediaWiki.php(883): MediaWiki->doPreOutputCommit(Closure$MediaWiki::main;2916)
#10 /srv/mediawiki/php-1.33.0-wmf.20/includes/MediaWiki.php(517): MediaWiki->main()
#11 /srv/mediawiki/php-1.33.0-wmf.20/index.php(42): MediaWiki->run()
#12 /srv/mediawiki/w/index.php(3): include(string)
#13 {main}

The error recorded here seems pretty straightforward: the early return at line 208 doesn't close the atomic section started at line 200.

But the discussion in IRC made it sound like the earlier request also failed somehow. I don't see any failure or exceptions in the logs for request ID XIBO6wpAICIAAJy39C0AAAAJ though. Possibly it was a race on a double-submission: the 'acAAACU request blocked on the 'C0AAAAJ request at the atomic section start, the 'C0AAAAJ request succeeded, and the 'acAAACU that hit this error was the one the user actually saw the output from.

Change 494930 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/extensions/Renameuser@master] RenameuserSQL: Close the atomic section before the early return

https://gerrit.wikimedia.org/r/494930

Change 494930 merged by jenkins-bot:
[mediawiki/extensions/Renameuser@master] RenameuserSQL: Close the atomic section before the early return

https://gerrit.wikimedia.org/r/494930