Page MenuHomePhabricator

No RDF builder defined for data type globe-coordinate nor for value type bad in DispatchingValueSnakRdfBuilder::getValueBuilder
Open, LowestPublic13 Estimated Story PointsPRODUCTION ERROR

Description

When requesting (/wiki/Special:EntityData/Q3629997.ttl?nocache=1536759432200&flavor=dump) the following error is logged.

PHP Warning: Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder: No RDF builder defined for data type globe-coordinate nor for value type bad. [Called from Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder in /srv/mediawiki/php-1.37.0-wmf.4/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php at line 76]

Note: the difference between data type and value type in this log message

This is due to the fact that the entity revision includes invalid data as seen in the json example below. And the code ends evaluating to
https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php#L76.

{
  "value": {
    "latitude": -90,
    "longitude": 0,
    "altitude": null,
    "precision": 146706019195900,
    "globe": "http://www.wikidata.org/entity/Q308"
  },
  "type": "globecoordinate",
  "error": "$precision needs to be between -360 and 360"
}

The invalid value stored in the database might indicate that some globe-coordinate validator is broken along the way.

ACs🏕️🌟:

  • The error is no longer spamming our logs
  • Check whether there is an issue with globe-coordinate validation and proceed accordingly (by creating a ticket or solving the issue)
  • Look in the database for other such malformed precisions
  • Come up with a plan of attack for the malformed values & get them out of the existing revisions set

Related Objects

Event Timeline

The current behavior is well defined and expected:

  • There is an invalid date in the database.
  • The property data type is known to be "time".
  • The serialization of the value failed, that's where the "bad" value type comes from.
  • This is logged.
  • This value is then skipped and does not appear in the RDF export.

@Dereckson, we need to know how often this happens to decide if it's worth to spend time on this. The first thing we would do is to make the log message more expressive (include at least the entity ID and possibly the "bad" snak serialization).

thiemowmde triaged this task as Lowest priority.Aug 31 2016, 7:54 AM

It was a sporadic warning, to get the entity ID would be valuable, indeed

Still seen. About 450 samples in the last 7 days. Recent sample:

[{exception_id}] {exception_url}   ErrorException from line 309 of /srv/mediawiki/php-1.32.0-wmf.20/includes/debug/MWDebug.php: PHP Warning: Wikibase\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder: No RDF builder defined for data type globe-coordinat

reqId: W5kWiApAIDEAAKI5PVAAAACM
wiki: www.wikidata.org
url: /wiki/Special:EntityData/Q3629997.ttl?nocache=1536759432200&flavor=dump
http_method: GET
trace
#3 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php(75): wfLogWarning(string)
#4 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php(50): Wikibase\Rdf\DispatchingValueSnakRdfBuilder->getValueBuilder(string, string)
#5 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/SnakRdfBuilder.php(132): Wikibase\Rdf\DispatchingValueSnakRdfBuilder->addValue(Wikimedia\Purtle\TurtleRdfWriter, string, string, string, Wikibase\DataModel\Snak\PropertyValueSnak)
#6 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/SnakRdfBuilder.php(83): Wikibase\Rdf\SnakRdfBuilder->addSnakValue(Wikimedia\Purtle\TurtleRdfWriter, Wikibase\DataModel\Snak\PropertyValueSnak, string)
#7 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/TruthyStatementRdfBuilder.php(91): Wikibase\Rdf\SnakRdfBuilder->addSnak(Wikimedia\Purtle\TurtleRdfWriter, Wikibase\DataModel\Snak\PropertyValueSnak, string)
#8 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/TruthyStatementRdfBuilder.php(63): Wikibase\Rdf\TruthyStatementRdfBuilder->addMainSnak(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Statement\Statement)
#9 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/TruthyStatementRdfBuilder.php(103): Wikibase\Rdf\TruthyStatementRdfBuilder->addStatements(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Statement\StatementList)
#10 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Rdf/RdfBuilder.php(400): Wikibase\Rdf\TruthyStatementRdfBuilder->addEntity(Wikibase\DataModel\Entity\Item)
#11 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(229): Wikibase\Rdf\RdfBuilder->addEntity(Wikibase\DataModel\Entity\Item)
#12 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(175): Wikibase\Repo\LinkedData\EntityDataSerializationService->rdfSerialize(Wikibase\Lib\Store\EntityRevision, NULL, array, Wikibase\Rdf\RdfBuilder, string)
#13 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(453): Wikibase\Repo\LinkedData\EntityDataSerializationService->getSerializedData(string, Wikibase\Lib\Store\EntityRevision, NULL, array, string)
#14 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(246): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\DataModel\Entity\ItemId, integer)
#15 /srv/mediawiki/php-1.32.0-wmf.20/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(153): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
#16 /srv/mediawiki/php-1.32.0-wmf.20/includes/specialpage/SpecialPage.php(569): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
#17 /srv/mediawiki/php-1.32.0-wmf.20/includes/specialpage/SpecialPageFactory.php(581): SpecialPage->run(string)
#18 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#19 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(868): MediaWiki->performRequest()
#20 /srv/mediawiki/php-1.32.0-wmf.20/includes/MediaWiki.php(525): MediaWiki->main()
#21 /srv/mediawiki/php-1.32.0-wmf.20/index.php(42): MediaWiki->run()

There are indeed coordinate values in the database the current code can not deserialize any more: https://www.wikidata.org/wiki/Special:Diff/135258698

In 2017 two changes to the validation of coordinates have been made via https://github.com/DataValues/Geo/pull/53:

  1. "Precision" must be in the range [-360..+360]. Back then @Lucas_Werkmeister_WMDE helped finding outliers in the wikidata.org database and fix them before the change went live.
  2. "Globe" can not be an empty string any more.

I'm not sure, but I guess we forgot about the later one, and empty globes are what causes these errors now. If this is true, then one possible way to fix this is to make the following change to GlobeCoordinateValue::newFromArray:

( isset( $data['globe'] ) ) ? $data['globe'] : null
( isset( $data['globe'] ) && $data['globe'] !== '' ) ? $data['globe'] : null

This will make the code accept empty strings from old serializations, but not via the constructor, which is relevant for the GlobeCoordinateParser.

At least for the request @Krinkle quoted, the problem does appear to be the precision. Quoting from Special:EntityData/Q3629997.json:

{
  "value": {
    "latitude": -90,
    "longitude": 0,
    "altitude": null,
    "precision": 146706019195900,
    "globe": "http://www.wikidata.org/entity/Q308"
  },
  "type": "globecoordinate",
  "error": "$precision needs to be between -360 and 360"
}

Though it sounds like we might need the globe change as well.

the problem does appear to be the precision

Indeed. I don't have a programmatic suggestion then, other than somehow fixing these Items manually.

Thanks for the hint to use Special:EntityData/….json!

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

From the other ticket I merged in:

Error message
PHP Warning: Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder: No RDF builder defined for data type globe-coordinate nor for value type bad. [Called from Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder::getValueBuilder in /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php at line 76]
Trace
from /srv/mediawiki/php-1.36.0-wmf.30/includes/debug/MWDebug.php(499)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.30/includes/debug/MWDebug.php(499): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.36.0-wmf.30/includes/debug/MWDebug.php(196): MWDebug::sendMessage(string, string, integer)
#3 /srv/mediawiki/php-1.36.0-wmf.30/includes/GlobalFunctions.php(1095): MWDebug::warning(string, integer, integer, string)
#4 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php(76): wfLogWarning(string)
#5 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php(51): Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder->getValueBuilder(string, string)
#6 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/SnakRdfBuilder.php(138): Wikibase\Repo\Rdf\DispatchingValueSnakRdfBuilder->addValue(Wikimedia\Purtle\TurtleRdfWriter, string, string, string, string, Wikibase\DataModel\Snak\PropertyValueSnak)
#7 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/SnakRdfBuilder.php(86): Wikibase\Repo\Rdf\SnakRdfBuilder->addSnakValue(Wikimedia\Purtle\TurtleRdfWriter, string, Wikibase\DataModel\Snak\PropertyValueSnak, string)
#8 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(251): Wikibase\Repo\Rdf\SnakRdfBuilder->addSnak(Wikimedia\Purtle\TurtleRdfWriter, string, Wikibase\DataModel\Snak\PropertyValueSnak, string, string)
#9 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(142): Wikibase\Repo\Rdf\FullStatementRdfBuilder->addMainSnak(Wikibase\DataModel\Entity\ItemId, string, Wikibase\DataModel\Statement\Statement, boolean)
#10 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(126): Wikibase\Repo\Rdf\FullStatementRdfBuilder->addStatement(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Statement\Statement, boolean)
#11 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/FullStatementRdfBuilder.php(266): Wikibase\Repo\Rdf\FullStatementRdfBuilder->addStatements(Wikibase\DataModel\Entity\ItemId, Wikibase\DataModel\Statement\StatementList)
#12 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/RdfBuilder.php(406): Wikibase\Repo\Rdf\FullStatementRdfBuilder->addEntity(Wikibase\DataModel\Entity\Item)
#13 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Rdf/RdfBuilder.php(387): Wikibase\Repo\Rdf\RdfBuilder->addSingleEntity(Wikibase\DataModel\Entity\Item)
#14 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(224): Wikibase\Repo\Rdf\RdfBuilder->addEntity(Wikibase\DataModel\Entity\Item)
#15 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php(170): Wikibase\Repo\LinkedData\EntityDataSerializationService->rdfSerialize(Wikibase\Lib\Store\EntityRevision, NULL, array, Wikibase\Repo\Rdf\RdfBuilder, string)
#16 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(517): Wikibase\Repo\LinkedData\EntityDataSerializationService->getSerializedData(string, Wikibase\Lib\Store\EntityRevision, NULL, array, string)
#17 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/LinkedData/EntityDataRequestHandler.php(266): Wikibase\Repo\LinkedData\EntityDataRequestHandler->showData(WebRequest, OutputPage, string, Wikibase\DataModel\Entity\ItemId, integer)
#18 /srv/mediawiki/php-1.36.0-wmf.30/extensions/Wikibase/repo/includes/Specials/SpecialEntityData.php(118): Wikibase\Repo\LinkedData\EntityDataRequestHandler->handleRequest(string, WebRequest, OutputPage)
#19 /srv/mediawiki/php-1.36.0-wmf.30/includes/specialpage/SpecialPage.php(645): Wikibase\Repo\Specials\SpecialEntityData->execute(string)
#20 /srv/mediawiki/php-1.36.0-wmf.30/includes/specialpage/SpecialPageFactory.php(1405): SpecialPage->run(string)
#21 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#22 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(944): MediaWiki->performRequest()
#23 /srv/mediawiki/php-1.36.0-wmf.30/includes/MediaWiki.php(548): MediaWiki->main()
#24 /srv/mediawiki/php-1.36.0-wmf.30/index.php(53): MediaWiki->run()
#25 /srv/mediawiki/php-1.36.0-wmf.30/index.php(46): wfIndexMain()
#26 /srv/mediawiki/w/index.php(3): require(string)
#27 {main}
Impact

No idea? ;)

Notes

Only two logs, both with the same message and for the same request id: YCTbcyGPoE-IrUEvA19aiAAAARU

Log stash Link: https://logstash.wikimedia.org/goto/c339343d3d538c1b2fb45cc49b7c712c

I think this is the same issue as T144248: No RDF builder defined for data type globe-coordinate nor for value type bad in DispatchingValueSnakRdfBuilder::getValueBuilder – in the JSON representation I see:

$ curl -s https://www.wikidata.org/wiki/Special:EntityData/Q3642430.json | jq .entities.Q3642430.claims.P625[0].mainsnak
{
  "snaktype": "value",
  "property": "P625",
  "datavalue": {
    "value": {
      "latitude": 90,
      "longitude": 0,
      "altitude": null,
      "precision": 146706019195900,
      "globe": "http://www.wikidata.org/entity/Q308"
    },
    "type": "globecoordinate",
    "error": "$precision needs to be between -360 and 360"
  },
  "datatype": "globe-coordinate"
}
Addshore moved this task from Old to May 2021 on the Wikimedia-production-error board.
Addshore moved this task from May 2021 to Old on the Wikimedia-production-error board.
ItamarWMDE renamed this task from No RDF builder defined for data type time nor for value type bad in DispatchingValueSnakRdfBuilder::getValueBuilder to No RDF builder defined for data type glob-coordinate nor for value type bad in DispatchingValueSnakRdfBuilder::getValueBuilder.May 11 2021, 11:49 AM
ItamarWMDE renamed this task from No RDF builder defined for data type glob-coordinate nor for value type bad in DispatchingValueSnakRdfBuilder::getValueBuilder to No RDF builder defined for data type globe-coordinate nor for value type bad in DispatchingValueSnakRdfBuilder::getValueBuilder.
ItamarWMDE updated the task description. (Show Details)
Addshore set the point value for this task to 13.

Come up with a plan of attack for the malformed values & get them out of the existing revisions set

Does this mean we want to edit the content of old revisions on-wiki? As far as I’m aware we practically never do that, and it doesn’t sound like a good idea to me. This needs to be handled by the code, I think.

Come up with a plan of attack for the malformed values & get them out of the existing revisions set

Does this mean we want to edit the content of old revisions on-wiki? As far as I’m aware we practically never do that, and it doesn’t sound like a good idea to me. This needs to be handled by the code, I think.

Right. We do not touch old revisions. But we need to find the occurrences in current revisions so we can get them fixed from now on.