Page MenuHomePhabricator

Wikimedia\Assert\PreconditionException: Precondition failed: This Title instance does not represent a proper page, but merely a link target (from SearchResultSetWidget)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Wikimedia\Assert\PreconditionException: Precondition failed: This Title instance does not represent a proper page, but merely a link target.
exception.trace
from /srv/mediawiki/php-1.40.0-wmf.4/vendor/wikimedia/assert/src/Assert.php(49)
#0 /srv/mediawiki/php-1.40.0-wmf.4/includes/Title.php(4190): Wikimedia\Assert\Assert::precondition(boolean, string)
#1 /srv/mediawiki/php-1.40.0-wmf.4/includes/Title.php(4171): Title->assertProperPage()
#2 /srv/mediawiki/php-1.40.0-wmf.4/includes/search/searchwidgets/FullSearchResultWidget.php(324): Title->getId()
#3 /srv/mediawiki/php-1.40.0-wmf.4/includes/search/searchwidgets/FullSearchResultWidget.php(295): MediaWiki\Search\SearchWidgets\FullSearchResultWidget->getThumbnail(CirrusSearch\Search\ArrayCirrusSearchResult, integer)
#4 /srv/mediawiki/php-1.40.0-wmf.4/includes/search/searchwidgets/FullSearchResultWidget.php(89): MediaWiki\Search\SearchWidgets\FullSearchResultWidget->generateFileHtml(CirrusSearch\Search\ArrayCirrusSearchResult)
#5 /srv/mediawiki/php-1.40.0-wmf.4/includes/search/searchwidgets/BasicSearchResultSetWidget.php(133): MediaWiki\Search\SearchWidgets\FullSearchResultWidget->render(CirrusSearch\Search\ArrayCirrusSearchResult, integer)
#6 /srv/mediawiki/php-1.40.0-wmf.4/includes/search/searchwidgets/BasicSearchResultSetWidget.php(89): MediaWiki\Search\SearchWidgets\BasicSearchResultSetWidget->renderResultSet(class@anonymous
Impact
Notes

Had been thinking this was the same as T302812: Wikimedia\Assert\PreconditionException: This Title instance does not represent a proper page, but merely a link target., but this is a different call stack and got a spike of these immediately after rolling 1.40.0-wmf.4 (T314193) to all wikis.

Details

Request URL
https://en.wikipedia.org/w/index.php?go=*&ns0=*&search=*&title=*

Event Timeline

brennen triaged this task as Unbreak Now! priority.Oct 6 2022, 7:28 PM
brennen created this task.
Umherirrender renamed this task from Wikimedia\Assert\PreconditionException: Precondition failed: This Title instance does not represent a proper page, but merely a link target. to Wikimedia\Assert\PreconditionException: Precondition failed: This Title instance does not represent a proper page, but merely a link target (from SearchResultSetWidget).Oct 6 2022, 8:12 PM

Change 839699 had a related patch set uploaded (by Matthias Mullie; author: Matthias Mullie):

[mediawiki/core@master] Check whether title actually exists

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

I can't fully reproduce the issue ATM, but I'm fairly certain it's caused by interwiki results - those titles aren't understood to exist on the wiki being searched.
I believe above patch should fix this.

Change 839699 merged by jenkins-bot:

[mediawiki/core@master] Check whether title actually exists

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

While I can't reproduce the exact scenario on my machine; I stubbed out some data to trigger the same issue & can confirm that the merged patch fixed at least that.
Shall I cherry-pick to 1.40.0-wmf.4?

Change 840180 had a related patch set uploaded (by Brennen Bearnes; author: Matthias Mullie):

[mediawiki/core@wmf/1.40.0-wmf.4] Check whether title actually exists

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

Shall I cherry-pick to 1.40.0-wmf.4?

I'll go ahead with a backport - thanks!

Change 840180 merged by jenkins-bot:

[mediawiki/core@wmf/1.40.0-wmf.4] Check whether title actually exists

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

Mentioned in SAL (#wikimedia-operations) [2022-10-07T16:36:14Z] <brennen@deploy1002> Started scap: Backport for [[gerrit:840180|Check whether title actually exists (T319798)]]

Mentioned in SAL (#wikimedia-operations) [2022-10-07T16:36:41Z] <brennen@deploy1002> brennen and brennen: Backport for [[gerrit:840180|Check whether title actually exists (T319798)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2022-10-07T16:42:01Z] <brennen@deploy1002> Finished scap: Backport for [[gerrit:840180|Check whether title actually exists (T319798)]] (duration: 05m 47s)

brennen assigned this task to matthiasmullie.