Page MenuHomePhabricator

Exception: JSON serialization of config data failed. (via OutputPage::getBottomScripts)
Open, Needs TriagePublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   Exception: JSON serialization of config data failed. This usually means the config data is not valid UTF-8.
exception.trace
from /srv/mediawiki/php-1.40.0-wmf.19/includes/ResourceLoader/ResourceLoader.php(1600)
#0 /srv/mediawiki/php-1.40.0-wmf.19/includes/OutputPage.php(3500): MediaWiki\ResourceLoader\ResourceLoader::makeConfigSetScript(array)
#1 /srv/mediawiki/php-1.40.0-wmf.19/includes/OutputPage.php(4500): OutputPage->getBottomScripts(string)
#2 /srv/mediawiki/php-1.40.0-wmf.19/includes/skins/SkinMustache.php(66): OutputPage->tailElement(MediaWiki\Skins\Vector\SkinVectorLegacy)
#3 /srv/mediawiki/php-1.40.0-wmf.19/includes/skins/SkinTemplate.php(179): SkinMustache->generateHTML()
#4 /srv/mediawiki/php-1.40.0-wmf.19/includes/OutputPage.php(2887): SkinTemplate->outputPage()
#5 /srv/mediawiki/php-1.40.0-wmf.19/includes/MediaWiki.php(933): OutputPage->output(boolean)
#6 /srv/mediawiki/php-1.40.0-wmf.19/includes/MediaWiki.php(571): MediaWiki->main()
#7 /srv/mediawiki/php-1.40.0-wmf.19/index.php(50): MediaWiki->run()
#8 /srv/mediawiki/php-1.40.0-wmf.19/index.php(46): wfIndexMain()
#9 /srv/mediawiki/w/index.php(3): require(string)
#10 {main}
Impact
Notes

See a handful of these in 1.40.0-wmf.20 (T325583). Seems like T208689: Fatal error: JSON serialization of config data failed, invalid UTF-8 (via Scribunto) over again. I am guessing that this is a situation which should result in a user-facing error rather than an exception hitting the logs.

Details

Request URL
https://de.wikipedia.org/wiki/Spezial:Vorlagenspielwiese

Event Timeline

Krinkle renamed this task from Exception: JSON serialization of config data failed. This usually means the config data is not valid UTF-8. to Exception: JSON serialization of config data failed. (via OutputPage::getBottomScripts).Feb 14 2023, 11:01 PM

Quoting from the other task as the same applies here:

[These kinds of errors] ar is most likely due to an extension adding a key-value pair to mw.config with a string that is not valid UTF-8. This means it can't be encoded as JSON, and thus fails the blob. […]

This seems to come up once or twice a year, with usually a dedicated task for specific breakages once identified, such as:

The trace in the task description here contains OutputPage->getBottomScripts(string) which narrows it down to three keys:

  • wgPageParseReport
  • wgDiscussionToolsPageThreads (via LateJSConfigVarNames)
  • wgGraphSpecs (via LateJSConfigVarNames)

To know which one, though, would require a reproduction case that is more reliable than the given Special:TemplateSandbox URL, since that special page is empty when accessed directly. The person using it will have entered some arbitrary wikitext to preview. You'd need to know that wikitext, or find an instance of the error on a regular page.