Page MenuHomePhabricator

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

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.

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

Krinkle created this task.Sep 19 2018, 1:43 AM
Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 19 2018, 1:43 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle updated the task description. (Show Details)Sep 19 2018, 1:46 AM

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?

@Trizek-WMF yes, through Beta features.

Krinkle added a comment.EditedOct 13 2018, 11:44 PM

(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 added a subscriber: JTannerWMF.

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