Page MenuHomePhabricator

CirrusSearch: access to WikiPage that not represents a page
Closed, ResolvedPublic

Description

Error:
Accessing WikiPage that cannot exist as a page: Special:Badtitle/NS90:Help talk:SSH/What to do with private key?. [Called from WikiPage::exists]

Stack:

#4 /srv/mediawiki/php-1.36.0-wmf.29/includes/page/WikiPage.php(451): wfDeprecatedMsg(string, string)
#5 /srv/mediawiki/php-1.36.0-wmf.29/includes/page/WikiPage.php(579): WikiPage->loadPageData()
#6 /srv/mediawiki/php-1.36.0-wmf.29/extensions/CirrusSearch/includes/Updater.php(126): WikiPage->exists()
#7 /srv/mediawiki/php-1.36.0-wmf.29/extensions/CirrusSearch/includes/Updater.php(74): CirrusSearch\Updater->traceRedirects(Title)
#8 /srv/mediawiki/php-1.36.0-wmf.29/extensions/CirrusSearch/includes/Job/LinksUpdate.php(51): CirrusSearch\Updater->updateFromTitle(Title)
#9 /srv/mediawiki/php-1.36.0-wmf.29/extensions/CirrusSearch/includes/Job/JobTraits.php(136): CirrusSearch\Job\LinksUpdate->doJob()
#10 /srv/mediawiki/php-1.36.0-wmf.29/includes/jobqueue/JobRunner.php(375): CirrusSearch\Job\CirrusTitleJob->run()
#11 /srv/mediawiki/php-1.36.0-wmf.29/includes/jobqueue/JobRunner.php(336): JobRunner->doExecuteJob(CirrusSearch\Job\LinksUpdate)
#12 /srv/mediawiki/php-1.36.0-wmf.29/includes/jobqueue/JobRunner.php(247): JobRunner->executeJob(CirrusSearch\Job\LinksUpdate)
#13 /srv/mediawiki/php-1.36.0-wmf.29/maintenance/runJobs.php(93): JobRunner->run(array)
#14 /srv/mediawiki/php-1.36.0-wmf.29/maintenance/doMaintenance.php(106): RunJobs->execute()
#15 /srv/mediawiki/php-1.36.0-wmf.29/maintenance/runJobs.php(130): require_once(string)
#16 /srv/mediawiki/multiversion/MWScript.php(101): require_once(string)

https://logstash.wikimedia.org/app/discover#/doc/logstash-*/logstash-deploy-2021.02.09?id=gj1wiHcB3WpTGKOO20wf

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
StalledNone
DuplicateNone
OpenNone
ResolvedNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
ResolvedNone
ResolvedNone
StalledNone
OpenNone
OpenNone
Opendaniel
OpenNone
OpenNone
OpenNone
OpenNone
Resolveddaniel
Opendaniel
Resolveddaniel
Resolveddaniel

Event Timeline

Pchelolo renamed this task from CirrusSearch builds invalid WikiPage to CirrusSearch: access to WikiPage that not represents a page.Feb 9 2021, 11:29 PM
Pchelolo created this task.

Ah, this is a nasty edge case. The code has this check:

// Never. Ever. Index. Negative. Namespaces.
if ( $title->getNamespace() < 0 ) {
	return [ null, $redirects ];
}

Which should prevent the issue at hand. But the title actually has a positive namespace (with index 90). This namespace however is invalid (undefined), so the namespace prefix is turned into "Special:Badtitle/NS90". When this is parsed again, we get back a special page.

Perhaps we could simply check $title->exists()? That would fix it, I think.

Change 663228 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/extensions/CirrusSearch@master] Don't try to index pages that can't exist.

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

Change 663227 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] Test for handling of invalid Titles

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

Change 663228 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Don't try to index pages that can't exist.

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