Page MenuHomePhabricator

Spikes of "The Title object yields no ID. Perhaps the page [[SomePageName]] doesn't exist?"
Open, MediumPublicPRODUCTION ERROR

Description

Some times, constructing a LinksUpdate fails with the error "The Title object yields no ID. Perhaps the page [[SomePageName]] doesn't exist?" This may be due to a race condition: LinksUpdate bay be constructed after transactions have been committed, and is typically executed after the response has been sent . If the page was moved or deleted in the meantime, the title will not be found, triggering this errors.

It is worth noting that the stack trace indicates that the constructor on LinksUpdate fails when called from within another deferred job, namely RefreshSecondaryDataUpdate. So there is plenty of opportunity for a page to go missing before the constructor is called.

While LinksUpdate should probably be changed to log a warning rather than fail hard, it is curious that we see spikes of dozens or even over a hundred of these for the same page, within a second or two.

For example, on Apr 28, 2021 @ 19:04:11, "The Title object yields no ID. Perhaps the page [[Michael_Collins_(astronaut)]] doesn't exist?" was hit 232 times on hiwiki, within the space for six seconds on hiwiki. These are all from the same request to index.php with action=submit: reqId=34d83e10-a81a-44e5-8a29-e9c818835951.

Similarly, on Apr 7, 2021 @ 16:13:16, we hit "The Title object yields no ID. Perhaps the page [[Benutzer:Tobiasi0/List_of_Red_Dead_Redemption_2_characters]] doesn't exist?" on dewiki 114 times in 3 seconds, this time coming in via api.php

It seems like something is re-trying failed updates within the same request at a high rate in some cases. It's not immediately obvious how that happens, though.

Sample stack trace:

from /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/LinksUpdate.php(140)
#0 /srv/mediawiki/php-1.36.0-wmf.37/includes/Storage/DerivedPageDataUpdater.php(1385): LinksUpdate->__construct(Title, ParserOutput, boolean)
#1 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/RefreshSecondaryDataUpdate.php(83): MediaWiki\Storage\DerivedPageDataUpdater->getSecondaryDataUpdates(boolean)
#2 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/DeferredUpdates.php(513): RefreshSecondaryDataUpdate->doUpdate()
#3 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/DeferredUpdates.php(390): DeferredUpdates::attemptUpdate(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#4 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/DeferredUpdates.php(221): DeferredUpdates::run(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti, Monolog\Logger, BufferingStatsdDataFactory, string)
#5 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/DeferredUpdatesScope.php(264): DeferredUpdates::{closure}(RefreshSecondaryDataUpdate, integer)
#6 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/DeferredUpdatesScope.php(196): DeferredUpdatesScope->processStageQueue(integer, integer, Closure)
#7 /srv/mediawiki/php-1.36.0-wmf.37/includes/deferred/DeferredUpdates.php(242): DeferredUpdatesScope->processUpdates(integer, Closure)
#8 /srv/mediawiki/php-1.36.0-wmf.37/includes/MediaWiki.php(1093): DeferredUpdates::doUpdates(string)
#9 /srv/mediawiki/php-1.36.0-wmf.37/includes/MediaWiki.php(821): MediaWiki->restInPeace()
#10 /srv/mediawiki/php-1.36.0-wmf.37/includes/MediaWiki.php(833): MediaWiki->{closure}()
#11 /srv/mediawiki/php-1.36.0-wmf.37/api.php(125): MediaWiki->doPostOutputShutdown()
#12 /srv/mediawiki/php-1.36.0-wmf.37/api.php(45): wfApiMain()
#13 /srv/mediawiki/w/api.php(3): require(string)
#14 {main}

Stack trace of a similar situation, occurring in the job queue, as reported in T279832#7049021:

2021-04-30 14:19:41 [YIwR9I-Al3g08XtZ2MEmsAAAAAY] deployment-jobrunner04 enwiki 1.37.0-alpha exception ERROR: [YIwR9I-Al3g08XtZ2MEmsAAAAAY] /rpc/RunSingleJob.php   InvalidArgumentException: The Title object yields no ID. Perhaps the page [[Asian_black_bear]] doesn't exist? {"exception_url":"/rpc/RunSingleJob.php","reqId":"YIwR9I-Al3g08XtZ2MEmsAAAAAY","caught_by":"other"} 
[Exception InvalidArgumentException] (/srv/mediawiki/php-master/includes/deferred/LinksUpdate.php:140) The Title object yields no ID. Perhaps the page [[Asian_black_bear]] doesn't exist?
  #0 /srv/mediawiki/php-master/includes/Storage/DerivedPageDataUpdater.php(1390): LinksUpdate->__construct(Title, ParserOutput, boolean)
  #1 /srv/mediawiki/php-master/includes/deferred/RefreshSecondaryDataUpdate.php(83): MediaWiki\Storage\DerivedPageDataUpdater->getSecondaryDataUpdates(boolean)
  #2 /srv/mediawiki/php-master/includes/deferred/DeferredUpdates.php(513): RefreshSecondaryDataUpdate->doUpdate()
  #3 /srv/mediawiki/php-master/includes/Storage/DerivedPageDataUpdater.php(1722): DeferredUpdates::attemptUpdate(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti)
  #4 /srv/mediawiki/php-master/includes/page/WikiPage.php(2435): MediaWiki\Storage\DerivedPageDataUpdater->doSecondaryDataUpdates(array)
  #5 /srv/mediawiki/php-master/includes/jobqueue/jobs/RefreshLinksJob.php(190): WikiPage->doSecondaryDataUpdates(array)
  #6 /srv/mediawiki/php-master/includes/jobqueue/jobs/RefreshLinksJob.php(126): RefreshLinksJob->runForTitle(Title)
  #7 /srv/mediawiki/php-master/extensions/EventBus/includes/JobExecutor.php(79): RefreshLinksJob->run()
  #8 /srv/mediawiki/rpc/RunSingleJob.php(76): MediaWiki\Extension\EventBus\JobExecutor->execute(array)
  #9 {main}

Event Timeline

daniel changed the subtype of this task from "Task" to "Production Error".May 4 2021, 9:12 AM

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

[mediawiki/core@master] LinksUpdate: don't throw if page does not exist

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

The patch above should prevent the exception, logging a notice instead. It does not however address the question of why and when deferred jobs get retried at a high rate upon failure.

Change 684816 merged by jenkins-bot:

[mediawiki/core@master] LinksUpdate: don't throw if page does not exist

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