Page MenuHomePhabricator

MWException: Mathoid check returned unexpected error code.
Open, LowPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   MWException: Mathoid check returned unexpected error code.
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.19/extensions/Math/src/InputCheck/MathoidChecker.php(103)
#0 /srv/mediawiki/php-1.37.0-wmf.19/includes/libs/objectcache/wancache/WANObjectCache.php(1713): MediaWiki\Extension\Math\InputCheck\MathoidChecker->runCheck(boolean, integer, array, NULL, array)
#1 /srv/mediawiki/php-1.37.0-wmf.19/includes/libs/objectcache/wancache/WANObjectCache.php(1541): WANObjectCache->fetchOrRegenerate(string, integer, array, array, array)
#2 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Math/src/InputCheck/MathoidChecker.php(68): WANObjectCache->getWithSetCallback(string, integer, array, array)
#3 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Math/src/InputCheck/MathoidChecker.php(117): MediaWiki\Extension\Math\InputCheck\MathoidChecker->getCheckResponse()
#4 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Math/src/MathValidator.php(38): MediaWiki\Extension\Math\InputCheck\MathoidChecker->isValid()
#5 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/Validators/SnakValidator.php(216): MediaWiki\Extension\Math\MathValidator->validate(DataValues\StringValue)
#6 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/Validators/SnakValidator.php(157): Wikibase\Repo\Validators\SnakValidator->validateDataValue(DataValues\StringValue, string)
#7 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/Validators/SnakValidator.php(65): Wikibase\Repo\Validators\SnakValidator->validate(Wikibase\DataModel\Snak\PropertyValueSnak)
#8 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/ChangeOp/ChangeOpStatement.php(228): Wikibase\Repo\Validators\SnakValidator->validateClaimSnaks(Wikibase\DataModel\Statement\Statement)
#9 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/Api/StatementModificationHelper.php(172): Wikibase\Repo\ChangeOp\ChangeOpStatement->validate(Wikibase\DataModel\Entity\Item)
#10 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/Api/SetClaim.php(206): Wikibase\Repo\Api\StatementModificationHelper->applyChangeOp(Wikibase\Repo\ChangeOp\ChangeOpStatement, Wikibase\DataModel\Entity\Item, Wikibase\Lib\Summary)
#11 /srv/mediawiki/php-1.37.0-wmf.19/extensions/Wikibase/repo/includes/Api/SetClaim.php(162): Wikibase\Repo\Api\SetClaim->executeInternal()
#12 /srv/mediawiki/php-1.37.0-wmf.19/includes/api/ApiMain.php(1842): Wikibase\Repo\Api\SetClaim->execute()
#13 /srv/mediawiki/php-1.37.0-wmf.19/includes/api/ApiMain.php(821): ApiMain->executeAction()
#14 /srv/mediawiki/php-1.37.0-wmf.19/includes/api/ApiMain.php(792): ApiMain->executeActionWithErrorHandling()
#15 /srv/mediawiki/php-1.37.0-wmf.19/api.php(90): ApiMain->execute()
#16 /srv/mediawiki/php-1.37.0-wmf.19/api.php(45): wfApiMain()
#17 /srv/mediawiki/w/api.php(3): require(string)
#18 {main}
Impact
Notes

Seen a handful of times in 1.37.0-wmf.19 - 4 instances so far.

Details

Request URL
https://www.wikidata.org/w/api.php

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

There are also associated log events with normalized_message:"Mathoid check endpoint \"{url}\" returned HTTP status code \"{statusCode}\" for post data \"{postData}\": {exception}." that have a bit more details. For instance, one request has:

Mathoid check endpoint "http://localhost:6003/texvcinfo" returned HTTP status code "503" for post data "type=tex&q=%5Clambda": MWException: Mathoid check returned unexpected error code. in /srv/mediawiki/php-1.37.0-wmf.18/extensions/Math/src/InputCheck/MathoidChecker.php:102

%5C is the backslash, so that’s an attempt to validate the TeX \lambda, which ought to be valid. So it looks like this isn’t malicious data or anything – the backend just experiences random errors at times, I guess.

I am not aware of any code path in mathoid that would return 503. Maybe it is a load /network problem. What would be the desired behavior instead of throwing the error? Retry, or would that make things worse?

@Lucas_Werkmeister_WMDE do you also have a timestamp for the error message. I expect that \lambda is a common math expression in Wikidata. Thus, maybe the WANObjectCache is less efficient than it could be.