Page MenuHomePhabricator

"Wikimedia\Rdbms\DBQueryError"
Closed, DuplicatePublicPRODUCTION ERROR

Description

Noting this report from enwiki in case it's interesting.

I attempted to created a redirect page titled Expected Mean Square. Repeatedly I tried to save it, and every time I got this error message:

A database query error has occurred. This may indicate a bug in the software.
[e6ace71c-ae3f-4171-8639-3e1554cba7dd] 2020-08-19 23:44:49: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"
Can anyone explain this? Michael Hardy (talk) 7:46 pm, Yesterday (UTC−4)

And now I have succeeded in creating the redirect. Michael Hardy (talk) 8:08 pm, Yesterday (UTC−4)

Details

Stack Trace
2020-08-19 23:44:49 [e6ace71c-ae3f-4171-8639-3e1554cba7dd] mw1399 enwiki 1.36.0-wmf.4 exception ERROR: [e6ace71c-ae3f-4171-8639-3e1554cba7dd] /w/index.php?title=Expected_Mean_Square&action=submit   Wikimedia\Rdbms\DBQueryError from line 1699 of /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/Database.php: Error 1205: Lock wait timeout exceeded; try restarting transaction (10.64.16.101)
Function: WikiPage::insertRedirectEntry
Query: INSERT INTO `redirect` (rd_from,rd_namespace,rd_title,rd_fragment,rd_interwiki) VALUES (65002715,0,'Expected_mean_squares','','') ON DUPLICATE KEY UPDATE rd_namespace = 0,rd_title = 'Expected_mean_squares',rd_fragment = '',rd_interwiki = ''
 {"exception_id":"e6ace71c-ae3f-4171-8639-3e1554cba7dd","exception_url":"/w/index.php?title=Expected_Mean_Square&action=submit","caught_by":"entrypoint"} 
[Exception Wikimedia\Rdbms\DBQueryError] (/srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/Database.php:1699) Error 1205: Lock wait timeout exceeded; try restarting transaction (10.64.16.101)
Function: WikiPage::insertRedirectEntry
Query: INSERT INTO `redirect` (rd_from,rd_namespace,rd_title,rd_fragment,rd_interwiki) VALUES (65002715,0,'Expected_mean_squares','','') ON DUPLICATE KEY UPDATE rd_namespace = 0,rd_title = 'Expected_mean_squares',rd_fragment = '',rd_interwiki = ''

  #0 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/Database.php(1683): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
  #1 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/Database.php(1658): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
  #2 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/Database.php(1227): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
  #3 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/DatabaseMysqlBase.php(1358): Wikimedia\Rdbms\Database->query(string, string, integer)
  #4 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/Database.php(3351): Wikimedia\Rdbms\DatabaseMysqlBase->doUpsert(string, array, array, array, string)
  #5 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->upsert(string, array, array, array, string)
  #6 /srv/mediawiki/php-1.36.0-wmf.4/includes/libs/rdbms/database/DBConnRef.php(504): Wikimedia\Rdbms\DBConnRef->__call(string, array)
  #7 /srv/mediawiki/php-1.36.0-wmf.4/includes/page/WikiPage.php(1074): Wikimedia\Rdbms\DBConnRef->upsert(string, array, string, array, string)
  #8 /srv/mediawiki/php-1.36.0-wmf.4/includes/page/WikiPage.php(1450): WikiPage->insertRedirectEntry(Title)
  #9 /srv/mediawiki/php-1.36.0-wmf.4/includes/page/WikiPage.php(1409): WikiPage->updateRedirectOn(Wikimedia\Rdbms\DBConnRef, Title, NULL)
  #10 /srv/mediawiki/php-1.36.0-wmf.4/includes/Storage/PageUpdater.php(1249): WikiPage->updateRevisionOn(Wikimedia\Rdbms\DBConnRef, MediaWiki\Revision\RevisionStoreRecord, integer)
  #11 /srv/mediawiki/php-1.36.0-wmf.4/includes/Storage/PageUpdater.php(812): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment, User, integer)
  #12 /srv/mediawiki/php-1.36.0-wmf.4/includes/page/WikiPage.php(1986): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
  #13 /srv/mediawiki/php-1.36.0-wmf.4/includes/EditPage.php(2480): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User, string, array, integer)
  #14 /srv/mediawiki/php-1.36.0-wmf.4/includes/EditPage.php(1739): EditPage->internalAttemptSave(array, boolean)
  #15 /srv/mediawiki/php-1.36.0-wmf.4/includes/EditPage.php(681): EditPage->attemptSave(array)
  #16 /srv/mediawiki/php-1.36.0-wmf.4/includes/actions/EditAction.php(71): EditPage->edit()
  #17 /srv/mediawiki/php-1.36.0-wmf.4/includes/actions/SubmitAction.php(38): EditAction->show()
  #18 /srv/mediawiki/php-1.36.0-wmf.4/includes/MediaWiki.php(527): SubmitAction->show()
  #19 /srv/mediawiki/php-1.36.0-wmf.4/includes/MediaWiki.php(313): MediaWiki->performAction(Article, Title)
  #20 /srv/mediawiki/php-1.36.0-wmf.4/includes/MediaWiki.php(940): MediaWiki->performRequest()
  #21 /srv/mediawiki/php-1.36.0-wmf.4/includes/MediaWiki.php(543): MediaWiki->main()
  #22 /srv/mediawiki/php-1.36.0-wmf.4/index.php(53): MediaWiki->run()
  #23 /srv/mediawiki/php-1.36.0-wmf.4/index.php(46): wfIndexMain()
  #24 /srv/mediawiki/w/index.php(3): require(string)
  #25 {main}

Event Timeline

Reedy changed the subtype of this task from "Task" to "Production Error".Aug 21 2020, 1:29 AM
Reedy edited Stack Trace. (Show Details)

"ON DUPLICATE KEY UPDATE" creating a "Lock wait timeout", what a surprise! :-D (you know what I think about ODKU).

For original reporter, explained in plain English: sometimes, certain actions over the same data (e.g. the same page) are incompatible and fail or they would be hang up forever- it doesn't have to be user interactions, it could also be background maintenance tasks. It is impossible to eliminate all possible interactions- but it is our job (developers) to minimize their appearance. You did nothing wrong, and you did ok with retrying (and that is why it worked afterwards). Our job is discovering what interacted here and try to make sure it is very unlikely it happens again. Thanks you very much for the report, flagging them when they happen several times in a row helps us detect them.