Page MenuHomePhabricator

MediaWiki\Rest: JSON encoding error: Malformed UTF-8 characters, possibly incorrectly encoded
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

https://logstash.wikimedia.org/goto/d402fbfaba26b7a25231493544fe5ba4

normalized_message
[{reqId}] {exception_url}   MediaWiki\Rest\JsonEncodingException: JSON encoding error: Malformed UTF-8 characters, possibly incorrectly encoded
exception.trace
from /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/ResponseFactory.php(42)
#0 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/ResponseFactory.php(65): MediaWiki\Rest\ResponseFactory->encodeJson(array)
#1 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/ResponseFactory.php(174): MediaWiki\Rest\ResponseFactory->createJson(array)
#2 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/ResponseFactory.php(197): MediaWiki\Rest\ResponseFactory->createHttpError(integer, array)
#3 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/ResponseFactory.php(211): MediaWiki\Rest\ResponseFactory->createLocalizedHttpError(integer, Wikimedia\Message\MessageValue, array)
#4 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/Router.php(332): MediaWiki\Rest\ResponseFactory->createFromException(MediaWiki\Rest\LocalizedHttpException)
#5 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/EntryPoint.php(165): MediaWiki\Rest\Router->execute(MediaWiki\Rest\RequestFromGlobals)
#6 /srv/mediawiki/php-1.37.0-wmf.19/includes/Rest/EntryPoint.php(130): MediaWiki\Rest\EntryPoint->execute()
#7 /srv/mediawiki/php-1.37.0-wmf.19/rest.php(31): MediaWiki\Rest\EntryPoint::main()
#8 /srv/mediawiki/w/rest.php(3): require(string)
#9 {main}
Impact

Reproducible at URLs - fatal error returned to user.

Notes

2150 of these in last four hours; a couple of large spikes.

Details

Request URL
https://commons.wikimedia.org/w/rest.php/v1/file/File:[filename].jpg

Event Timeline

This is continuing to spike intermittently, and now generating alerts.

Change 714663 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] In Rest\\ResponseFactory, substitute invalid UTF-8

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

Change 714663 merged by jenkins-bot:

[mediawiki/core@master] In Rest\\ResponseFactory, substitute invalid UTF-8

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

tstarling claimed this task.