Page MenuHomePhabricator

Wikimedia\Assert\ParameterAssertionException: Bad value for parameter $page: must represent an existing page
Open, HighPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   Wikimedia\Assert\ParameterAssertionException: Bad value for parameter $page: must represent an existing page
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.4/vendor/wikimedia/assert/src/Assert.php(72)
#0/srv/mediawiki/php-1.44.0-wmf.4/includes/recentchanges/RecentChange.php(771)Wikimedia\Assert\Assert::parameter(bool, string, string)
#1/srv/mediawiki/php-1.44.0-wmf.4/includes/recentchanges/ChangeTrackingEventIngress.php(108)RecentChange::notifyEdit(string, MediaWiki\Title\Title, bool, MediaWiki\User\User, string, int, string, bool, string, int, int, int, int, array, MediaWiki\Storage\EditResult)
#2/srv/mediawiki/php-1.44.0-wmf.4/includes/recentchanges/ChangeTrackingEventIngress.php(50)MediaWiki\RecentChanges\ChangeTrackingEventIngress->updateRecentChangesAfterPageUpdated(MediaWiki\Revision\RevisionStoreRecord, MediaWiki\Revision\RevisionStoreRecord, bool, int, array, MediaWiki\Storage\EditResult)
#3/srv/mediawiki/php-1.44.0-wmf.4/includes/DomainEvent/DomainEventDispatcher.php(139)MediaWiki\RecentChanges\ChangeTrackingEventIngress->afterPageUpdated(MediaWiki\Storage\PageUpdatedEvent, Wikimedia\Rdbms\LBFactoryMulti)
#4/srv/mediawiki/php-1.44.0-wmf.4/includes/DomainEvent/DomainEventDispatcher.php(123)MediaWiki\DomainEvent\DomainEventDispatcher->invoke(array, MediaWiki\Storage\PageUpdatedEvent, Wikimedia\Rdbms\LBFactoryMulti)
#5/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/MWCallableUpdate.php(52)MediaWiki\DomainEvent\DomainEventDispatcher->MediaWiki\DomainEvent\{closure}(string)
#6/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/DeferredUpdates.php(460)MediaWiki\Deferred\MWCallableUpdate->doUpdate()
#7/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/DeferredUpdates.php(204)MediaWiki\Deferred\DeferredUpdates::attemptUpdate(MediaWiki\Deferred\MWCallableUpdate)
#8/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/DeferredUpdates.php(291)MediaWiki\Deferred\DeferredUpdates::run(MediaWiki\Deferred\MWCallableUpdate)
#9/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/DeferredUpdatesScope.php(243)MediaWiki\Deferred\DeferredUpdates::MediaWiki\Deferred\{closure}(MediaWiki\Deferred\MWCallableUpdate, int)
#10/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/DeferredUpdatesScope.php(172)MediaWiki\Deferred\DeferredUpdatesScope->processStageQueue(int, int, Closure)
#11/srv/mediawiki/php-1.44.0-wmf.4/includes/deferred/DeferredUpdates.php(310)MediaWiki\Deferred\DeferredUpdatesScope->processUpdates(int, Closure)
#12/srv/mediawiki/php-1.44.0-wmf.4/includes/MediaWikiEntryPoint.php(674)MediaWiki\Deferred\DeferredUpdates::doUpdates()
#13/srv/mediawiki/php-1.44.0-wmf.4/includes/MediaWikiEntryPoint.php(496)MediaWiki\MediaWikiEntryPoint->restInPeace()
#14/srv/mediawiki/php-1.44.0-wmf.4/includes/MediaWikiEntryPoint.php(454)MediaWiki\MediaWikiEntryPoint->doPostOutputShutdown()
#15/srv/mediawiki/php-1.44.0-wmf.4/includes/MediaWikiEntryPoint.php(209)MediaWiki\MediaWikiEntryPoint->postOutputShutdown()
#16/srv/mediawiki/php-1.44.0-wmf.4/api.php(44)MediaWiki\MediaWikiEntryPoint->run()
#17/srv/mediawiki/w/api.php(3)require(string)
#18{main}
Impact
Notes

This has been happening for days at varying rates after T377229. It always involves DeferredUpdates, so probably the page gets deleted before the change notification code runs but that needs to be investigated.

Details

Request URL
https://en.wiktionary.org/w/api.php

Event Timeline

Samwalton9-WMF added subscribers: daniel, Samwalton9-WMF.

This has been happening for days at varying rates after T377229.

FYI @daniel

This isn't good, but the error rate is relatively low. Tagging MW-Interfaces-Team for tracking, since this is fallout from T376063: Hypothesis WE5.2.3 (Q2 FY24/25): Introduce a system of events and listeners into MediaWiki core.

I suspect that the issue is caused by replication lag or a race condition when a page is deleted immediately after an edit. If that is indeed that case, it should be fixed soon by T380536: RevisionRecord::getPage() should return an immutable ProperPageIdentity (though that patch is a bit risky itself).

daniel triaged this task as High priority.Nov 25 2024, 4:48 PM

Tagging as high, since it definitly needs fixing, though the impact isn't huge.

The patch that I hoped would fix this rode the train on the week of December 9th (1.44.0-wmf.6), but apparently didn't fix the issue. I'm confused about the fact that it did nothing. I would have expected the error to at least be triggered earlier, in the constructor of RevisionRecord. If the RevisionRecord was constructed on an existing page, and it's immutable, how can the page later not exist?...

Needs further investigation.

Note that the patch in question was reverted because it caused T381982: Fatal exception of type "Wikimedia\Assert\PreconditionException" when marking a page for translation

Looking at other errors in the requests that trigger this error indicate that this may be the consequence of something else failing... In all requests that I looked at, ParserCache is triggering a warning for "inconsistent revision ID", e.g. https://logstash.wikimedia.org/goto/386604c4622a5a49eea2b4823fe3e364 and https://logstash.wikimedia.org/goto/9f64b0643577d3708f452b3027e9ebf9. Many of the affected requests seem to be using pygmentize, but not all do: https://logstash.wikimedia.org/goto/31b977e276d74ba77b2f131b9a4e59b1.

The patch that I hoped would fix this rode the train on the week of December 9th (1.44.0-wmf.6), but apparently didn't fix the issue.

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1094003 isn't listed in the wmf.6 pick-list, which makes sense because it was merged on 11th December and wmf.6 was cut on 3rd December; this patch hasn't been deployed to production yet.

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1094003 isn't listed in the wmf.6 pick-list, which makes sense because it was merged on 11th December and wmf.6 was cut on 3rd December; this patch hasn't been deployed to production yet.

I see it merged on December 5th, I would have expected it to go on the train on December 10th - but I guess we just didn't do wmf.7.

Thanks for checking!