Page MenuHomePhabricator

PHP error "Revision::ensureTitle: Could not determine title for page " in FlaggedRevs
Closed, ResolvedPublicPRODUCTION ERROR


Spotted in production:

Warning: Revision::ensureTitle: Could not determine title for page ID 47342037 and revision ID 673119728 [Called from Revision::ensureTitle in /srv/mediawiki/php-1.31.0-wmf.20/includes/Revision.php at line 564] in /srv/mediawiki/php-1.31.0-wmf.20/includes/debug/MWDebug.php on line 309

On wmf.17 too

Event Timeline

demon triaged this task as Medium priority.Feb 9 2018, 7:57 PM
demon created this task.
Addshore added a subscriber: Addshore.

This warning is new as of the Revision refactoring at the start of this year.

demon raised the priority of this task from Medium to High.EditedMar 21 2018, 7:18 PM

This is still way more common than I'd like.

A stack trace would be helpful. What's the easiest way to get one these days?

Also, does the log tell you what wiki this is coming from, or would I have to log that explicitly? And a timestamp would be good, so I can see whether there was some activity at that time that might have triggered the problem.

It's still not clear to me whether this indicates a new problem, or is just surfacing an old problem.

Possibly related:

MediaWiki\Storage\RevisionStore::getTitle fell back to READ_LATEST and got a Title.

RevisionStore.php line 271 calls wfBacktrace()
Revision.php line 593 calls MediaWiki\Storage\RevisionStore->getTitle()
Revision.php line 553 calls Revision->ensureTitle()
FlaggedRevision.php line 66 calls Revision->__construct()
FlaggedRevision.php line 342 calls FlaggedRevision->__construct()
FlaggedRevs.class.php line 646 calls FlaggedRevision::determineStable()
FlaggedRevs.class.php line 1068 calls FlaggedRevs::stableVersionUpdates()
FlaggedRevs.hooks.php line 525 calls FlaggedRevs::autoReviewEdit()
Hooks.php line 177 calls FlaggedRevsHooks::maybeMakeEditReviewed()
Hooks.php line 205 calls Hooks::callHook()
WikiPage.php line 1928 calls Hooks::run()
WikiPage.php line 1676 calls WikiPage->doCreate()
EditPage.php line 2215 calls WikiPage->doEditContent()
EditPage.php line 1506 calls EditPage->internalAttemptSave()
EditPage.php line 652 calls EditPage->attemptSave()
EditAction.php line 60 calls EditPage->edit()
SubmitAction.php line 38 calls EditAction->show()
MediaWiki.php line 500 calls SubmitAction->show()
MediaWiki.php line 294 calls MediaWiki->performAction()
MediaWiki.php line 861 calls MediaWiki->performRequest()
MediaWiki.php line 524 calls MediaWiki->main()
index.php line 42 calls MediaWiki->run()
index.php line 3 calls include()

Spotted on ruwikinews, dewiki, vecwiki, others.... so doesn't seem localized to an individual wiki/language.

Also ensureTitle related:

Expectation (masterConns <= 0) by MediaWiki::main not met (actual: 1):
[connect to (trwiki)]
#0 /srv/mediawiki/php-1.31.0-wmf.30/includes/libs/rdbms/TransactionProfiler.php(164): Wikimedia\Rdbms\TransactionProfiler->reportExpectationViolated()
#1 /srv/mediawiki/php-1.31.0-wmf.30/includes/libs/rdbms/loadbalancer/LoadBalancer.php(757): Wikimedia\Rdbms\TransactionProfiler->recordConnection()
#2 /srv/mediawiki/php-1.31.0-wmf.30/includes/GlobalFunctions.php(2869): Wikimedia\Rdbms\LoadBalancer->getConnection()
#3 /srv/mediawiki/php-1.31.0-wmf.30/includes/Title.php(417): wfGetDB()
#4 /srv/mediawiki/php-1.31.0-wmf.30/includes/Storage/RevisionStore.php(232): Title::newFromID()
#5 /srv/mediawiki/php-1.31.0-wmf.30/includes/Storage/RevisionStore.php(267): MediaWiki\Storage\RevisionStore->getTitle()
#6 /srv/mediawiki/php-1.31.0-wmf.30/includes/Revision.php(593): MediaWiki\Storage\RevisionStore->getTitle()
#7 /srv/mediawiki/php-1.31.0-wmf.30/includes/Revision.php(553): Revision->ensureTitle()
#8 /srv/mediawiki/php-1.31.0-wmf.30/extensions/MobileFrontend/includes/specials/SpecialMobileContributions.php(99): Revision->__construct()
#9 /srv/mediawiki/php-1.31.0-wmf.30/extensions/MobileFrontend/includes/specials/SpecialMobileContributions.php(80): SpecialMobileContributions->showContributions()
#10 /srv/mediawiki/php-1.31.0-wmf.30/extensions/MobileFrontend/includes/specials/MobileSpecialPage.php(57): SpecialMobileContributions->executeWhenAvailable()
#11 /srv/mediawiki/php-1.31.0-wmf.30/extensions/MobileFrontend/includes/specials/MobileSpecialPageFeed.php(23): MobileSpecialPage->execute()
#12 /srv/mediawiki/php-1.31.0-wmf.30/includes/specialpage/SpecialPage.php(522): MobileSpecialPageFeed->execute()
#13 /srv/mediawiki/php-1.31.0-wmf.30/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run()
#14 /srv/mediawiki/php-1.31.0-wmf.30/includes/MediaWiki.php(288): SpecialPageFactory::executePath()
#15 /srv/mediawiki/php-1.31.0-wmf.30/includes/MediaWiki.php(861): MediaWiki->performRequest()
#16 /srv/mediawiki/php-1.31.0-wmf.30/includes/MediaWiki.php(524): MediaWiki->main()
#17 /srv/mediawiki/php-1.31.0-wmf.30/index.php(42): MediaWiki->run()
#18 /srv/mediawiki/w/index.php(3): include()
#19 {main}

Change 428841 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/FlaggedRevs@master] Avoid constructing a Title if we already have one.

The "fell back to READ_LATEST" warning seems to be triggers as follows:

FlaggedRevsHooks::maybeMakeEditReviewed() gets triggered while a revision is being saved. Some where down the stack, it constructs a Revision. The Revision tried to find the respective row in the page table, but can't find it on the slave because the page is just being created. It falls back to master and finds it. This is working as designed, but can easily be avoided by just passing the Title object already known to FlaggedRevsHooks when constructing the Revision, see the patch above.

Change 428841 merged by jenkins-bot:
[mediawiki/extensions/FlaggedRevs@master] Avoid constructing a Title if we already have one.

Krinkle renamed this task from Revision::ensureTitle: Could not determine title for page ID... to PHP error "Revision::ensureTitle: Could not determine title for page " in FlaggedRevs.Jul 8 2018, 8:34 PM
Krinkle claimed this task.

Could not find any hits for this error from FlaggedRevs in the past 7 days.

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