Page MenuHomePhabricator

JsonConfig api emits PHP Warning "API call had warnings trying to get remote JsonConfig"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

Request ID: INSERT_ID

The message lacks a normalised form, and embeds JSON-encoded messages within, which makes it a big hard to read, but here it is:

message
[W6FlIgrAEHAAAI3cJhYAAACX] /w/api.php?format=json&formatversion=2&action=jsondata&title=Wynyard+railway+station+marker.map   ErrorException from line 309 of /srv/mediawiki/php-1.32.0-wmf.20/includes/debug/MWDebug.php: PHP Warning: API call had warnings trying to get remote JsonConfig: warnings={"main":{"*":"Subscribe to the mediawiki-api-announce mailing list at \u003Chttps://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce\u003E for notice of API deprecations and breaking changes. Use [[Special:ApiFeatureUsage]] to see usage of deprecated features by your application."},"revisions":{"*":"Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."}}, query={"action":"query","titles":"Data:Wynyard railway station marker.map","prop":"revisions","rvprop":"content","continue":""} [Called from JsonConfig\JCUtils::warn in /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCUtils.php at line 53]
stacktrace
#0 /srv/mediawiki/php-1.32.0-wmf.20/includes/debug/MWDebug.php(309): MWExceptionHandler::handleError(integer, string, string, integer, array, array)
#1 /srv/mediawiki/php-1.32.0-wmf.20/includes/debug/MWDebug.php(164): MWDebug::sendMessage(string, array, string, integer)
#2 /srv/mediawiki/php-1.32.0-wmf.20/includes/GlobalFunctions.php(1147): MWDebug::warning(string, integer, integer, string)
#3 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCUtils.php(53): wfLogWarning(string)
#4 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCUtils.php(125): JsonConfig\JCUtils::warn(string, array, array)
#5 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCCache.php(221): JsonConfig\JCUtils::callApi(CurlHttpRequest, array, string)
#6 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCCache.php(183): JsonConfig\JCCache->getPageFromApi(string, CurlHttpRequest, array)
#7 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCCache.php(60): JsonConfig\JCCache->loadRemote()
#8 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCSingleton.php(373): JsonConfig\JCCache->get()
#9 /srv/mediawiki/php-1.32.0-wmf.20/extensions/JsonConfig/includes/JCDataApi.php(20): JsonConfig\JCSingleton::getContent(JsonConfig\JCTitle)
#10 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiMain.php(1587): JsonConfig\JCDataApi->execute()
#11 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiMain.php(531): ApiMain->executeAction()
#12 /srv/mediawiki/php-1.32.0-wmf.20/includes/api/ApiMain.php(502): ApiMain->executeActionWithErrorHandling()
#13 /srv/mediawiki/php-1.32.0-wmf.20/api.php(87): ApiMain->execute()

Notes

Found via channel:error AND message:JCUtils. First reported on 1.32.0-wmf.16 (possibly earlier).

Apparently comes when using action=jsondata. The API yields:

"revisions":{
    "*":"Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."}

Previously mentioned at T202764#4537363.

Event Timeline

hashar subscribed.

Seems Kartographer lacks a rvslot when doing the query:

includes/SimpleStyleParser.php
				$query = [
					'format' => 'json',
					'formatversion' => '2',
					'action' => 'jsondata',
					'title' => $jct->getText(),
				];

And from mwgrep jsondata:

https://de.wikivoyage.org/wiki/MediaWiki:MapTools.js
https://de.wikivoyage.org/wiki/MediaWiki:Poi2gpx.js

I cant tell whether the javascript could trigger the warning though. But both js files are maps/kartographer related.

(Still seen on 1.33-wmf.14.)

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

JsonConfig is the most common producer of errors in the production logs over the past few weeks, this makes deployments more difficult and risky than they need to be. Tagging Product-Infra per mw:Maintainers page to hopefully look into this.

Change 542661 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/JsonConfig@master] Fix API warning

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

Change 542661 merged by jenkins-bot:
[mediawiki/extensions/JsonConfig@master] Fix API warning

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

Yes, that code went out in wmf.2 last week and is also in wmf.3 this week, which is now also everywhere.

Yes, that code went out in wmf.2 last week and is also in wmf.3 this week, which is now also everywhere.

Thanks! I thought it wasn't effective but the error seems to be fixed as of October 21st.

Jdforrester-WMF assigned this task to MaxSem.
Jdforrester-WMF moved this task from Older to Resolved on the Wikimedia-production-error board.