Page MenuHomePhabricator

Flow TopicPageCreationListener causes "InvalidArgumentException: The given Title does not belong" from MutableRevisionRecord.php
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error

Request ID: W5A4mwpAIDEAAIJd2S8AAACM

message
[{exception_id}] {exception_url}   InvalidArgumentException from line 279 of /srv/mediawiki/php-1.32.0-wmf.20/includes/Storage/MutableRevisionRecord.php: The given Title does not belong to page ID 813794
stacktrace
#0 /srv/mediawiki/php-1.32.0-wmf.20/includes/Storage/PageUpdater.php(865): MediaWiki\Storage\MutableRevisionRecord->setPageId(integer)
#1 /srv/mediawiki/php-1.32.0-wmf.20/includes/Storage/PageUpdater.php(926): MediaWiki\Storage\PageUpdater->makeNewRevision(CommentStoreComment, User, string, integer, Status)
#2 /srv/mediawiki/php-1.32.0-wmf.20/includes/Storage/PageUpdater.php(733): MediaWiki\Storage\PageUpdater->doModify(CommentStoreComment, User, integer)
#3 /srv/mediawiki/php-1.32.0-wmf.20/includes/page/WikiPage.php(1865): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#4 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Flow/includes/TalkpageManager.php(136): WikiPage->doEditContent(Flow\Content\BoardContent, CommentStoreComment, integer, boolean, User)
#5 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Flow/includes/Data/Listener/TopicPageCreationListener.php(44): Flow\TalkpageManager->ensureFlowRevision(Article, Flow\Model\Workflow)
#6 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/MWCallableUpdate.php(34): Closure$Flow\Data\Listener\TopicPageCreationListener::onAfterInsert()
#7 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/DeferredUpdates.php(268): MWCallableUpdate->doUpdate()
#8 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/DeferredUpdates.php(214): DeferredUpdates::runUpdate(MWCallableUpdate, Wikimedia\Rdbms\LBFactoryMulti, string, integer)
#9 /srv/mediawiki/php-1.32.0-wmf.20/includes/deferred/DeferredUpdates.php(130): DeferredUpdates::execute(array, string, integer)
#10 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(607): DeferredUpdates::doUpdates(string, integer)
#11 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(576): MediaWiki::preOutputCommit(RequestContext, Closure$MediaWiki::main;2427)
#12 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(884): MediaWiki->doPreOutputCommit(Closure$MediaWiki::main;2427)
#13 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(525): MediaWiki->main()
#14 /srv/mediawiki/php-1.32.0-wmf.20/index.php(42): MediaWiki->run()

Notes

It seems to mostly happen on Special:Preferences from a deferred update.

Screen Shot 2018-09-19 at 02.38.29.png (760×2 px, 147 KB)

This fatal exception was recorded 127 times by Logstash in the last 7 days. It is a new regression introduced in 1.32.0-wmf.20. It was not seen prior to that.

Possibly related:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This exception occurs when you enable Flow on your talk page via Special:Preferences. Despite this exception, the Flow-enabled talk page is successfully created.

This exception occurs when you enable Flow on your talk page via Special:Preferences. Despite this exception, the Flow-enabled talk page is successfully created.

You mean that's through the Beta feature system?

(Still seen on 1.32-wmf.24, and 1.33-wmf.16, and 1.33-wmf.21)

I can reproduce this:

  • Create a new user
  • Create your talk page (i.e. should not be a red link)
  • Enable the BetaFeature

In includes/Data/Listener/TopicPageCreationListener.php, moving the ensureFlowRevision() code out of the deferred update resolves the issue. I'll see if I can find a better solution than that, though.

Also noting that in includes/Storage/PageUpdater.php#makeNewRevision, changing $rev->setPageId( $title->getArticleID() ); to query master with $rev->setPageId( $title->getArticleID( Title::GAID_FOR_UPDATE ) ); fixes this issue as well.

JTannerWMF subscribed.

Since this isn't blocking end users we will revisit this when we have more time.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM

Change 587722 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] RevisionStore and PageUpdater: handle stale page ID

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

Change 587722 merged by jenkins-bot:
[mediawiki/core@master] RevisionStore and PageUpdater: handle stale page ID

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

@daniel i this still an issue following your patch in April?