Page MenuHomePhabricator

"PHP Warning: API call failed to get remote JsonConfig" due to HTTP 503
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error: When using mw.ext.data.get() in wikitext via Scribunto

labels.normalized_message
[{reqId}] {exception_url}   PHP Warning: API call failed to get remote JsonConfig: status=There was a problem during the HTTP request: 503 Service Unavailable, query= [Called from JsonConfig\JCUtils::warn in /srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCUtils.php at line 47]
FrameLocationCall
#6/srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCCache.php(224)JsonConfig\JCUtils::callApi(GuzzleHttpRequest, array, string)
#7/srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCCache.php(185)JsonConfig\JCCache->getPageFromApi(string, GuzzleHttpRequest, array)
#8/srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCCache.php(63)JsonConfig\JCCache->loadRemote()
#9/srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCSingleton.php(373)JsonConfig\JCCache->get()
#10/srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCLuaLibrary.php(48)JsonConfig\JCSingleton::getContent(JsonConfig\JCTitle)
#11/srv/mediawiki/php-1.43.0-wmf.23/extensions/Scribunto/includes/Engines/LuaSandbox/LuaSandboxCallback.php(31)JsonConfig\JCLuaLibrary->get(string, null)
#41/srv/mediawiki/php-1.43.0-wmf.23/includes/content/WikitextContentHandler.php(384)MediaWiki\Parser\Parser->parse(string, MediaWiki\Title\Title, ParserOptions, bool, bool, int)
#53/srv/mediawiki/php-1.43.0-wmf.23/includes/api/ApiParse.php(194)WikiPage->getParserOutput(ParserOptions, null, bool)
#59/srv/mediawiki/php-1.43.0-wmf.23/includes/api/ApiMain.php(1954)ApiParse->execute()
#65/srv/mediawiki/w/api.php(3)require(string)
Notes

Started after rolling wmf.23 to group2. The issue so far has affected a few concrete wikis: English, Arabic, Egyptian Arabic, Ukrainian, Russian and German.

The problem originates in the core debug utils, in this logging function. Presumably this debugging code was enabled in this release for the wikis mentioned above.

The error volume in the logs is relatively low but constant and creates some noise.

It's unclear whether the logging code is doing something wrong/calling the wrong downstream or an infra issue with the downstream service.

I'm tagging the task with the JsonConfig extension since that's the code calling the debugging functionality, but I wasn't sure. Please reassign the tags if needed.

Impact
@Krinkle wrote:

The page has a gap or includes an inline error message given that the wikitext did not receive any content from the cross-wiki transclusion of JsonConfig data. The JsonConfig code currently returns false in that case, the same way as if the target page did not exist.

Error: When calling api.php?action=jsondata&title=..

normalized_message
[{reqId}] {exception_url}   PHP Warning: API call failed to get remote JsonConfig: status=There was a problem during the HTTP request: 503 Service Unavailable
FrameLocationCall
#6/srv/mediawiki/php-1.44.0-wmf.25/extensions/JsonConfig/includes/JCCache.php(224)JsonConfig\JCUtils::callApi(GuzzleHttpRequest, array, string)
#7/srv/mediawiki/php-1.44.0-wmf.25/extensions/JsonConfig/includes/JCCache.php(185)JsonConfig\JCCache->getPageFromApi(string, GuzzleHttpRequest, array)
#10/srv/mediawiki/php-1.44.0-wmf.25/extensions/JsonConfig/includes/JCDataApi.php(21)JsonConfig\JCSingleton::getContent(JsonConfig\JCTitle)
#11/srv/mediawiki/php-1.44.0-wmf.25/includes/api/ApiMain.php(2005)JsonConfig\JCDataApi->execute()
#18{main}
Impact

API response with confusing error code apierror-invalidtitle.

Details

Request URL
https://en.wikipedia.org/w/api.php

Event Timeline

jnuche renamed this task from PHP Warning: API call failed to get remote JsonConfig: status=There was a problem during the HTTP request: 503 Service Unavailable, query= [Called from JsonConfig\JCUtils::warn in /srv/mediawiki/php-1.43.0-wmf.23/extensions/Jso to PHP Warning: API call failed to get remote JsonConfig: status=There was a problem during the HTTP request: 503 Service Unavailable, query= [Called from JsonConfig\JCUtils::warn in /srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCUtils.php at line 47].Sep 19 2024, 11:24 AM
jnuche updated the task description. (Show Details)

@Krinkle Where do you see ContentTranslation? I only see Cite in the trace.

@Nikerabbit I don't remember, sorry. It looks like a mistake indeed. Removed.

Still seen.

Error
normalized_message
[{reqId}] {exception_url}   PHP Warning: API call failed to get remote JsonConfig: status=There was a problem during the HTTP request: 503 Service Unavailable
FrameLocationCall
#6/srv/mediawiki/php-1.44.0-wmf.25/extensions/JsonConfig/includes/JCCache.php(224)JsonConfig\JCUtils::callApi(GuzzleHttpRequest, array, string)
#7/srv/mediawiki/php-1.44.0-wmf.25/extensions/JsonConfig/includes/JCCache.php(185)JsonConfig\JCCache->getPageFromApi(string, GuzzleHttpRequest, array)
#10/srv/mediawiki/php-1.44.0-wmf.25/extensions/JsonConfig/includes/JCDataApi.php(21)JsonConfig\JCSingleton::getContent(JsonConfig\JCTitle)
#11/srv/mediawiki/php-1.44.0-wmf.25/includes/api/ApiMain.php(2005)JsonConfig\JCDataApi->execute()
#18{main}

Given that this involves a call to another service via Envoy, and that the return code is HTTP 503, I'm assuming this is another victim of Envoy outgoing traffic being shutdown before the MediaWiki container, e.g. as described in T349823#9284544.

Krinkle renamed this task from PHP Warning: API call failed to get remote JsonConfig: status=There was a problem during the HTTP request: 503 Service Unavailable, query= [Called from JsonConfig\JCUtils::warn in /srv/mediawiki/php-1.43.0-wmf.23/extensions/JsonConfig/includes/JCUtils.php at line 47] to "PHP Warning: API call failed to get remote JsonConfig" due to HTTP 503.Apr 30 2025, 6:30 PM
Krinkle updated the task description. (Show Details)