Page MenuHomePhabricator

SearchNearMatcher: The given PageIdentity does not represent a proper page
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.32

message
The given PageIdentity does not represent a proper page
exception.trace
from /srv/mediawiki/php-1.36.0-wmf.32/includes/page/WikiPageFactory.php(59)
#0 /srv/mediawiki/php-1.36.0-wmf.32/includes/search/SearchNearMatcher.php(125): MediaWiki\Page\WikiPageFactory->newFromTitle(Title)
#1 /srv/mediawiki/php-1.36.0-wmf.32/includes/search/SearchNearMatcher.php(64): SearchNearMatcher->getNearMatchInternal(string)
#2 /srv/mediawiki/php-1.36.0-wmf.32/includes/specials/SpecialSearch.php(347): SearchNearMatcher->getNearMatch(string)
#3 /srv/mediawiki/php-1.36.0-wmf.32/includes/specials/SpecialSearch.php(208): SpecialSearch->goResult(string)
#4 /srv/mediawiki/php-1.36.0-wmf.32/includes/specialpage/SpecialPage.php(645): SpecialSearch->execute(NULL)
#5 /srv/mediawiki/php-1.36.0-wmf.32/includes/specialpage/SpecialPageFactory.php(1405): SpecialPage->run(NULL)
#6 /srv/mediawiki/php-1.36.0-wmf.32/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#7 /srv/mediawiki/php-1.36.0-wmf.32/includes/MediaWiki.php(944): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.36.0-wmf.32/includes/MediaWiki.php(548): MediaWiki->main()
#9 /srv/mediawiki/php-1.36.0-wmf.32/index.php(53): MediaWiki->run()
#10 /srv/mediawiki/php-1.36.0-wmf.32/index.php(46): wfIndexMain()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}

Impact

Notes

Details

Request ID
YD-Fx54QzfSIsRPH94tEuQAAAJA
Request URL
https://en.wikipedia.org/w/index.php?search=%26%2335%3B&title=Special%3ASearch&go=Go&ns0=1

Event Timeline

daniel triaged this task as Medium priority.Mar 3 2021, 7:23 PM
daniel created this task.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 668179 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] SearchNearMatcher: don't create WikiPage for bad titles.

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

The search is for %26%2335%3B which is # which is the #

The check is new in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/657134

but the problem is that SearchNearMatcher not checking for an empty anchor on empty title? Not sure if that is a valid title or title value

The search is for %26%2335%3B which is # which is the #

The check is new in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/657134

but the problem is that SearchNearMatcher not checking for an empty anchor on empty title? Not sure if that is a valid title or title value

It's a valid search term, and a valid TitleValue (that is, LinkTarget). The complaint is that it's not a "proper page", so it's not valid for PageIdentity - it refers to a section, not to an editable page.

I made a patch to avoid the failure, and I'll probably relax the requirement for PageIdentity to allow (and ignore) sections, as long as the actual page can be determiend. However, relative links (we.g. "#References') will still be valid as a Title or TitleValue, but will be invalid as a PageIdentity or WikiPage. So we need a check in any case.

I made a patch that should catch this issue.

Change 668179 merged by jenkins-bot:
[mediawiki/core@master] SearchNearMatcher: don't create WikiPage for bad titles.

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