Page MenuHomePhabricator

Duplicate entry 'emoji' for key 'ctd_name'
Closed, ResolvedPublicPRODUCTION ERROR

Description

2018-08-14 16:05:36 [W3L90ApAICwAALRGvd4AAABC] mw1323 cswiki 1.32.0-wmf.16 exception ERROR: [W3L90ApAICwAALRGvd4AAABC] /wiki/Speci%C3%A1ln%C3%AD:Zna%C4%8Dky/deactivate   Wikimedia\Rdbms\DBTransactionStateError from line 1303 of /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php: Cannot execute query from Wikimedia\Rdbms\Database::ping while transaction status is ERROR. {"exception_id":"W3L90ApAICwAALRGvd4AAABC","exception_url":"/wiki/Speci%C3%A1ln%C3%AD:Zna%C4%8Dky/deactivate","caught_by":"mwe_handler"} 
[Exception Wikimedia\Rdbms\DBTransactionStateError] (/srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php:1303) Cannot execute query from Wikimedia\Rdbms\Database::ping while transaction status is ERROR.
  #0 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php(1087): Wikimedia\Rdbms\Database->assertTransactionStatus(string, string)
  #1 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php(4045): Wikimedia\Rdbms\Database->query(string, string, boolean)
  #2 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php(703): Wikimedia\Rdbms\Database->ping(NULL)
  #3 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php(3899): Wikimedia\Rdbms\Database->pendingWriteQueryDuration(string)
  #4 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1501): Wikimedia\Rdbms\Database->rollback(string, string)
  #5 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1746): Closure$Wikimedia\Rdbms\LoadBalancer::rollbackMasterChanges(Wikimedia\Rdbms\DatabaseMysqli)
  #6 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1502): Wikimedia\Rdbms\LoadBalancer->forEachOpenMasterConnection(Closure$Wikimedia\Rdbms\LoadBalancer::rollbackMasterChanges;430)
  #7 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/lbfactory/LBFactory.php(219): Wikimedia\Rdbms\LoadBalancer->rollbackMasterChanges(string)
  #8 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/lbfactory/LBFactoryMulti.php(425): Closure$Wikimedia\Rdbms\LBFactory::forEachLBCallMethod(Wikimedia\Rdbms\LoadBalancer, string, array)
  #9 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/lbfactory/LBFactory.php(222): Wikimedia\Rdbms\LBFactoryMulti->forEachLB(Closure$Wikimedia\Rdbms\LBFactory::forEachLBCallMethod;171, array)
  #10 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/lbfactory/LBFactory.php(289): Wikimedia\Rdbms\LBFactory->forEachLBCallMethod(string, array)
  #11 /srv/mediawiki/php-1.32.0-wmf.16/includes/exception/MWExceptionHandler.php(100): Wikimedia\Rdbms\LBFactory->rollbackMasterChanges(string)
  #12 /srv/mediawiki/php-1.32.0-wmf.16/includes/exception/MWExceptionHandler.php(148): MWExceptionHandler::rollbackMasterChangesAndLog(Wikimedia\Rdbms\DBQueryError)
  #13 /srv/mediawiki/php-1.32.0-wmf.16/includes/MediaWiki.php(551): MWExceptionHandler::handleException(Wikimedia\Rdbms\DBQueryError)
  #14 /srv/mediawiki/php-1.32.0-wmf.16/index.php(42): MediaWiki->run()
  #15 /srv/mediawiki/w/index.php(3): include(string)
  #16 {main}
Caused by: [Exception Wikimedia\Rdbms\DBQueryError] (/srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php:1443) A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: UPDATE  `change_tag_def` SET ctd_name = 'emoji' WHERE ctd_user_defined = '0'
Function: ChangeTags::undefineTag
Error: 1062 Duplicate entry 'emoji' for key 'ctd_name' (10.64.0.110)

  #0 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php(1180): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
  #1 /srv/mediawiki/php-1.32.0-wmf.16/includes/libs/rdbms/database/Database.php(2059): Wikimedia\Rdbms\Database->query(string, string)
  #2 /srv/mediawiki/php-1.32.0-wmf.16/includes/changetags/ChangeTags.php(922): Wikimedia\Rdbms\Database->update(string, array, array, string)
  #3 /srv/mediawiki/php-1.32.0-wmf.16/includes/changetags/ChangeTags.php(1102): ChangeTags::undefineTag(string)
  #4 /srv/mediawiki/php-1.32.0-wmf.16/includes/specials/SpecialTags.php(445): ChangeTags::deactivateTagWithChecks(string, string, User, boolean)
  #5 /srv/mediawiki/php-1.32.0-wmf.16/includes/htmlform/HTMLForm.php(662): SpecialTags->processTagForm(array, OOUIHTMLForm)
  #6 /srv/mediawiki/php-1.32.0-wmf.16/includes/htmlform/HTMLForm.php(554): HTMLForm->trySubmit()
  #7 /srv/mediawiki/php-1.32.0-wmf.16/includes/htmlform/HTMLForm.php(569): HTMLForm->tryAuthorizedSubmit()
  #8 /srv/mediawiki/php-1.32.0-wmf.16/includes/specials/SpecialTags.php(436): HTMLForm->show()
  #9 /srv/mediawiki/php-1.32.0-wmf.16/includes/specials/SpecialTags.php(63): SpecialTags->showActivateDeactivateForm(string, boolean)
  #10 /srv/mediawiki/php-1.32.0-wmf.16/includes/specialpage/SpecialPage.php(566): SpecialTags->execute(string)
  #11 /srv/mediawiki/php-1.32.0-wmf.16/includes/specialpage/SpecialPageFactory.php(569): SpecialPage->run(string)
  #12 /srv/mediawiki/php-1.32.0-wmf.16/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
  #13 /srv/mediawiki/php-1.32.0-wmf.16/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #14 /srv/mediawiki/php-1.32.0-wmf.16/includes/MediaWiki.php(524): MediaWiki->main()
  #15 /srv/mediawiki/php-1.32.0-wmf.16/index.php(42): MediaWiki->run()
  #16 /srv/mediawiki/w/index.php(3): include(string)
  #17 {main}

Event Timeline

Reedy created this task.Aug 14 2018, 4:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 14 2018, 4:11 PM
Reedy added a subscriber: Urbanecm.Aug 14 2018, 4:12 PM

okay, I was able to reproduce this but It doesn't make any sense :/

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptAug 14 2018, 6:56 PM

Holy shit, I made a huge fuck up. I fix it NOW.

Change 452739 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/core@master] Swap SET and WHERE statements in ChangeTags::undefineTag

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

Change 452739 merged by jenkins-bot:
[mediawiki/core@master] Swap SET and WHERE statements in ChangeTags::undefineTag

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

Ladsgroup triaged this task as Unbreak Now! priority.Aug 15 2018, 11:07 AM
Restricted Application added subscribers: Liuxinyu970226, TerraCodes. · View Herald TranscriptAug 15 2018, 11:07 AM

Change 452921 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/core@wmf/1.32.0-wmf.16] Swap SET and WHERE statements in ChangeTags::undefineTag

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

Change 452921 merged by jenkins-bot:
[mediawiki/core@wmf/1.32.0-wmf.16] Swap SET and WHERE statements in ChangeTags::undefineTag

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

Mentioned in SAL (#wikimedia-operations) [2018-08-15T12:04:02Z] <ladsgroup@deploy1001> Synchronized php-1.32.0-wmf.16/includes/changetags/ChangeTags.php: [[gerrit:452921|Swap SET and WHERE statements in ChangeTags::undefineTag (T201934)]] (duration: 00m 55s)

Ladsgroup closed this task as Resolved.Aug 15 2018, 12:05 PM
Ladsgroup moved this task from Incoming to Done on the Wikidata-Campsite board.

I will write regression tests for this later today.

Restricted Application added a project: Wikidata. · View Herald TranscriptNov 28 2018, 3:11 AM
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM