Page MenuHomePhabricator

InvalidArgumentException: $entityId and $targetId must refer to the same kind of entity.
Closed, ResolvedPublic5 Estimated Story PointsPRODUCTION ERROR

Description

Error

MediaWiki version: 1.35.0-wmf.39

message
$entityId and $targetId must refer to the same kind of entity.

Impact

Quite a bit of logspam from this one in production logstash for wmf.39

Note

This happens for both Forms and Senses.

Acceptance criteria:🏕️🌟

  • Exception doesn't surface to user & is not logged
  • User gets a useful response (see comments, either a message or 303 or something similar)

Details

Request ID
40702841-0b72-4588-8920-816cfac00737
Request URL
https://www.wikidata.org/wiki/Special:EntityData/L34757-S1.json
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.35.0-wmf.39/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(402): Wikibase\DataModel\Entity\EntityRedirect->__construct(Wikibase\Lexeme\Domain\Model\SenseId, Wikibase\Lexeme\Domain\Model\LexemeId)
#1 /srv/mediawiki/php-1.35.0-wmf.39/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(499): Wikibase\Repo\LinkedData\EntityDataRequestHandler->getEntityRevision(Wikibase\Lexeme\Domain\Model\SenseId, integer, boolean)
#2 /srv/mediawiki/php-1.35.0-wmf.39/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(276): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\Lexeme\Domain\Model\SenseId, integer)
#3 /srv/mediawiki/php-1.35.0-wmf.39/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(157): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
#4 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/SpecialPage.php(580): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
#5 /srv/mediawiki/php-1.35.0-wmf.39/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(string)
#6 /srv/mediawiki/php-1.35.0-wmf.39/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#7 /srv/mediawiki/php-1.35.0-wmf.39/includes/MediaWiki.php(986): MediaWiki->performRequest()
#8 /srv/mediawiki/php-1.35.0-wmf.39/includes/MediaWiki.php(543): MediaWiki->main()
#9 /srv/mediawiki/php-1.35.0-wmf.39/index.php(53): MediaWiki->run()
#10 /srv/mediawiki/php-1.35.0-wmf.39/index.php(46): wfIndexMain()
#11 /srv/mediawiki/w/index.php(3): require(string)
#12 {main}

Event Timeline

Krinkle subscribed.

Still seen, and reproducible from the given URL.

We suspect that the right thing to do is to let the user know that you can't refer to a subentity of a redirected entity since it might not even exist anymore. i.e. this shouldn't stack trace but should fail nicely.

Instead of failing, HTTP 303 See Other pointing to the lexeme .json might also make sense (we’re not saying it’s equivalent, but it’s related).

Addshore updated the task description. (Show Details)

Change 683380 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] Special:EntityData: handle sub entity redirects

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

Change 683380 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Special:EntityData: handle sub entity redirects

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