Page MenuHomePhabricator

Move file page to new name that exists on commons throws Wikimedia\Rdbms\DBTransactionStateError on zhwiki
Closed, ResolvedPublic

Description

[XDSdHQpAMEsAAJThpRAAAACX] 2019-01-08 12:52:46: Fatal exception of type "Wikimedia\Rdbms\DBTransactionStateError"

When I move File:Chi-Ming Peng.jpg to File:Chi-Ming Peng at Tokyo Institute of Technology 20110825.jpg on zhwiki, I get this exception.
On zhwiki, the first title is just a wikitext page. There is no file. The second title does not exist.
On commons, the first title is a redirect. The second title is a file.

Details

Related Gerrit Patches:

Event Timeline

A2093064 created this task.Jan 8 2019, 1:06 PM
Restricted Application added subscribers: Cosine02, Aklapper. · View Herald TranscriptJan 8 2019, 1:06 PM
exception.file	       	/srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/database/Database.php:1356
exception.message	       	Cannot execute query from Wikimedia\Rdbms\Database::ping while transaction status is ERROR.
exception.previous.class	       	Wikimedia\Rdbms\DBUnexpectedError
exception.previous.file	       	/srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/database/Database.php:3795
exception.previous.message	       	Uncancelable atomic section canceled (got MovePage::move).
exception.previous.trace
#0 /srv/mediawiki/php-1.33.0-wmf.9/includes/MovePage.php(386): Wikimedia\Rdbms\Database->cancelAtomic(string)
#1 /srv/mediawiki/php-1.33.0-wmf.9/includes/specials/SpecialMovepage.php(608): MovePage->move(User, string, boolean)
#2 /srv/mediawiki/php-1.33.0-wmf.9/includes/specials/SpecialMovepage.php(128): MovePageForm->doSubmit()
#3 /srv/mediawiki/php-1.33.0-wmf.9/includes/specialpage/SpecialPage.php(569): MovePageForm->execute(NULL)
#4 /srv/mediawiki/php-1.33.0-wmf.9/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#5 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#6 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(862): MediaWiki->performRequest()
#7 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(517): MediaWiki->main()
#8 /srv/mediawiki/php-1.33.0-wmf.9/index.php(42): MediaWiki->run()
#9 /srv/mediawiki/w/index.php(3): include(string)
#10 {main}
exception.trace
#0 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/database/Database.php(1137): Wikimedia\Rdbms\Database->assertTransactionStatus(string, string)
#1 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/database/Database.php(4121): Wikimedia\Rdbms\Database->query(string, string, boolean)
#2 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/database/Database.php(732): Wikimedia\Rdbms\Database->ping(NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/database/Database.php(722): Wikimedia\Rdbms\Database->pingAndCalculateLastTrxApplyTime()
#4 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1353): Wikimedia\Rdbms\Database->pendingWriteQueryDuration(string)
#5 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1781): Closure$Wikimedia\Rdbms\LoadBalancer::approveMasterChanges(Wikimedia\Rdbms\DatabaseMysqli)
#6 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1369): Wikimedia\Rdbms\LoadBalancer->forEachOpenMasterConnection(Closure$Wikimedia\Rdbms\LoadBalancer::approveMasterChanges;459)
#7 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/lbfactory/LBFactory.php(219): Wikimedia\Rdbms\LoadBalancer->approveMasterChanges(array)
#8 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/lbfactory/LBFactoryMulti.php(413): Closure$Wikimedia\Rdbms\LBFactory::forEachLBCallMethod(Wikimedia\Rdbms\LoadBalancer, string, array)
#9 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/lbfactory/LBFactory.php(222): Wikimedia\Rdbms\LBFactoryMulti->forEachLB(Closure$Wikimedia\Rdbms\LBFactory::forEachLBCallMethod;194, array)
#10 /srv/mediawiki/php-1.33.0-wmf.9/includes/libs/rdbms/lbfactory/LBFactory.php(270): Wikimedia\Rdbms\LBFactory->forEachLBCallMethod(string, array)
#11 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(595): Wikimedia\Rdbms\LBFactory->commitMasterChanges(string, array)
#12 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(568): MediaWiki::preOutputCommit(RequestContext, Closure$MediaWiki::main;376)
#13 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(878): MediaWiki->doPreOutputCommit(Closure$MediaWiki::main;376)
#14 /srv/mediawiki/php-1.33.0-wmf.9/includes/MediaWiki.php(517): MediaWiki->main()
#15 /srv/mediawiki/php-1.33.0-wmf.9/index.php(42): MediaWiki->run()
#16 /srv/mediawiki/w/index.php(3): include(string)
#17 {main}
exception_id	       	XDSdHQpAMEsAAJThpRAAAACX
Anomie reopened this task as Open.Jan 8 2019, 2:55 PM
Anomie added subscribers: Alexia, aaron, Anomie.

This does not seem to be a duplicate of T210739.

That task is about moving a page and the deletion of the target failing, apparently due to some calls bypassing MySQL transaction isolation and others not. It's associated with a logged exception "Failed to delete page-move revision".

This one is about moving a page where the local target doesn't exist but it would conflict with a Commons file, and seems to come down to rMWea1781053eb3: Cancel the transaction if the file fails to move. This prevents losing files… not having added the ATOMIC_CANCELABLE flag to the startAtomic() call when it added a call to cancelAtomic().

Change 482873 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@master] Fix missing ATOMIC_CANCELLABLE in MovePage::move()

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

Change 482873 merged by jenkins-bot:
[mediawiki/core@master] Fix missing ATOMIC_CANCELABLE in MovePage::move()

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

Anomie closed this task as Resolved.Jan 9 2019, 3:00 PM
Anomie assigned this task to Tgr.

The fix should be deployed to Wikimedia wikis with 1.33.0-wmf.13, see https://www.mediawiki.org/wiki/MediaWiki_1.33/Roadmap for a schedule. If anyone thinks it's important enough to deploy sooner, you're welcome to follow the process described at https://wikitech.wikimedia.org/wiki/SWAT_deploys#How_to_submit_a_patch_for_SWAT.

Change 483199 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/core@wmf/1.33.0-wmf.12] Fix missing ATOMIC_CANCELABLE in MovePage::move()

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

Change 483199 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.12] Fix missing ATOMIC_CANCELABLE in MovePage::move()

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

Mentioned in SAL (#wikimedia-operations) [2019-01-10T00:34:41Z] <catrope@deploy1001> Synchronized php-1.33.0-wmf.12/includes/MovePage.php: Fix missing ATOMIC_CANCELABLE in MovePage::move() (T213168) (duration: 00m 53s)

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM