Page MenuHomePhabricator

Precondition failed: Must have a latest revision (from CirrusSearch IncomingLinkCount job)
Closed, ResolvedPublic5 Estimated Story PointsPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Wikimedia\Assert\PreconditionException: Precondition failed: Must have a latest revision
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.3/vendor/wikimedia/assert/src/Assert.php(49)
#0 /srv/mediawiki/php-1.37.0-wmf.3/extensions/CirrusSearch/includes/BuildDocument/BuildDocument.php(234): Wikimedia\Assert\Assert::precondition(boolean, string)
#1 /srv/mediawiki/php-1.37.0-wmf.3/extensions/CirrusSearch/includes/BuildDocument/BuildDocument.php(117): CirrusSearch\BuildDocument\BuildDocument->initializeDoc(WikiPage, array, integer)
#2 /srv/mediawiki/php-1.37.0-wmf.3/extensions/CirrusSearch/includes/Updater.php(204): CirrusSearch\BuildDocument\BuildDocument->initialize(array, integer)
#3 /srv/mediawiki/php-1.37.0-wmf.3/extensions/CirrusSearch/includes/Updater.php(392): CirrusSearch\Updater->updatePages(array, integer)
#4 /srv/mediawiki/php-1.37.0-wmf.3/extensions/CirrusSearch/includes/Job/IncomingLinkCount.php(39): CirrusSearch\Updater->updateLinkedArticles(array)
#5 /srv/mediawiki/php-1.37.0-wmf.3/extensions/CirrusSearch/includes/Job/JobTraits.php(136): CirrusSearch\Job\IncomingLinkCount->doJob()
#6 /srv/mediawiki/php-1.37.0-wmf.3/extensions/EventBus/includes/JobExecutor.php(79): CirrusSearch\Job\CirrusTitleJob->run()
#7 /srv/mediawiki/rpc/RunSingleJob.php(76): MediaWiki\Extension\EventBus\JobExecutor->execute(array)
#8 {main}
Impact
Notes

Error happened several times earlier today on bnwiki – seems to be Cirrus-related. Assert is failing because the code is maybe trying to index a page that it can't get a revision ID for? This is the code that contains the assert:

https://github.com/wikimedia/mediawiki-extensions-CirrusSearch/blob/master/includes/BuildDocument/BuildDocument.php#L226-L243

Details

Request URL
https://jobrunner.discovery.wmnet/rpc/RunSingleJob.php

Event Timeline

Krinkle renamed this task from Wikimedia\Assert\PreconditionException: Precondition failed: Must have a latest revision to Precondition failed: Must have a latest revision (from CirrusSearch IncomingLinkCount job).May 12 2021, 6:24 PM
Krinkle moved this task from Untriaged to May 2021 on the Wikimedia-production-error board.

I'm not sure what the underlying cause would be here, my best guess is pages get deleted between when they were created and when the indexing job ran. But we don't have enough information in these logs to concretely say that. Per logstash these errors haven't reoccured since May 12, and they only came out of bnwiki. Best resolution for now seems to be to adjust the error message to contain enough information for future debugging and close this.

Change 698595 had a related patch set uploaded (by Ebernhardson; author: Ebernhardson):

[mediawiki/extensions/CirrusSearch@master] Include tracing info in failing assert

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

dcausse subscribed.

patch merged, moving to waiting while some logs are collected.

Change 698595 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Include tracing info in failing assert

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

Looking over the past few months of logs we don't have a single instance of this one. Not really resolved, but there is also nothing to really do here.