Page MenuHomePhabricator

Fatal error from ResourceLoader.php: JSON serialization of config data failed
Closed, ResolvedPublic

Description

Error

Request ID: W8vJyQpAMFsAAFsjYAAAAAAG

message
Exception from line 1539 of /srv/mediawiki/php-1.32.0-wmf.26/includes/resourceloader/ResourceLoader.php: JSON serialization of config data failed. This usually means the config data is not valid UTF-8.
trace
#0 /srv/mediawiki/php-1.32.0-wmf.26/includes/resourceloader/ResourceLoaderClientHtml.php(283): ResourceLoader::makeConfigSetScript(array)
#1 /srv/mediawiki/php-1.32.0-wmf.26/includes/OutputPage.php(3091): ResourceLoaderClientHtml->getHeadHtml()
#2 /srv/mediawiki/php-1.32.0-wmf.26/includes/skins/SkinTemplate.php(472): OutputPage->headElement(SkinVector)
#3 /srv/mediawiki/php-1.32.0-wmf.26/includes/skins/SkinTemplate.php(225): SkinTemplate->prepareQuickTemplate()
#4 /srv/mediawiki/php-1.32.0-wmf.26/includes/OutputPage.php(2597): SkinTemplate->outputPage()
#5 /srv/mediawiki/php-1.32.0-wmf.26/includes/MediaWiki.php(867): OutputPage->output(boolean)
#6 /srv/mediawiki/php-1.32.0-wmf.26/includes/MediaWiki.php(879): Closure$MediaWiki::main()
#7 /srv/mediawiki/php-1.32.0-wmf.26/includes/MediaWiki.php(517): MediaWiki->main()
#8 /srv/mediawiki/php-1.32.0-wmf.26/index.php(42): MediaWiki->run()

Impact

Several pages on my.wikipedia.org and ml.wikipedia.org cannot be viewed. For example: https://my.wikipedia.org/wiki/Wikipedia:NOTWIKIA and https://ml.wikipedia.org/wiki/വിക്കിപീഡിയ:NOTLINKEDIN.

Triaging as UBN because this is a fatal error on a regular user request that is a risk for HTTP 5xx alarms, and also because it makes some of our primary content entirely inaccessible.

Notes

Event Timeline

Krinkle triaged this task as Unbreak Now! priority.Oct 24 2018, 6:18 PM
Krinkle created this task.
Restricted Application added subscribers: Liuxinyu970226, TerraCodes, Aklapper. · View Herald TranscriptOct 24 2018, 6:18 PM

Both of these have invalid values for wgInternalRedirectTargetUrl:

https://my.wikipedia.org/wiki/Wikipedia:NOTWIKIA :

["wgInternalRedirectTargetUrl"]=> string(507) "/wiki/Wikipedia:%E1%80%9D%E1%80%AE%E1%80%80%E1%80%AE%E1%80%95%E1%80%AE%E1%80%B8%E1%80%92%E1%80%AE%E1%80%B8%E1%80%9A%E1%80%AC%E1%80%B8%E1%80%80_%E1%80%98%E1%80%AC%E1%80%99%E1%80%9F%E1%80%AF%E1%80%90%E1%80%BA%E1%80%98%E1%80%B0%E1%80%B8%E1%80%9C%E1%80%B2#ဝီကီပီးဒီးယားသည်_ဘလော့ဂ်၊_ဝက်ဘ်လွှင့်တင်သည့်_ဝန်ဆောင်မှု၊_လူမှုကွန်ယက်ဝန်ဆောင်မှု_သို့မဟ�"

https://ml.wikipedia.org/wiki/വിക്കിപീഡിയ:NOTLINKEDIN :

string(579) "/wiki/%E0%B4%B5%E0%B4%BF%E0%B4%95%E0%B5%8D%E0%B4%95%E0%B4%BF%E0%B4%AA%E0%B5%80%E0%B4%A1%E0%B4%BF%E0%B4%AF:%E0%B4%B5%E0%B4%BF%E0%B4%95%E0%B5%8D%E0%B4%95%E0%B4%BF%E0%B4%AA%E0%B5%80%E0%B4%A1%E0%B4%BF%E0%B4%AF_%E0%B4%8E%E0%B4%A8%E0%B5%8D%E0%B4%A4%E0%B5%8A%E0%B4%95%E0%B5%8D%E0%B4%95%E0%B5%86%E0%B4%AF%E0%B4%B2%E0%B5%8D%E0%B4%B2#വിക്കിപീഡിയ_ഒരു_ബ്ലോഗോ_വെബ്‌സ്പേസ്_ദാതാവോ_സോഷ്യൽ_നെറ്റ്‌വർക്കിങ്_സൈറ്റോ_അനുസ്മരണ_സൈറ്റോ_അല്�"

The reason the redirect target is invalid is because the fragment is too long and got cut off when it was inserted into the database:

ysql:research@s3-analytics-slave [mywiki]> select *, length(rd_fragment) from redirect where rd_from=79979 \G
*************************** 1. row ***************************
            rd_from: 79979
       rd_namespace: 4
           rd_title: ဝီကီပီးဒီးယားက_ဘာမဟုတ်ဘူးလဲ
       rd_interwiki: 
        rd_fragment: ဝီကီပီးဒီးယားသည် ဘလော့ဂ်၊ ဝက်ဘ်လွှင့်တင်သည့် ဝန်ဆောင်မှု၊ လူမှုကွန်ယက်ဝန်ဆောင်မှု သို့မဟ�
length(rd_fragment): 255
1 row in set (0.02 sec)


mysql:research@s3-analytics-slave [mlwiki]> select *, length(rd_fragment) from redirect where rd_from=243697 \G
*************************** 1. row ***************************
            rd_from: 243697
       rd_namespace: 4
           rd_title: വിക്കിപീഡിയ_എന്തൊക്കെയല്ല
       rd_interwiki: 
        rd_fragment: വിക്കിപീഡിയ ഒരു ബ്ലോഗോ വെബ്‌സ്പേസ് ദാതാവോ സോഷ്യൽ നെറ്റ്‌വർക്കിങ് സൈറ്റോ അനുസ്മരണ സൈറ്റോ അല്��
length(rd_fragment): 255
1 row in set (0.00 sec)

Change 469543 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] MediaWikiTitleCodec: Limit fragments to 255 bytes

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

Change 469544 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] WikiPage: Truncate redirect fragments before inserting them into the DB

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

Either of these two patches fixes this bug, but the WikiPage one is more minimal, and the TitleCodec one is more far-reaching.

Change 469544 merged by jenkins-bot:
[mediawiki/core@master] WikiPage: Truncate redirect fragments before inserting them into the DB

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

Change 469553 had a related patch set uploaded (by Jforrester; owner: Catrope):
[mediawiki/core@wmf/1.33.0-wmf.1] WikiPage: Truncate redirect fragments before inserting them into the DB

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

Is this really a train blocker? Fixing code from 2008?

This is a regression caused by abd3c02d0811302.

And yet it wasn't serious enough to block the wmf.26 train. Train blockers are for serious issues. This isn't that.

Change 469553 merged by jenkins-bot:
[mediawiki/core@wmf/1.33.0-wmf.1] WikiPage: Truncate redirect fragments before inserting them into the DB

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

Krinkle closed this task as Resolved.Oct 25 2018, 8:50 PM
Krinkle assigned this task to Catrope.

This happening too in T208689

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