Page MenuHomePhabricator

Page can't be moved: InvalidArgumentException: Revision belongs to different page ID than Title object
Closed, ResolvedPublicPRODUCTION ERROR

Description

A page https://ru.wikipedia.org/wiki/Template:TheFinalBall can't be moved to new name Template:Playmakerstats due to error

InvalidArgumentException: Revision 110673861 belongs to page ID 5832265, the provided Title object belongs to page ID 8595576

/srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RevisionStore.php:1630
trace
#0 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RevisionStore.php(2970): MediaWiki\Revision\RevisionStore->ensureRevisionRowMatchesTitle(stdClass, Title, array)
#1 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3526): MediaWiki\Revision\RevisionStore->getKnownCurrentRevision(Title)
#2 [internal function]: Parser::statelessFetchRevisionRecord(Title, Parser)
#3 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RenderedRevision.php(389): call_user_func(array, Title, Parser)
#4 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3471): MediaWiki\Revision\RenderedRevision->MediaWiki\Revision\{closure}(Title, Parser)
#5 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3622): Parser->fetchCurrentRevisionRecordOfTitle(Title)
#6 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3538): Parser->statelessFetchTemplate(Title, Parser)
#7 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3406): Parser->fetchTemplateAndTitle(Title)
#8 /srv/mediawiki/php-1.36.0-wmf.18/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(717): Parser->getTemplateDom(Title)
#9 /srv/mediawiki/php-1.36.0-wmf.18/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxCallback.php(26): Scribunto_LuaEngine->expandTemplate(string, string, array)
#10 [internal function]: Scribunto_LuaSandboxCallback->__call(string, array)
#11 /srv/mediawiki/php-1.36.0-wmf.18/extensions/Scribunto/includes/engines/LuaSandbox/LuaSandboxInterpreter.php(113): LuaSandboxFunction->call(LuaSandboxFunction)
#12 /srv/mediawiki/php-1.36.0-wmf.18/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(291): Scribunto_LuaSandboxInterpreter->callFunction(LuaSandboxFunction, LuaSandboxFunction)
#13 /srv/mediawiki/php-1.36.0-wmf.18/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(68): Scribunto_LuaEngine->executeFunctionChunk(LuaSandboxFunction, PPTemplateFrame_Hash)
#14 /srv/mediawiki/php-1.36.0-wmf.18/extensions/Scribunto/includes/common/Hooks.php(128): Scribunto_LuaModule->invoke(string, PPTemplateFrame_Hash)
#15 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3347): ScribuntoHooks::invokeHook(Parser, PPTemplateFrame_Hash, array)
#16 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3034): Parser->callParserFunction(PPTemplateFrame_Hash, string, array)
#17 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/PPFrame_Hash.php(253): Parser->braceSubstitution(array, PPTemplateFrame_Hash)
#18 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(3223): PPFrame_Hash->expand(PPNode_Hash_Tree)
#19 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/PPFrame_Hash.php(253): Parser->braceSubstitution(array, PPFrame_Hash)
#20 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(2872): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#21 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(1545): Parser->replaceVariables(string)
#22 /srv/mediawiki/php-1.36.0-wmf.18/includes/parser/Parser.php(646): Parser->internalParse(string)
#23 /srv/mediawiki/php-1.36.0-wmf.18/includes/content/WikitextContent.php(375): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#24 /srv/mediawiki/php-1.36.0-wmf.18/includes/content/AbstractContent.php(591): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#25 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RenderedRevision.php(266): AbstractContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#26 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#27 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#28 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#29 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#30 /srv/mediawiki/php-1.36.0-wmf.18/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#31 /srv/mediawiki/php-1.36.0-wmf.18/includes/Storage/DerivedPageDataUpdater.php(1337): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#32 [internal function]: MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#33 /srv/mediawiki/php-1.36.0-wmf.18/includes/edit/PreparedEdit.php(104): call_user_func(array)
#34 /srv/mediawiki/php-1.36.0-wmf.18/includes/edit/PreparedEdit.php(119): MediaWiki\Edit\PreparedEdit->getOutput()
#35 /srv/mediawiki/php-1.36.0-wmf.18/includes/Storage/DerivedPageDataUpdater.php(1315): MediaWiki\Edit\PreparedEdit->__get(string)
#36 /srv/mediawiki/php-1.36.0-wmf.18/includes/page/WikiPage.php(2066): MediaWiki\Storage\DerivedPageDataUpdater->getPreparedEdit()
#37 /srv/mediawiki/php-1.36.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevs.php(1006): WikiPage->prepareContentForEdit(WikitextContent, NULL, User)
#38 /srv/mediawiki/php-1.36.0-wmf.18/extensions/FlaggedRevs/backend/FlaggedRevsHooks.php(568): FlaggedRevs::autoReviewEdit(FlaggableWikiPage, User, MediaWiki\Revision\RevisionStoreRecord, array)
#39 /srv/mediawiki/php-1.36.0-wmf.18/includes/HookContainer/HookContainer.php(333): FlaggedRevsHooks::maybeMakeEditReviewed(WikiPage, MediaWiki\Revision\RevisionStoreRecord, integer, User, array)
#40 /srv/mediawiki/php-1.36.0-wmf.18/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#41 /srv/mediawiki/php-1.36.0-wmf.18/includes/HookContainer/HookRunner.php(3230): MediaWiki\HookContainer\HookContainer->run(string, array)
#42 /srv/mediawiki/php-1.36.0-wmf.18/includes/MovePage.php(955): MediaWiki\HookContainer\HookRunner->onRevisionFromEditComplete(WikiPage, MediaWiki\Revision\RevisionStoreRecord, integer, User, array)
#43 /srv/mediawiki/php-1.36.0-wmf.18/includes/MovePage.php(584): MovePage->moveToInternal(User, Title, string, boolean, array)
#44 /srv/mediawiki/php-1.36.0-wmf.18/includes/MovePage.php(430): MovePage->moveUnsafe(User, string, boolean, array)
#45 /srv/mediawiki/php-1.36.0-wmf.18/includes/specials/SpecialMovepage.php(852): MovePage->moveIfAllowed(User, string, boolean)
#46 /srv/mediawiki/php-1.36.0-wmf.18/includes/specials/SpecialMovepage.php(198): MovePageForm->doSubmit()
#47 /srv/mediawiki/php-1.36.0-wmf.18/includes/specialpage/SpecialPage.php(607): MovePageForm->execute(NULL)
#48 /srv/mediawiki/php-1.36.0-wmf.18/includes/specialpage/SpecialPageFactory.php(1188): SpecialPage->run(NULL)
#49 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#50 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(945): MediaWiki->performRequest()
#51 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(548): MediaWiki->main()
#52 /srv/mediawiki/php-1.36.0-wmf.18/index.php(53): MediaWiki->run()
#53 /srv/mediawiki/php-1.36.0-wmf.18/index.php(46): wfIndexMain()
#54 /srv/mediawiki/w/index.php(3): require(string)
#55 {main}

Reported by other user in ruwiki on November 24, confirmed by me.

followed by

The Title object yields no ID. Perhaps the page [[Шаблон:Playmakerstats]] doesn't exist?

/srv/mediawiki/php-1.36.0-wmf.18/includes/deferred/LinksUpdate.php:140
trace
#0 /srv/mediawiki/php-1.36.0-wmf.18/includes/Storage/DerivedPageDataUpdater.php(1365): LinksUpdate->__construct(Title, ParserOutput, boolean)
#1 /srv/mediawiki/php-1.36.0-wmf.18/includes/deferred/RefreshSecondaryDataUpdate.php(83): MediaWiki\Storage\DerivedPageDataUpdater->getSecondaryDataUpdates(boolean)
#2 /srv/mediawiki/php-1.36.0-wmf.18/includes/deferred/DeferredUpdates.php(467): RefreshSecondaryDataUpdate->doUpdate()
#3 /srv/mediawiki/php-1.36.0-wmf.18/includes/deferred/DeferredUpdates.php(344): DeferredUpdates::attemptUpdate(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#4 /srv/mediawiki/php-1.36.0-wmf.18/includes/deferred/DeferredUpdates.php(278): DeferredUpdates::run(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti, Monolog\Logger, BufferingStatsdDataFactory, string)
#5 /srv/mediawiki/php-1.36.0-wmf.18/includes/deferred/DeferredUpdates.php(194): DeferredUpdates::handleUpdateQueue(array, string, integer)
#6 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(1118): DeferredUpdates::doUpdates(string)
#7 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(854): MediaWiki->restInPeace()
#8 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(866): MediaWiki->{closure}()
#9 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(587): MediaWiki->doPostOutputShutdown()
#10 /srv/mediawiki/php-1.36.0-wmf.18/index.php(53): MediaWiki->run()
#11 /srv/mediawiki/php-1.36.0-wmf.18/index.php(46): wfIndexMain()
#12 /srv/mediawiki/w/index.php(3): require(string)
#13 {main}

Details

Request ID
16b63f38-fcdc-49b8-bf9c-80161d33b4ec

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Production Error".Nov 28 2020, 6:12 PM
Aklapper renamed this task from Page can't be moved to Page can't be moved: InvalidArgumentException: Revision belongs to different page ID than Title object.Nov 28 2020, 6:16 PM
Aklapper set Request ID to 16b63f38-fcdc-49b8-bf9c-80161d33b4ec.
Aklapper updated the task description. (Show Details)
Aklapper edited Stack Trace. (Show Details)

It can be the same issue than T248175. But can be not, because T248175 could be fixed by deleting and restoring the page, this issue can't be repaired this way (tested now).

Ruwiki admin Helgo13 renamed this page by unchecking all options and renaming subpages separately. Without unchecking, he can't rename it too.

Krinkle edited Stack Trace. (Show Details)
Krinkle added a subscriber: Krinkle.

This sounds familiar. I suspect there is or recently was another issue with the RevisionStore about Revision belongs to different page ID involving page renames.

Seen again

MediaWiki version: 1.36.0-wmf.21

message
Revision 819371998 belongs to page ID 56252475, the provided Title object belongs to page ID 41871839
trace
#0 /srv/mediawiki/php-1.36.0-wmf.21/includes/Revision/RevisionStore.php(2970): MediaWiki\Revision\RevisionStore->ensureRevisionRowMatchesTitle(stdClass, Title, array)
#1 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/WikiPage.php(718): MediaWiki\Revision\RevisionStore->getKnownCurrentRevision(Title, integer)
#2 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/WikiPage.php(755): WikiPage->loadLastEdit()
#3 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/WikiPage.php(605): WikiPage->getRevisionRecord()
#4 /srv/mediawiki/php-1.36.0-wmf.21/includes/libs/objectcache/wancache/WANObjectCache.php(1562): WikiPage->{closure}(boolean, integer, array, NULL, array)
#5 /srv/mediawiki/php-1.36.0-wmf.21/includes/libs/objectcache/wancache/WANObjectCache.php(1389): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)
#6 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/WikiPage.php(623): WANObjectCache->getWithSetCallback(string, integer, Closure)
#7 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/WikiPage.php(278): WikiPage->getContentModel()
#8 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/WikiPage.php(264): WikiPage->getContentHandler()
#9 /srv/mediawiki/php-1.36.0-wmf.21/includes/page/Article.php(2496): WikiPage->getActionOverrides()
#10 /srv/mediawiki/php-1.36.0-wmf.21/includes/actions/Action.php(130): Article->getActionOverrides()
#11 /srv/mediawiki/php-1.36.0-wmf.21/includes/actions/Action.php(189): Action::factory(string, Article, RequestContext)
#12 /srv/mediawiki/php-1.36.0-wmf.21/includes/MediaWiki.php(169): Action::getActionName(RequestContext)
#13 /srv/mediawiki/php-1.36.0-wmf.21/includes/MediaWiki.php(908): MediaWiki->getAction()
#14 /srv/mediawiki/php-1.36.0-wmf.21/includes/MediaWiki.php(548): MediaWiki->main()
#15 /srv/mediawiki/php-1.36.0-wmf.21/index.php(53): MediaWiki->run()
#16 /srv/mediawiki/php-1.36.0-wmf.21/index.php(46): wfIndexMain()
#17 /srv/mediawiki/w/index.php(3): require(string)
#18 {main}
tstarling raised the priority of this task from High to Unbreak Now!.Dec 15 2020, 10:19 PM
tstarling added a subscriber: tstarling.

Via log entries we found that a normal page view https://en.wikipedia.org/wiki/Module:Jct/city/Chinissai always gives a fatal error "Revision 819371998 belongs to page ID 56252475, the provided Title object belongs to page ID 41871839".

page_latest points to a revision with a non-matching rev_page:

MariaDB [enwiki]> select * from page where page_id=41871839\G
*************************** 1. row ***************************
           page_id: 41871839
    page_namespace: 828
        page_title: Jct/city/Chinissai
 page_restrictions: 
  page_is_redirect: 0
       page_is_new: 0
       page_random: 0.565422607467
      page_touched: 20201121214959
page_links_updated: 20200908091534
       page_latest: 819371998
          page_len: 770
page_content_model: Scribunto
         page_lang: NULL
1 row in set (0.01 sec)

MariaDB [enwiki]> select * from revision where rev_id=819371998\G
*************************** 1. row ***************************
        rev_id: 819371998
      rev_page: 56252475
rev_comment_id: 0
     rev_actor: 0
 rev_timestamp: 20180109003929
rev_minor_edit: 1
   rev_deleted: 0
       rev_len: 770
 rev_parent_id: 719985548
      rev_sha1: p2xlofgq5e128haflb0m5op8r8idvkf
1 row in set (0.00 sec)

MariaDB [enwiki]> select * from page where page_id=56252475\G
*************************** 1. row ***************************
           page_id: 56252475
    page_namespace: 828
        page_title: Jct/city/sandbox
 page_restrictions: 
  page_is_redirect: 0
       page_is_new: 0
       page_random: 0.797021167021
      page_touched: 20201121215201
page_links_updated: 20201121095603
       page_latest: 909704194
          page_len: 1384
page_content_model: Scribunto
         page_lang: NULL
1 row in set (0.00 sec)

You can see evidence that this occurred as the result of a page move.

To me, ongoing database corruption leading to completely broken page views is a UBN.

@Clarakosi is the report above related to moving pages? The exception itself is just a symptom, it happens when the internal state of Title objects gets out of whack. This may be due to totally unrelated causes. From the stack trace it seems to me like this one is different. Can you provide more information abotu the request that trigegred it? GET or POST? What action? What page?

Via log entries we found that a normal page view https://en.wikipedia.org/wiki/Module:Jct/city/Chinissai always gives a fatal error "Revision 819371998 belongs to page ID 56252475, the provided Title object belongs to page ID 41871839".

page_latest points to a revision with a non-matching rev_page:

I recommend filing a separate ticket to avoid confusion. As far as I can tell, the symptom is similar, but the cause appears to be totally different from what this ticket is about.

Unless perhaps the inconsistency in the database was caused by a page move gone wrong...

I recommend filing a separate ticket to avoid confusion. As far as I can tell, the symptom is similar, but the cause appears to be totally different from what this ticket is about.

Unless perhaps the inconsistency in the database was caused by a page move gone wrong...

The inconsistency in the database was probably caused by a page move gone wrong. But I can file a separate task anyway.

tstarling lowered the priority of this task from Unbreak Now! to High.Dec 15 2020, 10:28 PM

There is already T263340 for Module:Jct/city/Chinissai.

The inconsistency in the database was probably caused by a page move gone wrong. But I can file a separate task anyway.

Right, sorry, I missed this bit.

It's interesting to note that all reports seem to be related to Scribunto somehow.

Change 683242 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] RevisionStore: don't die on mismatching Titles

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

Change 683242 merged by jenkins-bot:

[mediawiki/core@master] RevisionStore: don't die on mismatching Titles

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

tstarling claimed this task.

Presumably fixed.