Page MenuHomePhabricator

Unable to create redirect on dewiki - fatal DBQueryError
Open, NormalPublic

Description

Hi,

by creating a redirect at german-spoken Wikipedia get this error. For more times:

  • [XKsNEgpAICwAAKQZzWAAAACU] 2019-04-08 08:58:10: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“
  • [XKsNbgpAICkAAFIiNiYAAACW] 2019-04-08 08:59:42: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 8 2019, 9:25 AM
Daimona added a subscriber: Daimona.Apr 8 2019, 9:29 AM
message
A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: INSERT INTO `redirect` (rd_from,rd_namespace,rd_title,rd_fragment,rd_interwiki) VALUES ([REDACTED],'0',[REDACTED],[REDACTED],[REDACTED]) ON DUPLICATE KEY UPDATE rd_namespace = '0',rd_title = [REDACTED],rd_fragment = '',rd_interwiki = ''
Function: WikiPage::insertRedirectEntry
Error: 1205 Lock wait timeout exceeded; try restarting transaction
trace
#0 /srv/mediawiki/php-1.33.0-wmf.23/includes/libs/rdbms/database/Database.php(1530): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#1 /srv/mediawiki/php-1.33.0-wmf.23/includes/libs/rdbms/database/Database.php(1248): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /srv/mediawiki/php-1.33.0-wmf.23/includes/libs/rdbms/database/DatabaseMysqlBase.php(1347): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1091): Wikimedia\Rdbms\DatabaseMysqlBase->upsert(string, array, array, array, string)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1464): WikiPage->insertRedirectEntry(Title)
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1423): WikiPage->updateRedirectOn(Wikimedia\Rdbms\DBConnRef, Title, NULL)
#6 /srv/mediawiki/php-1.33.0-wmf.23/includes/Storage/PageUpdater.php(1125): WikiPage->updateRevisionOn(Wikimedia\Rdbms\DBConnRef, Revision, integer)
#7 /srv/mediawiki/php-1.33.0-wmf.23/includes/Storage/PageUpdater.php(758): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment, User, integer)
#8 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1916): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#9 /srv/mediawiki/php-1.33.0-wmf.23/includes/EditPage.php(2304): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User, string, array, integer)
#10 /srv/mediawiki/php-1.33.0-wmf.23/includes/EditPage.php(1595): EditPage->internalAttemptSave(array, boolean)
#11 /srv/mediawiki/php-1.33.0-wmf.23/includes/EditPage.php(694): EditPage->attemptSave(array)
#12 /srv/mediawiki/php-1.33.0-wmf.23/includes/actions/EditAction.php(60): EditPage->edit()
#13 /srv/mediawiki/php-1.33.0-wmf.23/includes/actions/SubmitAction.php(38): EditAction->show()
#14 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(501): SubmitAction->show()
#15 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#16 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(867): MediaWiki->performRequest()
#17 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(517): MediaWiki->main()
#18 /srv/mediawiki/php-1.33.0-wmf.23/index.php(42): MediaWiki->run()
#19 /srv/mediawiki/w/index.php(3): include(string)
#20 {main}

(Not really private data in there, but redacted just in case)

Hi,

I'm a user at german-spoken Wikipedia. This error get by creating a redirect. About the technical background o.O ;)

Repro:

[XKsV7QpAIDAAAJ8nsi8AAAAW] 2019-04-08 09:35:57: Fataler Ausnahmefehler des Typs „Wikimedia\Rdbms\DBQueryError“

Markus_Schulenburg added a comment.EditedApr 8 2019, 9:42 AM

Update:
If using function Preview (Vorschau) after writing #redirect and than adding a category no error message.

  1. Update:

The error isn't outgoing. He exists furthermore.

Krinkle renamed this task from database error by creating a redirect to Unable to create redirect on dewiki - fatal DBQueryError.Apr 8 2019, 6:11 PM
Krinkle added a subscriber: Krinkle.EditedApr 8 2019, 6:15 PM

There have been previous reports about problems creating redirects, but those were about specific edge cases. See also T120140 and T163597.

I've looked into this report from @Markus_Schulenburg and confirmed it is about very plain creation of a wikipage as a redirect.

For example:

Error
  • Request ID: XKsV7QpAIDAAAJ8nsi8AAAAW

This HTTP-POST request submits the edit form after opening a red link in the main namespace, e.g. https://de.wikipedia.org/w/index.php?title=[Some_title_here]&action=edit&redlink=1. The form destination being /w/index.php?title=[Some_title_here]&action=submit.

message
[XKsV7QpAIDAAAJ8nsi8AAAAW] /w/index.php?title=####&action=submit   Wikimedia\Rdbms\DBQueryError  …
Query: INSERT INTO `redirect` (rd_from,rd_namespace,rd_title,rd_fragment,rd_interwiki) VALUES ('#######','0','##################','','') ON DUPLICATE KEY UPDATE rd_namespace = '0',rd_title = '##################',rd_fragment = '',rd_interwiki = ''
Function: WikiPage::insertRedirectEntry
Error: 1205 Lock wait timeout exceeded; try restarting transaction
trace
#3 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1091): Wikimedia\Rdbms\DatabaseMysqlBase->upsert(string, array, array, array, string)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1464): WikiPage->insertRedirectEntry(Title)
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1423): WikiPage->updateRedirectOn(Wikimedia\Rdbms\DBConnRef, Title, NULL)
#6 /srv/mediawiki/php-1.33.0-wmf.23/includes/Storage/PageUpdater.php(1125): WikiPage->updateRevisionOn(Wikimedia\Rdbms\DBConnRef, Revision, integer)
#7 /srv/mediawiki/php-1.33.0-wmf.23/includes/Storage/PageUpdater.php(758): MediaWiki\Storage\PageUpdater->doCreate(CommentStoreComment, User, integer)
#8 /srv/mediawiki/php-1.33.0-wmf.23/includes/page/WikiPage.php(1916): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#9 /srv/mediawiki/php-1.33.0-wmf.23/includes/EditPage.php(2304): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User, string, array, integer)
#10 /srv/mediawiki/php-1.33.0-wmf.23/includes/EditPage.php(1595): EditPage->internalAttemptSave(array, boolean)
#11 /srv/mediawiki/php-1.33.0-wmf.23/includes/EditPage.php(694): EditPage->attemptSave(array)
#12 /srv/mediawiki/php-1.33.0-wmf.23/includes/actions/EditAction.php(60): EditPage->edit()
#13 /srv/mediawiki/php-1.33.0-wmf.23/includes/actions/SubmitAction.php(38): EditAction->show()
#14 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(501): SubmitAction->show()
#15 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#16 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(867): MediaWiki->performRequest()
#17 /srv/mediawiki/php-1.33.0-wmf.23/includes/MediaWiki.php(517): MediaWiki->main()
#18 /srv/mediawiki/php-1.33.0-wmf.23/index.php(42): MediaWiki->run()
Notes

Might be a recent regression, or a shift in user activity.

CC-ing DBA: Do we know of a change in schema, indexes or query traffic that could explain e.g. why lock contention would be significantly worse?

CC-ing CPT: Any recent changes around PageUpdater->saveRevision or WikiPage->updateRedirectOn that might explain the issue?

So this doesn't really like something "new" right?
I mean, looks like it has been happening before, on a lower scale, but still happening:

Marostegui moved this task from Triage to In progress on the DBA board.Apr 8 2019, 8:01 PM
Krinkle added a comment.EditedApr 9 2019, 2:15 AM

So this doesn't really like something "new" right?
I mean, looks like it has been happening before, on a lower scale, but still happening:
F28596096

Indeed. There have been reports to Logstash of this error message before. But there is more than one way of causing that error message.

As I understand it, the previous reports were from edge cases like T120140/T163597, which are about "redirects during page move" and "redirects with self-referential template".

The new reports are about the common use case of creating a redirect plainly for Wikipedia article names. At least from users, this is the first such report I could find.

Marostegui edited projects, added User-Marostegui; removed DBA.Apr 10 2019, 4:45 AM

Going to untag DBA as the infrastructure is working fine from what we can see. Will remain subscribed in case there are questions or requests for us.

daniel removed daniel as the assignee of this task.May 13 2019, 3:16 PM
daniel added a subscriber: daniel.

Unassigning myself, since I don't know what do to about this. I'm probably not the best person to investigate this issue, either.

How frequent is this? Should it be high priority?

More lock contention around this area, see also T223175.

@Krinkle Do you have a sense of what the level of priority for this task should be? Setting it to normal for now but please correct.

WDoranWMF triaged this task as Normal priority.Aug 13 2019, 6:21 PM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM

@WDoranWMF I'm not entirely sure. Right now it means there are a few cases a week where a user tries to create a redirect article and upon saving has their edit take a number of seconds after which they see a non-descriptive "Internal error" page mentioning "DBQueryError".