Page MenuHomePhabricator

Fatal when saving "Undo" edit on merged Wikidata item
Closed, ResolvedPublic

Description

Apparently an exception is thrown when someone tries to undo a change in the history of an item that has become a redirect. This happend 14 times in the last 7 days, see logstash.

Stacktrace:

Diff\Patcher\PatcherException from line 596 of /srv/mediawiki/php-1.34.0-wmf.5/extensions/Wikibase/repo/includes/Content/EntityContent.php: EntityContent must not contain Entity data as well as a redirect after applying

#0 /srv/mediawiki/php-1.34.0-wmf.5/extensions/Wikibase/repo/includes/Actions/EditEntityAction.php(265): Wikibase\EntityContent->getPatchedCopy(Wikibase\Repo\Content\EntityContentDiff)
#1 /srv/mediawiki/php-1.34.0-wmf.5/extensions/Wikibase/repo/includes/Actions/EditEntityAction.php(211): Wikibase\EditEntityAction->showUndoForm()
#2 /srv/mediawiki/php-1.34.0-wmf.5/includes/MediaWiki.php(499): Wikibase\EditEntityAction->show()
#3 /srv/mediawiki/php-1.34.0-wmf.5/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#4 /srv/mediawiki/php-1.34.0-wmf.5/includes/MediaWiki.php(865): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.34.0-wmf.5/includes/MediaWiki.php(515): MediaWiki->main()
#6 /srv/mediawiki/php-1.34.0-wmf.5/index.php(42): MediaWiki->run()
#7 /srv/mediawiki/w/index.php(3): include(string)
#8 {main}

Event Timeline

Michael created this task.May 21 2019, 2:45 PM
Restricted Application added a project: Wikidata. · View Herald TranscriptMay 21 2019, 2:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle added a subscriber: Krinkle.

@Michael If you want, there is a template you can use for this kind of task. Via "Create TaskReport Error Code", or via Wikimedia-production-error → "Report Error".

@Michael If you want, there is a template you can use for this kind of task. Via "Create TaskReport Error Code", or via Wikimedia-production-error → "Report Error".

Thank you, I wasn't aware of that. I will use it in the future :)

Krinkle renamed this task from Exception in Production when trying to undo a change on a merged item to Fatal when saving "Undo" edit on merged Wikidata item.Jul 1 2019, 4:54 PM

Still seen on 1.34-wmf.11:

  • Request URL: /w/index.php?title= Q… &action=edit&undoafter= … &undo= … 
  • Request ID: XReOdQpAAEIAAEDJ-ZkAAAAF
message
Diff\Patcher\PatcherException:
EntityContent must not contain Entity data as well as a redirect after applying the patch!
trace
#0 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Wikibase/repo/includes/Actions/EditEntityAction.php(265): Wikibase\EntityContent->getPatchedCopy(Wikibase\Repo\Content\EntityContentDiff)
#1 /srv/mediawiki/php-1.34.0-wmf.11/extensions/Wikibase/repo/includes/Actions/EditEntityAction.php(211): Wikibase\EditEntityAction->showUndoForm()
#2 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(499): Wikibase\EditEntityAction->show()
#3 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#4 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(884): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.34.0-wmf.11/includes/MediaWiki.php(515): MediaWiki->main()
#6 /srv/mediawiki/php-1.34.0-wmf.11/index.php(42): MediaWiki->run()
#7 /srv/mediawiki/w/index.php(3): include(string)
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM
Krinkle closed this task as Resolved.Oct 19 2019, 8:59 PM

In WMF Logstash the last 30 days contain no exception messages for PatcherException.

I also checked the original user scenario from the task description. While it does still fail, it now fails with a user-facing message about what the problem is (not an HTTP 500 internal server error).

Undo failed

Site link frwiki:Catégorie:Artiste d'Ariston (label) is already used by item Q9179421. Perhaps the items should be merged and one of them deleted? Request deletion of one of the items at d:Wikidata:Requests for deletions, or ask at d:Wikidata:Interwiki conflicts if you believe that they should not be merged.