Page MenuHomePhabricator

Fatal error: null EntityId argument passed to addEntityRedirect (Special:EntityData broken for some items)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Example: https://commons.wikimedia.org/wiki/Special:EntityData/M52609519.rdf

PHP fatal error:
Argument 1 passed to Wikibase\Rdf\RdfBuilder::addEntityRedirect() must be an instance of Wikibase\DataModel\Entity\EntityId, null given

Asking for JSON or HTML works properly:

Solution
Turn off RDF export for media info and do it properly under T215341

Event Timeline

Addshore subscribed.

I'm going to re open this one.
This special page needs to remain as users need to be able to use it for things like https://commons.wikimedia.org/wiki/Special:EntityData/M174.json
So the cut here isn't as clear as it should not be there, or it should only work for certain entities, instead it must not exception when formats not yet supported by media info are asked for.

PHP Fatal Error: Argument 1 passed to Wikibase\Rdf\RdfBuilder::addEntityRedirect() must be an instance of Wikibase\DataModel\Entity\EntityId, null given

#0 /srv/mediawiki/php-1.33.0-wmf.12/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(261): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.33.0-wmf.12/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(237): Wikibase\Repo\LinkedData\EntityDataSerializationService->addIncomingRedirects(Wikibase\MediaInfo\DataModel\MediaInfoId, NULL, array, Wikibase\Rdf\RdfBuilder)
#2 /srv/mediawiki/php-1.33.0-wmf.12/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(175): Wikibase\Repo\LinkedData\EntityDataSerializationService->rdfSerialize(Wikibase\Lib\Store\EntityRevision, NULL, array, Wikibase\Rdf\RdfBuilder, NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.12/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(504): Wikibase\Repo\LinkedData\EntityDataSerializationService->getSerializedData(string, Wikibase\Lib\Store\EntityRevision, NULL, array, NULL)
#4 /srv/mediawiki/php-1.33.0-wmf.12/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(255): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\MediaInfo\DataModel\MediaInfoId, integer)
#5 /srv/mediawiki/php-1.33.0-wmf.12/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(154): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
#6 /srv/mediawiki/php-1.33.0-wmf.12/includes/specialpage/SpecialPage.php(569): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
#7 /srv/mediawiki/php-1.33.0-wmf.12/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(string)
#8 /srv/mediawiki/php-1.33.0-wmf.12/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#9 /srv/mediawiki/php-1.33.0-wmf.12/includes/MediaWiki.php(862): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.33.0-wmf.12/includes/MediaWiki.php(517): MediaWiki->main()
#11 /srv/mediawiki/php-1.33.0-wmf.12/index.php(42): MediaWiki->run()
#12 /srv/mediawiki/w/index.php(3): include(string)
#13 {main}

Do you want this for the Special:EntityData code in Wikibase to reply with a 303 See Other to the JSON format if RDF isn't supported? Do you want a task for "support export in RDF in WBMI" too?

A 303 answer looks like a good option indeed.

Do you want a task for "support export in RDF in WBMI" too?

I just created one: T215341

thcipriani subscribed.

Just noticed this is still happening in 1.33.0-wmf.17.

More info if helpful (even if not ):

id: XGSZqQpAMFQAACoNLsEAAACC

message: PHP Fatal Error: Argument 1 passed to Wikibase\Rdf\RdfBuilder::addEntityRedirect() must be an instance of Wikibase\DataModel\Entity\EntityId, null given

Trace:

#0 /srv/mediawiki/php-1.33.0-wmf.17/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(261): NO_FUNCTION_GIVEN()
#1 /srv/mediawiki/php-1.33.0-wmf.17/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(237): Wikibase\Repo\LinkedData\EntityDataSerializationService->addIncomingRedirects(Wikibase\MediaInfo\DataModel\MediaInfoId, NULL, array, Wikibase\Rdf\RdfBuilder)
#2 /srv/mediawiki/php-1.33.0-wmf.17/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(175): Wikibase\Repo\LinkedData\EntityDataSerializationService->rdfSerialize(Wikibase\Lib\Store\EntityRevision, NULL, array, Wikibase\Rdf\RdfBuilder, NULL)
#3 /srv/mediawiki/php-1.33.0-wmf.17/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(503): Wikibase\Repo\LinkedData\EntityDataSerializationService->getSerializedData(string, Wikibase\Lib\Store\EntityRevision, NULL, array, NULL)
#4 /srv/mediawiki/php-1.33.0-wmf.17/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(254): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\MediaInfo\DataModel\MediaInfoId, integer)
#5 /srv/mediawiki/php-1.33.0-wmf.17/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(154): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
#6 /srv/mediawiki/php-1.33.0-wmf.17/includes/specialpage/SpecialPage.php(569): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
#7 /srv/mediawiki/php-1.33.0-wmf.17/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(string)
#8 /srv/mediawiki/php-1.33.0-wmf.17/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#9 /srv/mediawiki/php-1.33.0-wmf.17/includes/MediaWiki.php(867): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.33.0-wmf.17/includes/MediaWiki.php(517): MediaWiki->main()
#11 /srv/mediawiki/php-1.33.0-wmf.17/index.php(42): MediaWiki->run()
#12 /srv/mediawiki/w/index.php(3): include(string)
#13 {main}
WMDE-leszek added a subscriber: Lydia_Pintscher.

I take this one on. Per the internal discussion with @Addshore and @Lydia_Pintscher the other day, it seems reasonable to actually turn off RDF output for MediaInfo entities for now, as it is not really defined. Doing it from the start has apparently slipped our attention, so I am going to do it now.

Change 490581 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[mediawiki/extensions/Wikibase@master] Added a setting to specify entity types for which RDF output is not available.

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

Change 490587 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[operations/mediawiki-config@master] Disable RDF output of mediainfo Wikibase entities

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

Change 490586 had a related patch set uploaded (by WMDE-leszek; owner: WMDE-leszek):
[operations/mediawiki-config@master] Added a setting to define Wikibase entity types that have no RDF output

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

M22857511 is File:Glühwendel brennt durch.jpg, which has a redirect from File:Glühwedel brennt durch.jpg (missing ‘n’ in “-wendel”). Does this only affect files with incoming redirects?

No, RDF is not working for MediaInfo in general, and hence we (WMDE) suggested to disable it until the RDF mapping is done, and Structured Data on Commons team decides to enable RDF output back.

Krinkle renamed this task from Trying to get an RDF representation of media info entities with Special:EntityData fails with fatal error to Fatal error: null EntityId argument passed to addEntityRedirect (Special:EntityData broken for some items).Mar 12 2019, 5:18 AM

Change 490581 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Added a setting to specify entity types for which RDF output is not available.

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

So, next step is to configure entityTypesWithoutRdfOutput to [ 'mediainfo' ]?

@Jdforrester-WMF yup.
Those config changes would be rather straightforward, and I am sure you'd be able to cook them yourselves. I've drafted https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/ /490586 and https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/ /490587 a while back. I wouldn't object if those were SWAT'ed. If helpful WMDE would try to help with deployment these (verification etc), although as you already know, we're generally only available in those crazy European times

Change 490586 merged by jenkins-bot:
[operations/mediawiki-config@master] Added a setting to define Wikibase entity types that have no RDF output

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

Mentioned in SAL (#wikimedia-operations) [2019-03-21T19:39:22Z] <jforrester@deploy1001> Synchronized wmf-config/InitialiseSettings.php: T213483 Set default wmgWikibaseEntityTypesWithoutRdfOutput value (duration: 00m 51s)

Mentioned in SAL (#wikimedia-operations) [2019-03-21T19:40:45Z] <jforrester@deploy1001> Synchronized wmf-config/Wikibase.php: T213483 Read wmgWikibaseEntityTypesWithoutRdfOutput value (duration: 00m 50s)

Change 490587 merged by jenkins-bot:
[operations/mediawiki-config@master] Disable RDF output of mediainfo Wikibase entities

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

Mentioned in SAL (#wikimedia-operations) [2019-03-21T19:45:55Z] <jforrester@deploy1001> Synchronized wmf-config/Wikibase.php: T213483 Disable RDF output of mediainfo Wikibase entities (duration: 00m 49s)

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