Page MenuHomePhabricator

InvalidArgumentException from LinksUpdate.php: "The Title object yields no ID"
Closed, ResolvedPublicPRODUCTION ERROR

Description

a bit spammy in the beta cluster logs:

/rpc/RunJobs.php?wiki=enwiki&type=refreshLinksPrioritized&maxtime=60&maxmem=300M InvalidArgumentException from line 99 of /srv/mediawiki/php-master/includes/deferred/LinksUpdate.php: The Title object yields no ID. Perhaps the page doesn't exist? {"exception_id":"b87ea157"}
[Exception InvalidArgumentException] (/srv/mediawiki/php-master/includes/deferred/LinksUpdate.php:99) The Title object yields no ID. Perhaps the page doesn't exist?

#0 /srv/mediawiki/php-master/includes/content/AbstractContent.php(234): LinksUpdate->__construct(Title, ParserOutput, boolean)
#1 /srv/mediawiki/php-master/includes/jobqueue/jobs/RefreshLinksJob.php(223): AbstractContent->getSecondaryDataUpdates(Title, NULL, boolean, ParserOutput)
#2 /srv/mediawiki/php-master/includes/jobqueue/jobs/RefreshLinksJob.php(119): RefreshLinksJob->runForTitle(Title)
#3 /srv/mediawiki/php-master/includes/jobqueue/JobRunner.php(262): RefreshLinksJob->run()
#4 /srv/mediawiki/php-master/includes/jobqueue/JobRunner.php(176): JobRunner->executeJob(RefreshLinksJob, BufferingStatsdDataFactory, integer)
#5 /srv/mediawiki/rpc/RunJobs.php(47): JobRunner->run(array)

Event Timeline

aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude subscribed.
Krinkle subscribed.

This particular instance of InvalidArgumentException via LinksUpdate->__construct/AbstractContent was triggered RefreshLinksJob. There are no matches for this in the last 15 days. Closing as such.

However, while not via RefreshLinksJob, the similar error recently started via Flow/LinksTableUpdater. Filed T201654 for that.

Krinkle renamed this task from InvalidArgumentException from line 99 of /srv/mediawiki/php-master/includes/deferred/LinksUpdate.php: The Title object yields no ID. to InvalidArgumentException from LinksUpdate.php: "The Title object yields no ID".Jun 25 2019, 2:32 PM
Krinkle reopened this task as Open.

Low frequency, but still seen throughout the last month at various times. Looks like a race condition that can be caused by one of two issues (not sure which one is the case):

  • Reading from a replica where a master query should be used (or vice versa, for repeatable read snapshot).
  • Or; code is too strict, and not matching the actual contract of the software. For example, if the page is deleted between the last edit to the page and the LinksUpdate job for that last edit running, it should not crash or be considered a failure. Presumably at that point, it can gracefully do nothing and let the (other) DeleteLinksUpdate/LinksDeletionUpdate handle it (or maybe even queue one of those instead, if we're worried about the ordering).

Exception ID: XRIoMwpAMEsAABz0Cy0AAAEF

message
InvalidArgumentException: The Title object yields no ID. Perhaps the page doesn't exist
#0 /srv/mediawiki/php-1.34.0-wmf.10/includes/Storage/DerivedPageDataUpdater.php(1305): LinksUpdate->__construct(Title, ParserOutput, boolean)
#1 /srv/mediawiki/php-1.34.0-wmf.10/includes/Storage/DerivedPageDataUpdater.php(1588): MediaWiki\Storage\DerivedPageDataUpdater->getSecondaryDataUpdates(boolean)
#2 /srv/mediawiki/php-1.34.0-wmf.10/includes/page/WikiPage.php(2128): MediaWiki\Storage\DerivedPageDataUpdater->doSecondaryDataUpdates(array)
#3 /srv/mediawiki/php-1.34.0-wmf.10/includes/jobqueue/jobs/RefreshLinksJob.php(296): WikiPage->doSecondaryDataUpdates(array)
#4 /srv/mediawiki/php-1.34.0-wmf.10/includes/jobqueue/jobs/RefreshLinksJob.php(124): RefreshLinksJob->runForTitle(Title)
#5 /srv/mediawiki/php-1.34.0-wmf.10/extensions/EventBus/includes/JobExecutor.php(64): RefreshLinksJob->run()
#6 /srv/mediawiki/rpc/RunSingleJob.php(76): JobExecutor->execute(array)
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:11 PM

Just saw 907 of these under 1.35.0-wmf.28:

reqId: XquILApAMM4AA1IOspEAAACL

URL: https://en.wikiversity.org/w/index.php?title=Special:Import&action=submit

Message: [XquILApAMM4AA1IOspEAAACL] /w/index.php?title=Special:Import&action=submit InvalidArgumentException from line 137 of /srv/mediawiki/php-1.35.0-wmf.28/includes/deferred/LinksUpdate.php: The Title object yields no ID. Perhaps the page doesn't exist?

Trace:

#0 /srv/mediawiki/php-1.35.0-wmf.28/includes/Storage/DerivedPageDataUpdater.php(1330): LinksUpdate->__construct(Title, ParserOutput, boolean)
#1 /srv/mediawiki/php-1.35.0-wmf.28/includes/deferred/RefreshSecondaryDataUpdate.php(83): MediaWiki\Storage\DerivedPageDataUpdater->getSecondaryDataUpdates(boolean)
#2 /srv/mediawiki/php-1.35.0-wmf.28/includes/deferred/DeferredUpdates.php(417): RefreshSecondaryDataUpdate->doUpdate()
#3 /srv/mediawiki/php-1.35.0-wmf.28/includes/deferred/DeferredUpdates.php(296): DeferredUpdates::attemptUpdate(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti)
#4 /srv/mediawiki/php-1.35.0-wmf.28/includes/deferred/DeferredUpdates.php(233): DeferredUpdates::run(RefreshSecondaryDataUpdate, Wikimedia\Rdbms\LBFactoryMulti, Monolog\Logger, BufferingStatsdDataFactory, string)
#5 /srv/mediawiki/php-1.35.0-wmf.28/includes/deferred/DeferredUpdates.php(150): DeferredUpdates::handleUpdateQueue(array, string, integer)
#6 /srv/mediawiki/php-1.35.0-wmf.28/includes/MediaWiki.php(1059): DeferredUpdates::doUpdates(string)
#7 /srv/mediawiki/php-1.35.0-wmf.28/includes/MediaWiki.php(839): MediaWiki->restInPeace()
#8 /srv/mediawiki/php-1.35.0-wmf.28/includes/MediaWiki.php(848): MediaWiki->{closure}()
#9 /srv/mediawiki/php-1.35.0-wmf.28/includes/MediaWiki.php(574): MediaWiki->doPostOutputShutdown()
#10 /srv/mediawiki/php-1.35.0-wmf.28/index.php(47): MediaWiki->run()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}
eprodromou subscribed.

Well, on initial review it seems like there's some sort of race condition or missed expectation that's not happening. It's never good to have data inconsistencies, but we're not seeing actual problems with this, just the errors. And it seems to have fired a few times over the last few years...?

It also seems like a hard problem to replicate, so we're reluctant to put resources into the problem. I'm marking this for our icebox, but if @Krinkle or @brennen think it needs more attention we can de-ice it and put more time into it.

And it seems to have fired a few times over the last few years...?

Just noticed another few spikes of these:

Screenshot-2020-08-04-10:49:37.png (217×1 px, 15 KB)

I seem to wind up looking at this ticket once a month or so, for whatever that's worth.

The stack trace includes AbstractContent::getSecondaryDataUpdates which was changed in

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/456204, than moved with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/501444 and than moved to the PageUpdater in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/418134

And than the stacktrace looks like the stacktrace from T271356. I would assume it is the same issue.

I am not sure if the "spikes" showing up the previous comment are only for the exception text or also for the same stacktrace