Page MenuHomePhabricator

Special:EntityPage for form ID or sense ID results in InvalidArgumentException
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Trying to access the entity page for any form or sense ID via Special:EntityPage (form example, sense example) results in an internal error:

InvalidArgumentException from line 429 of /srv/mediawiki/php-master/extensions/Wikibase/repo/includes/Content/EntityHandler.php: The given ID does not refer to an entity of type lexeme

Impact

  • Users who try to use Special:EntityPage with a form or sense ID are presented with a generic system error page, effectively stranded. However, we don’t link to such pages anywhere, so it’s not clear how those users would reach the error page in the first place.
  • The server produces a fatal exception, which results in noise and false alarms for operational monitoring. That said, the noise volume is extremely low, see below.
  • The server response is HTTP 500, which cannot cached.

Notes

Between 2019-01-01 and 2019-05-28, there hasn’t been a single occurrence of this error in Logstash. (There are some occurrences on 2019-05-29, presumably from users seeing the activity on this task and clicking the links above.)

Solution

Special:EntityPage should be disabled for sub entities and display a "nice" error.

Either we can:

  • Add a common interface for sub entity IDs to use in datamodel, use that interface in form and sense ids and then detect and present a nice error.

OR

  • Use the current assumption that full entity IDs are [A-Z]\d+, and throw the error only based on that fact. (less work to do and easy to change in the future)

Details

Stack Trace

#0 /srv/mediawiki/php-1.33.0-wmf.3/extensions/Wikibase/repo/includes/Content/EntityContentFactory.php(120): Wikibase\Repo\Content\EntityHandler-getTitleForId(Wikibase\Lexeme\Domain\Model\FormId)
#1 /srv/mediawiki/php-1.33.0-wmf.3/extensions/Wikibase/repo/includes/Specials/SpecialEntityPage.php(64): Wikibase\Repo\Content\EntityContentFactory-getTitleForId(Wikibase\Lexeme\Domain\Model\FormId)
#2 /srv/mediawiki/php-1.33.0-wmf.3/includes/specialpage/SpecialPage.php(569): Wikibase\Repo\Specials\SpecialEntityPage->execute(string)
#3 /srv/mediawiki/php-1.33.0-wmf.3/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(string)
#4 /srv/mediawiki/php-1.33.0-wmf.3/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#5 /srv/mediawiki/php-1.33.0-wmf.3/includes/MediaWiki.php(862): MediaWiki->performRequest()
#6 /srv/mediawiki/php-1.33.0-wmf.3/includes/MediaWiki.php(517): MediaWiki->main()
#7 /srv/mediawiki/php-1.33.0-wmf.3/index.php(42): MediaWiki->run()
#8 /srv/mediawiki/w/index.php(3): include(string)
#9 {main}

Event Timeline

Lucas_Werkmeister_WMDE renamed this task from Special:EntityPage for form ID results in InvalidArgumentException to Special:EntityPage for form ID or sense ID results in InvalidArgumentException.Nov 8 2018, 9:41 AM
Lucas_Werkmeister_WMDE updated the task description. (Show Details)
Krinkle subscribed.

If the functionality in question is unfinished or not something we can currently support, please consider a short-term fix that disables it gracefully in a way that doesn't produce signals analogous to system instability (which make monitoring hard (and can abort deployments mid-way in confusing ways), and that can be cached (e.g. an error message printed from a catch handler over HTTP 200, or 4xx).

Some permalinks for Wikidata items are consistently unreachable to users. They are presented with a generic system error page, effectively stranded.

@Krinkle I don’t understand this at all. Do you mean items or entities? (Entity is the more general term, covering items, properties, lexicographical entities, and others.) And why permalinks?

Do you mean items or entities?

As a user, I am unable to make a distinction between entities and items. Maybe they are items, I don't know.

And why permalinks?

It appears to me that Special:EntityPage is a standard way to create a link to an entity (or item?) based on its identifier. Perhaps similar to Special:Diff and Special:Redirect. I don't know what it's actual use case is, however. But I assume they are used in urls, and that those urls are used by links that users use in a web browser (eg. not an API-like special page for exporting data). I refer to those as permalinks, but perhaps there's a better term.


Feel free to correct as needed. I'm just triaging the errors en-mass.

This might be fixed along with T223995 which both might have the same root cause.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:08 PM

This might be fixed along with T223995 which both might have the same root cause.

This did not fix the problem.

Addshore updated the task description. (Show Details)
Addshore edited Stack Trace. (Show Details)
Addshore moved this task from Needs Work to Ready to pick up on the Wikidata-Campsite board.
This comment was removed by Ladsgroup.

I was testing against EntityData instead of EntityPage. Sorry.

Change 567494 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Use the correct EntityTitleLookup for SpecialEntityPage

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

Change 567494 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Use the correct EntityTitleLookup for SpecialEntityPage

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