Page MenuHomePhabricator

Argument 1 passed to DataValues\Geo\Values\LatLongValue::__construct() must be of the type float, string given
Closed, ResolvedPublic3 Estimated Story PointsPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.34

message
Argument 1 passed to DataValues\Geo\Values\LatLongValue::__construct() must be of the type float, string given, called in /srv/mediawiki/php-1.36.0-wmf.34/vendor/data-values/geo/src/Values/GlobeCoordinateValue.php on line 223

Impact

Unknown.

Presumably if a value can't be passed the user should receive feedback to that effect.

Notes

6 of these in the last ~4 hours.

Acceptance Criteria

  • Check whether this error got introduced recently with stricter type checking. It may have allowed string values ("1.234" instead of 1.234) before. It may be ok to allow both.
  • If this is caused by completely invalid input, handle the exception and send an error in the response.

Details

Request ID
YFJK0tKPIg2eFM7VqMP14AAAAMI
Request URL
https://www.wikidata.org/w/api.php
Stack Trace
exception.trace
from /srv/mediawiki/php-1.36.0-wmf.34/vendor/data-values/geo/src/Values/LatLongValue.php(33)
#0 /srv/mediawiki/php-1.36.0-wmf.34/vendor/data-values/geo/src/Values/GlobeCoordinateValue.php(223): DataValues\Geo\Values\LatLongValue->__construct(string, string)
#1 /srv/mediawiki/php-1.36.0-wmf.34/vendor/data-values/serialization/src/Deserializers/DataValueDeserializer.php(126): DataValues\Geo\Values\GlobeCoordinateValue::newFromArray(array)
#2 /srv/mediawiki/php-1.36.0-wmf.34/vendor/data-values/serialization/src/Deserializers/DataValueDeserializer.php(91): DataValues\Deserializers\DataValueDeserializer->getDeserialization(array)
#3 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikibase/data-model-serialization/src/Deserializers/SnakDeserializer.php(128): DataValues\Deserializers\DataValueDeserializer->deserialize(array)
#4 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikibase/data-model-serialization/src/Deserializers/SnakDeserializer.php(117): Wikibase\DataModel\Deserializers\SnakDeserializer->deserializeDataValue(array)
#5 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikibase/data-model-serialization/src/Deserializers/SnakDeserializer.php(100): Wikibase\DataModel\Deserializers\SnakDeserializer->newValueSnak(array)
#6 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikibase/data-model-serialization/src/Deserializers/SnakDeserializer.php(82): Wikibase\DataModel\Deserializers\SnakDeserializer->getDeserialized(array)
#7 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikibase/data-model-serialization/src/Deserializers/StatementDeserializer.php(110): Wikibase\DataModel\Deserializers\SnakDeserializer->deserialize(array)
#8 /srv/mediawiki/php-1.36.0-wmf.34/vendor/wikibase/data-model-serialization/src/Deserializers/StatementDeserializer.php(100): Wikibase\DataModel\Deserializers\StatementDeserializer->getDeserialized(array)
#9 /srv/mediawiki/php-1.36.0-wmf.34/extensions/Wikibase/repo/includes/Api/SetClaim.php(266): Wikibase\DataModel\Deserializers\StatementDeserializer->deserialize(array)
#10 /srv/mediawiki/php-1.36.0-wmf.34/extensions/Wikibase/repo/includes/Api/SetClaim.php(162): Wikibase\Repo\Api\SetClaim->getStatementFromParams(array)
#11 /srv/mediawiki/php-1.36.0-wmf.34/extensions/Wikibase/repo/includes/Api/SetClaim.php(151): Wikibase\Repo\Api\SetClaim->executeInternal()
#12 /srv/mediawiki/php-1.36.0-wmf.34/includes/api/ApiMain.php(1612): Wikibase\Repo\Api\SetClaim->execute()
#13 /srv/mediawiki/php-1.36.0-wmf.34/includes/api/ApiMain.php(591): ApiMain->executeAction()
#14 /srv/mediawiki/php-1.36.0-wmf.34/includes/api/ApiMain.php(562): ApiMain->executeActionWithErrorHandling()
#15 /srv/mediawiki/php-1.36.0-wmf.34/api.php(90): ApiMain->execute()
#16 /srv/mediawiki/php-1.36.0-wmf.34/api.php(45): wfApiMain()
#17 /srv/mediawiki/w/api.php(3): require(string)
#18 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore moved this task from Blocked to legacy-backlog on the wdwb-tech board.
Addshore edited projects, added wdwb-tech (legacy-backlog); removed wdwb-tech.
Addshore added a subscriber: Addshore.

Suspected ways of reproducing the error (to be verified if actually true)

  • throwing in "garbage" input to wbsetclaim API
  • using float number input (assumpution being that strict type checking could have led to the regression here)

This has been fixed in this Pull Request in the Datatype/Geo library.

Still TODO: We still need to wait for the release of 4.3.0 of the package and update the /wikibase/composer.json file with the new version number for this fix to be applied.

Change 681699 had a related patch set uploaded (by Guergana Tzatchkova; author: Guergana Tzatchkova):

[mediawiki/extensions/Wikibase@master] Add new version of DataValues/Geo package to accept string values in LatLongValues

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

The bug should be fixed by merging patch 681699
It is still a good idea to update the package also in mediawiki-vendor when the 681699 is merged.

Mediawiki-vendor on Gerrit
Mediawiki-vendor Github mirror

Change 681699 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add new version of DataValues/Geo package to accept string values in LatLongValues

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

Change 681990 had a related patch set uploaded (by Guergana Tzatchkova; author: Guergana Tzatchkova):

[mediawiki/vendor@master] Update DataValues/Geo Library to v4.3.0 to match version in mediawiki

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

Since discovering that version 4.3.0 of DataValues Geo needs a PHP version 7.3 and the current version in our production environment is 7.2, we will introduce the fix in version 4.2.3 instead.

Change 682136 had a related patch set uploaded (by Guergana Tzatchkova; author: Guergana Tzatchkova):

[mediawiki/extensions/Wikibase@master] Add correct version of DataValues/Geo package to accept string values in LatLongValues

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

Change 682136 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add correct version of DataValues/Geo package to accept string values in LatLongValues

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

Change 681990 merged by jenkins-bot:

[mediawiki/vendor@master] Update DataValues/Geo Library to v4.2.3 to match version in wikibase

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