When cached version of the MediaInfo entity using foreign properties and items in its statements is fetched from cache, Wikibase crashes while trying to deserialize the cached version:
> [a3ca54a981124c4be1b6e4b8] /wiki/Special:EntityData/M5.rdf DataValues\IllegalValueException from line 66 of /vagrant/mediawiki/extensions/WikibaseMediaInfo/vendor/wikibase/data-model/src/Entity/EntityIdValue.php: Invalid EntityIdValue serialization.
>
> Backtrace:
>
>
>
> #0 [internal function]: Wikibase\DataModel\Entity\EntityIdValue->unserialize(string)
> #1 /vagrant/mediawiki/extensions/WikibaseMediaInfo/vendor/wikibase/data-model/src/Snak/PropertyValueSnak.php(67): unserialize(string)
> #2 /vagrant/mediawiki/includes/libs/objectcache/RedisBagOStuff.php(334): Wikibase\DataModel\Snak\PropertyValueSnak->unserialize(string)
> #3 /vagrant/mediawiki/includes/libs/objectcache/RedisBagOStuff.php(97): RedisBagOStuff->unserialize(string)
> #4 /vagrant/mediawiki/includes/libs/objectcache/BagOStuff.php(185): RedisBagOStuff->doGet(string, integer)
> #5 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(116): BagOStuff->get(string)
> #6 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(154): Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision(Wikibase\MediaInfo\DataModel\MediaInfoId, integer, string)
> #7 /vagrant/mediawiki/extensions/Wikibase/lib/includes/Store/CachingEntityRevisionLookup.php(136): Wikibase\Lib\Store\CachingEntityRevisionLookup->fetchEntityRevision(Wikibase\MediaInfo\DataModel\MediaInfoId, integer, string)
> #8 /vagrant/mediawiki/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(345): Wikibase\Lib\Store\CachingEntityRevisionLookup->getEntityRevision(Wikibase\MediaInfo\DataModel\MediaInfoId, integer)
> #9 /vagrant/mediawiki/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(415): Wikibase\Repo\LinkedData\EntityDataRequestHandler->getEntityRevision(Wikibase\MediaInfo\DataModel\MediaInfoId, integer)
> #10 /vagrant/mediawiki/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(236): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\MediaInfo\DataModel\MediaInfoId, integer)
> #11 /vagrant/mediawiki/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(156): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
> #12 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(522): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
> #13 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(576): SpecialPage->run(string)
> #14 /vagrant/mediawiki/includes/MediaWiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
> #15 /vagrant/mediawiki/includes/MediaWiki.php(860): MediaWiki->performRequest()
> #16 /vagrant/mediawiki/includes/MediaWiki.php(521): MediaWiki->main()
> #17 /vagrant/mediawiki/index.php(43): MediaWiki->run()
> #18 /var/www/w/index.php(5): include(string)
> #19 {main}
Looking at the cached EntityIdValue in the cache the problem appears to be foreign IDs being serialized incorrectly (as below)
> {i:0;i:2;i:1;C:39:\"Wikibase\\DataModel\\Entity\\EntityIdValue\":10:{[\"item\",0]}}
This should be fixed in Wikibase Data Model 7.0.0 (in particular [[https://github.com/wmde/WikibaseDataModel/pull/718/commits/614ebfb3a1f14a6b57d6edb7a007e9ef2ab1aec5|614ebfb3a1f14a6b57d6edb7a007e9ef2ab1aec5]] changing above serialization of EntityIdValue to use full serialized ID ) .
If the issue is not solved after Wikibase starts using the new Data Model version (T157965), this ticket's priority should be bumped high, and the issue should be investigated further.
This issue has been also previously noticed by @daniel (see T157442#3010292)