Page MenuHomePhabricator

Invalid JSON file: /srv/vagrant/mediawiki/extensions/TimedMediaHandler/MwEmbedModules/TimedText/i18n/qqq.json
Closed, ResolvedPublic

Description

$ json_verify < qqq.json
lexical error: invalid char in json text.

                   {       "@metadata": {          "authors":
(right here) ------^

JSON is invalid


  1. TranslateHooksTest::testPreventCategorization

MWException: LocalisationCache::readJSONFile: Invalid JSON file: /srv/vagrant/mediawiki/extensions/TimedMediaHandler/MwEmbedModules/TimedText/i18n/qqq.json

/srv/vagrant/mediawiki/includes/cache/LocalisationCache.php:562
/srv/vagrant/mediawiki/includes/cache/LocalisationCache.php:876
/srv/vagrant/mediawiki/includes/cache/LocalisationCache.php:452
/srv/vagrant/mediawiki/includes/cache/LocalisationCache.php:326
/srv/vagrant/mediawiki/includes/cache/LocalisationCache.php:260
/srv/vagrant/mediawiki/languages/Language.php:4272
/srv/vagrant/mediawiki/languages/Language.php:202
/srv/vagrant/mediawiki/languages/Language.php:161
/srv/vagrant/mediawiki/includes/GlobalFunctions.php:1424
/srv/vagrant/mediawiki/includes/content/ContentHandler.php:660
/srv/vagrant/mediawiki/includes/Title.php:4932
/srv/vagrant/mediawiki/includes/parser/Parser.php:859
/srv/vagrant/mediawiki/includes/parser/Parser.php:1903
/srv/vagrant/mediawiki/includes/parser/Parser.php:1866
/srv/vagrant/mediawiki/includes/parser/Parser.php:1262
/srv/vagrant/mediawiki/includes/parser/Parser.php:405
/srv/vagrant/mediawiki/includes/content/WikitextContent.php:327
/srv/vagrant/mediawiki/includes/content/AbstractContent.php:486
/srv/vagrant/mediawiki/includes/page/WikiPage.php:2145
/srv/vagrant/mediawiki/extensions/TemplateData/TemplateData.hooks.php:71
/srv/vagrant/mediawiki/includes/Hooks.php:206
/srv/vagrant/mediawiki/includes/GlobalFunctions.php:4031
/srv/vagrant/mediawiki/includes/page/WikiPage.php:1780
/srv/vagrant/mediawiki/extensions/Translate/tests/phpunit/TranslateHooksTest.php:64
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160


Version: unspecified
Severity: normal

Details

Reference
bz68635

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:38 AM
bzimport set Reference to bz68635.
bzimport added a subscriber: Unknown Object (MLST).

I'm confused.

bawolff@Bawolff-L:/var/www/w/extensions/TimedMediaHandler/MwEmbedModules/TimedText/i18n$ json_verify < qqq.json
lexical error: invalid char in json text.

                   { 	"@metadata": { 		"authors":
(right here) ------^

JSON is invalid

So json_verify is pointing to the opening '{' in the file. first thought would be a BOM or something.

bawolff@Bawolff-L:/var/www/w/extensions/TimedMediaHandler/MwEmbedModules/TimedText/i18n$ hd qqq.json |head
00000000 7b 0a 09 22 40 6d 65 74 61 64 61 74 61 22 3a 20 |{.."@metadata": |
00000010 7b 0a 09 09 22 61 75 74 68 6f 72 73 22 3a 20 5b |{..."authors": [|
00000020 0a 09 09 09 22 45 75 67 65 6e 65 5a 65 6c 65 6e |...."EugeneZelen|
00000030 6b 6f 22 2c 0a 09 09 09 22 53 68 69 72 61 79 75 |ko",...."Shirayu|
00000040 6b 69 22 2c 0a 09 09 09 22 53 69 65 62 72 61 6e |ki",...."Siebran|
00000050 64 22 2c 0a 09 09 09 22 55 6d 68 65 72 69 72 72 |d",...."Umherirr|
00000060 65 6e 64 65 72 22 0a 09 09 5d 0a 09 7d 2c 0a 09 |ender"...]..},..|
00000070 22 6d 77 65 2d 74 69 6d 65 64 74 65 78 74 2d 73 |"mwe-timedtext-s|
00000080 74 61 67 65 2d 74 72 61 6e 73 63 72 69 62 65 22 |tage-transcribe"|
00000090 3a 20 22 55 6e 75 73 65 64 20 61 74 20 74 68 69 |: "Unused at thi|

Don't see anything out of the ordinary. I'm not sure what's invalid in this file.

Change 149641 had a related patch set uploaded by Brian Wolff:
Fix typo in qqq.json

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

Err, nevermind. Error message was just misleading. Issue was lack of escaping '"' character.

Change 149641 merged by jenkins-bot:
Fix typo in qqq.json

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

This was an issue with TimedMediaHandler, not bug 67216 which is about tests of extensions to work together.

Gilles moved this task from Untriaged to Done on the Multimedia board.Dec 2 2014, 8:53 AM