Page MenuHomePhabricator

bug in 1.33.0-wmf.18 breaks abstract dumps on testwikidatawiki | MWContentSerializationException $entityId and $targetId can not be the same
Open, MediumPublic

Description

[08a09c9f4968bff42dd6c232] [no req]   MWContentSerializationException from line 299 of /srv/mediawiki/php-1.33.0-wmf.18/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php: $entityId and $targetId can not be the same.

Reproduction case: https://test.wikidata.org/w/index.php?title=Q193394&redirect=no

Req ID: AWk0u32gjSm8tOlx-BX_

Stacktrace for that web request:

#0 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/repo/includes/Content/EntityHandler.php(384): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, NULL)
#1 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionStore.php(1472): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, NULL)
#2 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionStore.php(1634): MediaWiki\Revision\RevisionStore->loadSlotContent(MediaWiki\Revision\SlotRecord, NULL, NULL, NULL, integer)
#3 [internal function]: Closure$MediaWiki\Revision\RevisionStore::loadSlotRecords(MediaWiki\Revision\SlotRecord)
#4 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/SlotRecord.php(307): call_user_func(Closure$MediaWiki\Revision\RevisionStore::loadSlotRecords;2106, MediaWiki\Revision\SlotRecord)
#5 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionRecord.php(175): MediaWiki\Revision\SlotRecord->getContent()
#6 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision.php(923): MediaWiki\Revision\RevisionRecord->getContent(string, integer, User)
#7 /srv/mediawiki/php-1.33.0-wmf.19/includes/page/Article.php(494): Revision->getContent(integer, User)
#8 /srv/mediawiki/php-1.33.0-wmf.19/includes/page/Article.php(714): Article->fetchRevisionRecord()
#9 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/repo/includes/Actions/ViewEntityAction.php(79): Article->view()
#10 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/repo/includes/Actions/ViewEntityAction.php(54): Wikibase\ViewEntityAction->showEntityPage()
#11 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(501): Wikibase\ViewEntityAction->show()
#12 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#13 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(867): MediaWiki->performRequest()
#14 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(517): MediaWiki->main()
#15 /srv/mediawiki/php-1.33.0-wmf.19/index.php(42): MediaWiki->run()
#16 /srv/mediawiki/w/index.php(3): include(string)
#17 {main}

Note there is also a field exception.previous.trace:

#0 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php(296): Wikibase\DataModel\Entity\EntityRedirect->__construct(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Entity\ItemId)
#1 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/repo/includes/Content/EntityHandler.php(384): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, NULL)
#2 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionStore.php(1472): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionStore.php(1634): MediaWiki\Revision\RevisionStore->loadSlotContent(MediaWiki\Revision\SlotRecord, NULL, NULL, NULL, integer)
#4 [internal function]: Closure$MediaWiki\Revision\RevisionStore::loadSlotRecords(MediaWiki\Revision\SlotRecord)
#5 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/SlotRecord.php(307): call_user_func(Closure$MediaWiki\Revision\RevisionStore::loadSlotRecords;2106, MediaWiki\Revision\SlotRecord)
#6 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision/RevisionRecord.php(175): MediaWiki\Revision\SlotRecord->getContent()
#7 /srv/mediawiki/php-1.33.0-wmf.19/includes/Revision.php(923): MediaWiki\Revision\RevisionRecord->getContent(string, integer, User)
#8 /srv/mediawiki/php-1.33.0-wmf.19/includes/page/Article.php(494): Revision->getContent(integer, User)
#9 /srv/mediawiki/php-1.33.0-wmf.19/includes/page/Article.php(714): Article->fetchRevisionRecord()
#10 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/repo/includes/Actions/ViewEntityAction.php(79): Article->view()
#11 /srv/mediawiki/php-1.33.0-wmf.19/extensions/Wikibase/repo/includes/Actions/ViewEntityAction.php(54): Wikibase\ViewEntityAction->showEntityPage()
#12 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(501): Wikibase\ViewEntityAction->show()
#13 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#14 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(867): MediaWiki->performRequest()
#15 /srv/mediawiki/php-1.33.0-wmf.19/includes/MediaWiki.php(517): MediaWiki->main()
#16 /srv/mediawiki/php-1.33.0-wmf.19/index.php(42): MediaWiki->run()
#17 /srv/mediawiki/w/index.php(3): include(string)
#18 {main}

trace from jobrunner
#0 /srv/mediawiki/php-1.33.0-wmf.21/extensions/Wikibase/repo/includes/Content/EntityHandler.php(383): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, NULL)
#1 /srv/mediawiki/php-1.33.0-wmf.21/includes/Revision/RevisionStore.php(1472): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, NULL)
#2 /srv/mediawiki/php-1.33.0-wmf.21/includes/Revision/RevisionStore.php(1634): MediaWiki\Revision\RevisionStore->loadSlotContent(MediaWiki\Revision\SlotRecord, NULL, NULL, NULL, integer)
#3 [internal function]: Closure$MediaWiki\Revision\RevisionStore::loadSlotRecords(MediaWiki\Revision\SlotRecord)
#4 /srv/mediawiki/php-1.33.0-wmf.21/includes/Revision/SlotRecord.php(307): call_user_func(Closure$MediaWiki\Revision\RevisionStore::loadSlotRecords;828, MediaWiki\Revision\SlotRecord)
#5 /srv/mediawiki/php-1.33.0-wmf.21/includes/Revision/RevisionRecord.php(175): MediaWiki\Revision\SlotRecord->getContent()
#6 /srv/mediawiki/php-1.33.0-wmf.21/includes/Revision.php(923): MediaWiki\Revision\RevisionRecord->getContent(string, integer, NULL)
#7 /srv/mediawiki/php-1.33.0-wmf.21/includes/page/WikiPage.php(809): Revision->getContent(integer, NULL)
#8 /srv/mediawiki/php-1.33.0-wmf.21/extensions/CirrusSearch/includes/Sanity/Checker.php(192): WikiPage->getContent()
#9 /srv/mediawiki/php-1.33.0-wmf.21/extensions/CirrusSearch/includes/Sanity/Checker.php(167): CirrusSearch\Sanity\Checker->checkIfRedirect(WikiPage)
#10 /srv/mediawiki/php-1.33.0-wmf.21/extensions/CirrusSearch/includes/Sanity/Checker.php(133): CirrusSearch\Sanity\Checker->checkExisitingPage(string, integer, WikiPage, array)
#11 /srv/mediawiki/php-1.33.0-wmf.21/extensions/CirrusSearch/includes/Job/CheckerJob.php(214): CirrusSearch\Sanity\Checker->check(array)
#12 /srv/mediawiki/php-1.33.0-wmf.21/extensions/CirrusSearch/includes/Job/Job.php(100): CirrusSearch\Job\CheckerJob->doJob()
#13 /srv/mediawiki/php-1.33.0-wmf.21/extensions/EventBus/includes/JobExecutor.php(65): CirrusSearch\Job\Job->run()
#14 /srv/mediawiki/rpc/RunSingleJob.php(77): JobExecutor->execute(array)
#15 {main}

Impact

  • Some pages cannot be viewed, e.g. https://test.wikidata.org/wiki/Q193394 (user is shown unhelpful system error, triggers fatal error, and emits HTTP 500).
  • Some jobs are are aborted mid-way, including CirrusSearch\Job\CheckerJob.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

I am assuming it is a new error from 1.33-wmf.18, moving to that column on Wikimedia-production-error

hashar updated the task description. (Show Details)Feb 28 2019, 3:37 PM

This is a new error in wikibase/data-model 9.1.0, which we updated to in I12df301f95 (head of 1.33.0-wmf.16 according to git) as part of T214920.

According to Quarry, Q193394 is the only self-redirecting item on test.wikidata.org, and there is no such item at all on www.wikidata.org. (Assuming my query is correct, of course.)

Can we just delete the test.wikidata.org page? Such a redirect should not exist, and it is just a test wiki…

It shouldn't exist, but MediaWiki/Wikibase should not throw a fatal exception when handling it, either. Or is it now impossible for such revision text to be saved?

As far as I know it is now impossible, that’s what T214775 was for :) and I’m unable to create a self-redirect via Special:MergeItems, Special:RedirectEntity or action=wbmergeitems now, though I don’t know how Q193394 was originally created.

(Wikibase would still throw a fatal error if someone with appropriate privileges looked at the deleted revisions… not sure if that’s a big deal.)

If that sort of revision can't be created even by api, that's good enough for me. Someone on the MediaWiki side of things probably ought to weigh in on the case you mention above (fatal when viewing the deleted revision).

Well, it’s impossible to delete the page via the API, that just returns the same error. I suppose we could delete it from the database directly, but that’s a pretty extreme solution.

Groan.... can the error be handled differently then? I guess there's not much choice now...

We can probably catch the exception in EntityContentDataCodec::decodeRedirect and rethrow a MWContentSerializationException as is documented there.
However im not sure if that will actually be handled further up the chain?
EntityHandler::unserializeContent is documented as throwing a MWContentSerializationException but ContentHandler::unserializeContent is not.
When we get to MWContentSerializationException though, perhaps this could be handled in WikiExporter for the dump?
Not sure where exactly for the web request path though.

ArielGlenn moved this task from Backlog to Active on the Dumps-Generation board.Mar 4 2019, 12:42 PM

Perhaps there should be a maintenance script to delete such revisions; if we have them, other folks might have them also. I can see such a script getting the raw revision text for a specified id/batch of ids, checking that each one is a self-reference of that sort, and then deleting it without serialization, if there a code path which avoids that.

As far as the dumps in general, they don't expand wikitext, except for the abstracts dumps. For that case, in AbstractFilter.php we can likely add something to writeClosePage which, if it encounters a fatal error of the MWContentSerializationException type, it could log the issue and do

$xml .= Xml::element( 'abstract', [ 'serialization-error' => '' ] ) . "\n";

so that the script can continue on. Thoughts?

Change 494219 had a related patch set uploaded (by ArielGlenn; owner: ArielGlenn):
[mediawiki/extensions/ActiveAbstract@master] when revision serialization fails, indicate the error in the xml

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

Is it possible that the current revision is serialized earlier when the page title is set up? I guess testing will show...

Addshore removed a project: Wikibase-Containers.
Addshore added a project: User-Addshore.

Change 494219 merged by jenkins-bot:
[mediawiki/extensions/ActiveAbstract@master] when revision serialization fails, indicate the error in the xml

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

How is this looking @ArielGlenn ?

hashar removed a subscriber: hashar.Mar 12 2019, 2:23 PM

No joy. It must be triggered somewhere else too; I've imported the bad rev in a (very) old Wikidata installation and am now doing the update/upgrade dance so I can hack away at it locally.

I'll need to catch this in XmlDumpWriter after all. Too bad. dumpTextPass already does the right thing, so we'll do that too.

Change 496348 had a related patch set uploaded (by ArielGlenn; owner: ArielGlenn):
[mediawiki/core@master] don't die producing xml files if rev text export conversion fails

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

I've run the abstracts job on testwikidatawiki with the patch deployed manually on one of the snapshot hosts, and it was successful.

(Still seen on 1.33-wmf.21.)

[{exception_id}] {exception_url} MWContentSerializationException from line 299 of /srv/mediawiki/php-1.33.0-wmf.21/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php: $entityId and $targetId can not be the same.
  • Request ID: 25be09c77941a6bd1bdcdebd (jobrunner)
  • Request ID (2): XJFCTgpAADgAAD45lNcAAACT (app server)
Krinkle updated the task description. (Show Details)Mar 19 2019, 7:31 PM

Change 496348 merged by jenkins-bot:
[mediawiki/core@master] don't die producing xml files if rev text export conversion fails

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

Does XmlDumpWriter need a similar fix at a later stanza? Lines 298, 301 here: https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/443608/46/includes/export/XmlDumpWriter.php Do we have a wiki configured such that this code path can be tested with a broken revision?

And in fact that changeset (https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/443608/) did break this again at exactly the point I asked about above. The new stacktrace:

[0bda89b2b61b164a0232340b] [no req]   MWContentSerializationException from line 299 of /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php: $entityId and $targetId can not be the same.
Backtrace:
#0 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/Content/EntityHandler.php(383): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, NULL)
#1 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/RevisionStore.php(1472): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, NULL)
#2 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/RevisionStore.php(1634): MediaWiki\Revision\RevisionStore->loadSlotContent(MediaWiki\Revision\SlotRecord, NULL, NULL, NULL, integer)
#3 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}(MediaWiki\Revision\SlotRecord)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/SlotRecord.php(307): call_user_func(Closure, MediaWiki\Revision\SlotRecord)
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/XmlDumpWriter.php(302): MediaWiki\Revision\SlotRecord->getContent()
#6 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(485): XmlDumpWriter->writeRevision(stdClass)
#7 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(445): WikiExporter->outputPageStreamBatch(Wikimedia\Rdbms\ResultWrapper, stdClass)
#8 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(269): WikiExporter->dumpPages(string, boolean)
#9 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(154): WikiExporter->dumpFrom(string, boolean)
#10 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/includes/BackupDumper.php(288): WikiExporter->pagesByRange(integer, integer, boolean)
#11 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/dumpBackup.php(83): BackupDumper->dump(integer, integer)
#12 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/doMaintenance.php(94): DumpBackup->execute()
#13 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/dumpBackup.php(138): require_once(string)
#14 /srv/mediawiki/multiversion/MWScript.php(100): require_once(string)
#15 {main}

I'll look at it tomorrow and put up a patch if someone else hasn't gotten to it by then.

Fixing me that gives me a failure later on:

2019-03-27 07:25:10: testwikidatawiki (ID 54422) 6 pages (32.9|363.6/sec all|curr), 7 revs (38.4|60.6/sec all|curr), ETA 2019-03-27 09:29:56 [max 287591]
[e1818746fd28c6a70c6cf5a5] [no req]   MWContentSerializationException from line 299 of /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php: $entityId and $targetId can not be the same.
Backtrace:
#0 /srv/mediawiki/php-1.33.0-wmf.23/extensions/Wikibase/repo/includes/Content/EntityHandler.php(383): Wikibase\Lib\Store\EntityContentDataCodec->decodeRedirect(string, NULL)
#1 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/RevisionStore.php(1472): Wikibase\Repo\Content\EntityHandler->unserializeContent(string, NULL)
#2 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/RevisionStore.php(1634): MediaWiki\Revision\RevisionStore->loadSlotContent(MediaWiki\Revision\SlotRecord, NULL, NULL, NULL, integer)
#3 [internal function]: MediaWiki\Revision\RevisionStore->MediaWiki\Revision\{closure}(MediaWiki\Revision\SlotRecord)
#4 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/SlotRecord.php(307): call_user_func(Closure, MediaWiki\Revision\SlotRecord)
#5 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision/RevisionRecord.php(175): MediaWiki\Revision\SlotRecord->getContent()
#6 /srv/mediawiki/php-1.33.0-wmf.23/includes/Revision.php(1086): MediaWiki\Revision\RevisionRecord->getContent(string)
#7 /srv/mediawiki/php-1.33.0-wmf.23/extensions/ActiveAbstract/AbstractFilter.php(250): Revision::getRevisionText(stdClass)
#8 /srv/mediawiki/php-1.33.0-wmf.23/extensions/ActiveAbstract/AbstractFilter.php(129): AbstractFilter->sectionLinks(stdClass)
#9 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/DumpFilter.php(81): AbstractFilter->writeClosePage(string)
#10 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/ExportProgressFilter.php(39): DumpFilter->writeClosePage(string)
#11 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(480): ExportProgressFilter->writeClosePage(string)
#12 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(445): WikiExporter->outputPageStreamBatch(Wikimedia\Rdbms\ResultWrapper, stdClass)
#13 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(269): WikiExporter->dumpPages(string, boolean)
#14 /srv/mediawiki/php-1.33.0-wmf.23/includes/export/WikiExporter.php(154): WikiExporter->dumpFrom(string, boolean)
#15 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/includes/BackupDumper.php(288): WikiExporter->pagesByRange(integer, integer, boolean)
#16 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/dumpBackup.php(83): BackupDumper->dump(integer, integer)
#17 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/doMaintenance.php(94): DumpBackup->execute()
#18 /srv/mediawiki/php-1.33.0-wmf.23/maintenance/dumpBackup.php(138): require_once(string)
#19 /srv/mediawiki/multiversion/MWScript.php(100): require_once(string)
#20 {main}

Change 499402 had a related patch set uploaded (by ArielGlenn; owner: ArielGlenn):
[mediawiki/core@master] redo: don't die producing xml files if rev text export conversion fails

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

Change 499403 had a related patch set uploaded (by ArielGlenn; owner: ArielGlenn):
[mediawiki/extensions/ActiveAbstract@master] don't die when revision serialization fails during link processing

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

I dislike both of the above patches and I don't have better ideas. I've run the abstracts job with these patches applied just to get the dump file produced for this run.

I've added @Addshore and @daniel to the patches to have a look. I've run the abstracts manually for this one wiki for the last two runs; if we could get this fixed up by the 20th I can avoid it a fourth time ;-)

If I understand correctly, the presence of these errors indicates invalid data in the database. This should not just be ignored. On the other hand, MediaWiki should not fatal out either. I suspect that the same error would not just occur while generating dumps, but also when trying to view the respective revision?

In general, exception handling should happen as close to the UI as possible. For bulk operations like dump generation, that is of course inconvenient, since it would abort the dump. Exceptions should be caught in a way that allows dump generation to proceed, but the exception should be reported to the user somehow, both on the CLI as well as on Special:Export.

By the way: $entityId and $targetId can not be the same is somewhat alarming. It indicates that an invalid entity redirect exists in the database of testwikidatawiki. I wonder how that happened.

By the way: $entityId and $targetId can not be the same is somewhat alarming. It indicates that an invalid entity redirect exists in the database of testwikidatawiki. I wonder how that happened.

Someone entered it for testing, I imagine. But it cannot now be deleted. And in any case the code should be resilient against these sorts of errors.

If I understand correctly, the presence of these errors indicates invalid data in the database. This should not just be ignored. On the other hand, MediaWiki should not fatal out either. I suspect that the same error would not just occur while generating dumps, but also when trying to view the respective revision?

It does; that's mentioned above (see Impact in the task description. But I don't want to try to fix MW generally. The dumps scripts should handle any errors thrown at them by MW core, and I'll be updating the patches accordingly, thanks for your comments.

Krinkle removed a subscriber: Krinkle.Apr 1 2019, 3:39 PM

Change 499402 merged by jenkins-bot:
[mediawiki/core@master] redo: don't die producing xml files if rev text export conversion fails

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

Change 499403 merged by jenkins-bot:
[mediawiki/extensions/ActiveAbstract@master] don't die when revision serialization fails during link processing

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

@ArielGlenn Is this resolved?

Fixed for dumps but not within MediaWiki, i.e. https://test.wikidata.org/w/index.php?title=Q193394&redirect=no still gives an error. The bad entry needs to be removed or MW should do something nicer about such entries.

As this is just test wiki (and not a real wiki), and that this can no longer occur, perhaps we should just totally nuke the page from the db

I'm fine with that approach.

Still seen on 1.34-wmf.8.

  • XPam4gpAICsAAEeT0uEAAAAR
  • GET testwikidatawiki /w/index.php?title=Q193394&redirect=no

Fatal exception: MWContentSerializationException from line 299 of /srv/mediawiki/php-1.34.0-wmf.8/extensions/Wikibase/lib/includes/Store/EntityContentDataCodec.php: $entityId and $targetId can not be the same.

Addshore closed this task as Resolved.Jun 30 2019, 5:11 PM
Addshore claimed this task.

So, I tried deleting in the UI and also with deleteBatch, but both failed with exceptions but deleteBatch seemed to actually do the delete.

I have restored the first revision of the entity, and made a new revision linking to this ticket, and have protected the item.
I guess we should no longer see these exceptions for this item (unless someone goes and restores those revisions, which they should not).

So closing this!

daniel removed a subscriber: daniel.Jun 30 2019, 9:15 PM
ArielGlenn moved this task from Active to Done on the Dumps-Generation board.Jul 20 2019, 5:23 AM
ArielGlenn reopened this task as Open.Jul 22 2019, 8:23 AM
ArielGlenn lowered the priority of this task from High to Medium.

Re-opening for the underlying issue ( bad revision redirect). See https://www.wikidata.org/w/index.php?title=Q4672180&oldid=410362640 Same stack trace in Wikibase, see T228614#5352340

WDoranWMF moved this task from MCR to mop on the Core Platform Team board.Jul 26 2019, 6:39 PM

@ArielGlenn do I understand correctly however that this revision on wikidata.org is not an issue for dumps?

We probably don't want to delete the revision from wikidata.org.
A nice way to handle this in the UI might be to just accept the fact that the deserializes do not deserialize the revision and display the entity JSON instead.
Alternatively we could poke the deserializers to allow redirecting to ones self, but really this should never have been possible, but maybe there is somewhere else we could put the check..

The python scripts at the dump end are (mostly) protected against exceptions from MediaWiki generally and from this failure case in particular. Since we have problematic data in production I've re-opened the ticket so that the WikiBase issue can somehow be resolved.

It's a shame we have cases of self redirects already in history that we have to try to deal with.

@alaa_wmde thoughts?
basically when coming from storage, we want to allow deserialization and serialization.
when coming from a user we want to disallow it.
Then when we load such cases from storage to display to users in JSON we can just show them the JSON, and when displaying them the UI we can show them a page stating that this revision of the entity is invalid.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:07 PM
Addshore removed Addshore as the assignee of this task.Oct 30 2019, 1:54 PM
Addshore moved this task from incoming to needs discussion or investigation on the Wikidata board.