Page MenuHomePhabricator

Fatal error when submitting edit and deletion/undeletion on Commons from "Error: 1205 Lock wait timeout exceeded" (WikiPage::lockAndGetLatest)
Open, LowPublic

Description

While trying to edit [[:c:File:2012 Armenian National AssemblyStructure.png]] I get the following error:

[WyOnHwpAMFMAAA1zdIoAAAAP] 2018-06-15 11:46:55: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

Similarly while trying to delete [[:c:File:2017 Armenian National Assembly Structure.svg]] I get:

[WyOnQQpAADsAAJsS6agAAAAW] 2018-06-15 11:47:29: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

Event Timeline

Srittau created this task.Jun 15 2018, 11:51 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 15 2018, 11:51 AM
Restricted Application added a project: Multimedia. · View Herald TranscriptJun 15 2018, 12:02 PM

And another edit that failed [[:c:File:AmericanoCampanha~.cp19 4.png]]

[WyOsFApAADsAAEB@aEIAAABE] 2018-06-15 12:08:04: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

Storkk added a subscriber: Storkk.
Aklapper renamed this task from DBQuery error on Commons to DBQuery error on Commons: "Error: 1205 Lock wait timeout exceeded".Jun 15 2018, 6:32 PM

While trying to edit [[:c:File:2012 Armenian National AssemblyStructure.png]] I get the following error:
[WyOnHwpAMFMAAA1zdIoAAAAP] 2018-06-15 11:46:55: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

WikiPage::lockAndGetLatest	10.64.48.23	1205	Lock wait timeout exceeded; try restarting transaction (10.64.48.23)	SELECT  page_latest  FROM `page`    WHERE page_id = '19426021' AND page_namespace = '6' AND page_title = '2012_Armenian_National_Assembly_Structure.png'  LIMIT 1   FOR UPDATE

Similarly while trying to delete [[:c:File:2017 Armenian National Assembly Structure.svg]] I get:
[WyOnQQpAADsAAJsS6agAAAAW] 2018-06-15 11:47:29: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

Query: SELECT  page_latest  FROM `page`    WHERE page_id = '57783320' AND page_namespace = '6' AND page_title = '2017_Armenian_National_Assembly_Structure.svg'  LIMIT 1   FOR UPDATE
Function: WikiPage::lockAndGetLatest
Error: 1205 Lock wait timeout exceeded; try restarting transaction (10.64.48.23)

And another edit that failed [[:c:File:AmericanoCampanha~.cp19 4.png]]
[WyOsFApAADsAAEB@aEIAAABE] 2018-06-15 12:08:04: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

WikiPage::lockAndGetLatest	10.64.48.23	1205	Lock wait timeout exceeded; try restarting transaction (10.64.48.23)	SELECT  page_latest  FROM `page`    WHERE page_id = '19891298' AND page_namespace = '6' AND page_title = 'AmericanoCampanha~.cp19_4.png'  LIMIT 1   FOR UPDATE

With a stack trace of:

#0 /srv/mediawiki/php-1.32.0-wmf.8/includes/libs/rdbms/database/Database.php(1413): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.32.0-wmf.8/includes/libs/rdbms/database/Database.php(1186): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /srv/mediawiki/php-1.32.0-wmf.8/includes/libs/rdbms/database/Database.php(1640): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/mediawiki/php-1.32.0-wmf.8/includes/libs/rdbms/database/Database.php(1465): Wikimedia\Rdbms\Database->select(string, string, array, string, array, array)
#4 /srv/mediawiki/php-1.32.0-wmf.8/includes/page/WikiPage.php(3045): Wikimedia\Rdbms\Database->selectField(string, string, array, string, array)
#5 /srv/mediawiki/php-1.32.0-wmf.8/includes/page/WikiPage.php(1756): WikiPage->lockAndGetLatest()
#6 /srv/mediawiki/php-1.32.0-wmf.8/includes/page/WikiPage.php(1674): WikiPage->doModify(WikitextContent, integer, User, string, array)
#7 /srv/mediawiki/php-1.32.0-wmf.8/includes/EditPage.php(2209): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)
#8 /srv/mediawiki/php-1.32.0-wmf.8/includes/EditPage.php(1500): EditPage->internalAttemptSave(array, boolean)
#9 /srv/mediawiki/php-1.32.0-wmf.8/includes/EditPage.php(646): EditPage->attemptSave(array)
#10 /srv/mediawiki/php-1.32.0-wmf.8/includes/actions/EditAction.php(60): EditPage->edit()
#11 /srv/mediawiki/php-1.32.0-wmf.8/includes/actions/SubmitAction.php(38): EditAction->show()
#12 /srv/mediawiki/php-1.32.0-wmf.8/includes/MediaWiki.php(500): SubmitAction->show()
#13 /srv/mediawiki/php-1.32.0-wmf.8/includes/MediaWiki.php(294): MediaWiki->performAction(ImagePage, Title)
#14 /srv/mediawiki/php-1.32.0-wmf.8/includes/MediaWiki.php(864): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.32.0-wmf.8/includes/MediaWiki.php(524): MediaWiki->main()
#16 /srv/mediawiki/php-1.32.0-wmf.8/index.php(42): MediaWiki->run()
#17 /srv/mediawiki/w/index.php(3): include(string)
#18 {main}
Vvjjkkii renamed this task from DBQuery error on Commons: "Error: 1205 Lock wait timeout exceeded" to 7taaaaaaaa.Jul 1 2018, 1:03 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from 7taaaaaaaa to DBQuery error on Commons: "Error: 1205 Lock wait timeout exceeded".Jul 2 2018, 5:00 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.
Krinkle renamed this task from DBQuery error on Commons: "Error: 1205 Lock wait timeout exceeded" to Fatal error when submitting edit on Commons from "Error: 1205 Lock wait timeout exceeded" (WikiPage::lockAndGetLatest).Aug 4 2018, 4:54 PM
jcrespo triaged this task as Low priority.Aug 24 2018, 9:09 AM
jcrespo added a subscriber: jcrespo.

There is really not much to do here, this error happens when a heavy transaction (e.g. a delete of a page with many revisions) is tried by more than one person at the same time. This is likely to happen with admin requests, as several admins would try to do it at the same time. The lock is in place so that data is consistent. Where the errors is consistent, the exception could be captured and explained better to admins, but there is not much to do about it unless the actions become lockless (which I assume it is not simple or even possible). The suggestion is to wait 1 or 2 minutes and retry again -nothing gets broken on error.

In particular, https://commons.wikimedia.org/wiki/File:2017_Armenian_National_Assembly_Structure.svg was deleted that day:

12:45, 15 June 2018 Yann (talk | contribs) deleted page File:2017 Armenian National Assembly Structure.svg (Commons:Deletion requests/File:2017 Armenian National Assembly Structure.svg: There is another similar diagram that has correct left-right orientation Armenian parliamentary elections 2017.svg) (thank) (global usage; delinker log)

The other was deleted and then restored: https://commons.wikimedia.org/w/index.php?title=Special:Log&page=File%3A2012+Armenian+National+Assembly+Structure.png

That signals that the error is not consistent, and only because several people try expensive operations at the same time, and it fails for one or all of them to avoid data inconsistencies, which is a desired outcome.

jcrespo renamed this task from Fatal error when submitting edit on Commons from "Error: 1205 Lock wait timeout exceeded" (WikiPage::lockAndGetLatest) to Fatal error when submitting edit and deleteion/undeletion on Commons from "Error: 1205 Lock wait timeout exceeded" (WikiPage::lockAndGetLatest).Aug 24 2018, 9:22 AM
jcrespo renamed this task from Fatal error when submitting edit and deleteion/undeletion on Commons from "Error: 1205 Lock wait timeout exceeded" (WikiPage::lockAndGetLatest) to Fatal error when submitting edit and deletion/undeletion on Commons from "Error: 1205 Lock wait timeout exceeded" (WikiPage::lockAndGetLatest).
Tgr added a subscriber: Tgr.Aug 24 2018, 10:23 AM

We could use PoolCounter for big deletions maybe if getting this strange errors is considered a problem.

If two admins try to perform the same action, it makes sense that one of them gets an error. But (as @jcrespo pointed out) a better error message that points out the problem to the user would be useful. Otherwise, this error might keep getting reported, causing more work for everyone involved.

Krinkle added a subscriber: Krinkle.

Still seen.

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: INSERT IGNORE INTO `page` (page_namespace,page_title,page_restrictions,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len) VALUES ('0','**','','0','1','***','**','0','0')
Function: WikiPage::insertOn
Error: 1205 Lock wait timeout exceeded; try restarting transaction (10.192.0.39)


#2 /srv/mediawiki/php-1.32.0-wmf.20/includes/libs/rdbms/database/Database.php(2030): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/mediawiki/php-1.32.0-wmf.20/includes/libs/rdbms/database/DBConnRef.php(49): Wikimedia\Rdbms\Database->insert(string, array, string, string)
#4 /srv/mediawiki/php-1.32.0-wmf.20/includes/libs/rdbms/database/DBConnRef.php(305): Wikimedia\Rdbms\DBConnRef->__call(string, array)
#5 /srv/mediawiki/php-1.32.0-wmf.20/includes/page/WikiPage.php(1297): Wikimedia\Rdbms\DBConnRef->insert(string, array, string, string)
#6 /srv/mediawiki/php-1.32.0-wmf.20/includes/Storage/PageUpdater.php(1076): WikiPage->insertOn(Wikimedia\Rdbms\DBConnRef)
#7 /srv/mediawiki/php-1.32.0-wmf.20/includes/Storage/PageUpdater.php(735): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment, User, integer)
#8 /srv/mediawiki/php-1.32.0-wmf.20/includes/page/WikiPage.php(1865): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#9 /srv/mediawiki/php-1.32.0-wmf.20/includes/EditPage.php(2258): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User, string, array, integer)
#10 /srv/mediawiki/php-1.32.0-wmf.20/includes/EditPage.php(1546): EditPage->internalAttemptSave(array, boolean)
#11 /srv/mediawiki/php-1.32.0-wmf.20/includes/EditPage.php(677): EditPage->attemptSave(array)
#12 /srv/mediawiki/php-1.32.0-wmf.20/includes/actions/EditAction.php(60): EditPage->edit()
#13 /srv/mediawiki/php-1.32.0-wmf.20/includes/actions/SubmitAction.php(38): EditAction->show()
#14 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(501): SubmitAction->show()
#15 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#16 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(868): MediaWiki->performRequest()
#17 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(525): MediaWiki->main()
#18 /srv/mediawiki/php-1.32.0-wmf.20/index.php(42): MediaWiki->run()
mmodell changed the subtype of this task from "Task" to "Production Error".Wed, Aug 28, 11:09 PM