Page MenuHomePhabricator

JsonConfig logs warnings with a translated http-bad-status
Closed, ResolvedPublic

Description

While filing T421370, I have noticed that when JsonConfig encounters a http backend failure, it logs a message with the translated http-bad-status message. This results in different normalized messages for the same issue. Examples:

PHP Warning: API call failed to get remote jsontransform result: status=Во время обработки HTTP-запроса обнаружена проблема: 503 Service Unavailable, query= [Called from MediaWiki\Extens
[{reqId}] {exception_url} PHP Warning: API call failed to get remote jsontransform result: status=There was a problem during the HTTP request: 503 Service Unavailable
[{reqId}] {exception_url} PHP Warning: API call failed to get remote jsontransform result: status=Arazo bat egon da HTTP eskaera bitartean: 503 Service Unavailable
[{reqId}] {exception_url} PHP Warning: API call failed to get remote jsontransform result: status=Während der HTTP-Anfrage ist ein Fehler aufgetreten: 503 Service Unavailable,
trace
from /srv/mediawiki/php-1.46.0-wmf.21/includes/Debug/MWDebug.php(486)
#0 [internal function]: MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1 /srv/mediawiki/php-1.46.0-wmf.21/includes/Debug/MWDebug.php(486): trigger_error(string, int)
#2 /srv/mediawiki/php-1.46.0-wmf.21/includes/Debug/MWDebug.php(195): MediaWiki\Debug\MWDebug::sendMessage(string, string, int)
#3 /srv/mediawiki/php-1.46.0-wmf.21/includes/GlobalFunctions.php(576): MediaWiki\Debug\MWDebug::warning(string, int, int, string)
#4 /srv/mediawiki/php-1.46.0-wmf.21/extensions/JsonConfig/includes/JCUtils.php(46): wfLogWarning(string)
#5 /srv/mediawiki/php-1.46.0-wmf.21/extensions/JsonConfig/includes/JCApiUtils.php(93): MediaWiki\Extension\JsonConfig\JCUtils::warn(string, array, array)
#6 /srv/mediawiki/php-1.46.0-wmf.21/extensions/JsonConfig/includes/JCContentLoader.php(142): MediaWiki\Extension\JsonConfig\JCApiUtils->callApiStatus(MediaWiki\Http\GuzzleHttpRequest, array, string)
#7 /srv/mediawiki/php-1.46.0-wmf.21/extensions/JsonConfig/includes/JCContentLoader.php(64): MediaWiki\Extension\JsonConfig\JCContentLoader->remoteTransform()
#8 /srv/mediawiki/php-1.46.0-wmf.21/extensions/Chart/src/ParserFunction.php(271): MediaWiki\Extension\JsonConfig\JCContentLoader->load()
...

Event Timeline

Change #1261442 had a related patch set uploaded (by Arendpieter; author: Arendpieter):

[mediawiki/extensions/JsonConfig@master] Log English status messages instead of translated ones

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

Change #1261442 merged by jenkins-bot:

[mediawiki/extensions/JsonConfig@master] Log English status messages instead of translated ones

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