Page MenuHomePhabricator

Sorting broken for anonymous users - TypeError: Cannot read properties of undefined (reading 'type') / TypeError: Language ID should be string or object. / TypeError: undefined is not an object (evaluating 'cachedParsers[sortList[i][0]].type') / TypeError: locale value must be a string or object
Closed, ResolvedPublicBUG REPORT

Description

New issue in 1.41.0-wmf.10 https://logstash.wikimedia.org/app/dashboards#/doc/logstash-*/logstash-default-1-7.0.0-1-2023.05.27?id=k0NDXogBnUsAfeivq9nP
111,407 errors since rolled out the train (so very bad)

I can replicate this in an incognito window if I go to https://en.m.wikipedia.org/wiki/Korean_drama#By_household_rating and click the "network" or "series" column.

TypeError: Cannot read properties of undefined (reading 'type')
Uncaught TypeError: Language ID should be string or object.

Stack trace:

at multisort  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.scribunto.logs%7Cjquery%7Cjquery.tablesorter%7Cmediawiki.language.months&skin=minerva&version=1otty:152:105
at HTMLTableCellElement.<anonymous>  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.scribunto.logs%7Cjquery%7Cjquery.tablesorter%7Cmediawiki.language.months&skin=minerva&version=1otty:160:363
at HTMLTableCellElement.dispatch  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.scribunto.logs%7Cjquery%7Cjquery.tablesorter%7Cmediawiki.language.months&skin=minerva&version=1otty:70:260
at elemData.handle  https://en.m.wikipedia.org/w/load.php?lang=en&modules=ext.scribunto.logs%7Cjquery%7Cjquery.tablesorter%7Cmediawiki.language.months&skin=minerva&version=1otty:66:877

Event Timeline

Jdlrobson triaged this task as Unbreak Now! priority.May 27 2023, 5:36 PM

The most recent change was in 13e0a7cc588a by @Esanders and I9206465bbd6a4352e1ab7c28324968653dc444e3 by @BrandonXLF which look unrelated,

My guess so it's possible a template change has tripped up some existing bug in our code.

I'm out on vacation so can't look into this, but given the high error rate that pinged me, I think this should block the next train as we can't monitor JS errors while this bug exists at this volume.

Also can replicate on the table in https://en.m.wikipedia.org/wiki/Ceremonial_counties_of_England#Lieutenancy_areas_since_1997 but oddly only in an incognito window..

Tagging content transform team in case there's something changed in the parser HTML relating to these tables that might explain it.

Jdlrobson renamed this task from Sorting error - TypeError: Cannot read properties of undefined (reading 'type') to Sorting error - TypeError: Cannot read properties of undefined (reading 'type') / TypeError: Language ID should be string or object. / TypeError: undefined is not an object (evaluating 'cachedParsers[sortList[i][0]].type') / TypeError: locale value must be a string or object.May 27 2023, 5:53 PM
Jdlrobson renamed this task from Sorting error - TypeError: Cannot read properties of undefined (reading 'type') / TypeError: Language ID should be string or object. / TypeError: undefined is not an object (evaluating 'cachedParsers[sortList[i][0]].type') / TypeError: locale value must be a string or object to Sorting broken for anonymous users - TypeError: Cannot read properties of undefined (reading 'type') / TypeError: Language ID should be string or object. / TypeError: undefined is not an object (evaluating 'cachedParsers[sortList[i][0]].type') / TypeError: locale value must be a string or object.

FWIW, ?action=purge on https://en.m.wikipedia.org/wiki/Korean_drama appeared to fix the issue on that page for me.

Oh, that might be because of the cached HTML... I should export the new config a few trains before the js change. If this is still happening, we can revert the js part of commit dea08aa222c34ff793187b87771a42d76350c932.

cc @Winston_Sung

Change 923638 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Revert "Rename wgPageContentLanguage to wgPageViewLanguage"

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

If we just deploy the revert, it's going to be broken on newly cached pages in the opposite way – now we have some old cached HTML with wgPageContentLanguage and JS code looking for wgPageViewLanguage, and after reverting the change, we will have some newer cached HTML with wgPageViewLanguage and JS code looking for wgPageContentLanguage.

The right fix is probably to change the JS code to accept either of these mw.config variables.

Change 923638 merged by jenkins-bot:

[mediawiki/core@master] Revert "Rename wgPageContentLanguage to wgPageViewLanguage" partially

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

Change 924086 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@wmf/1.41.0-wmf.10] Revert "Rename wgPageContentLanguage to wgPageViewLanguage" partially

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

I didn't notice that when posting my previous comment, but @Func has edited the proposed revert to only partially undo the change – after the revert, both wgPageViewLanguage and wgPageContentLanguage are present, which will avoid the issue. Sorry I missed that.

Func lowered the priority of this task from Unbreak Now! to High.May 29 2023, 2:13 PM

Not a blocker for wmf.11 anymore, the fix is on that train. Added back to wmf.10 blocker for tracking, maybe.

Change 924086 merged by jenkins-bot:

[mediawiki/core@wmf/1.41.0-wmf.10] Revert "Rename wgPageContentLanguage to wgPageViewLanguage" partially

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

Mentioned in SAL (#wikimedia-operations) [2023-05-30T07:46:49Z] <ladsgroup@deploy1002> Started scap: Backport for [[gerrit:924086|Revert "Rename wgPageContentLanguage to wgPageViewLanguage" partially (T337634)]]

Mentioned in SAL (#wikimedia-operations) [2023-05-30T07:48:13Z] <ladsgroup@deploy1002> func and ladsgroup: Backport for [[gerrit:924086|Revert "Rename wgPageContentLanguage to wgPageViewLanguage" partially (T337634)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-05-30T07:56:06Z] <ladsgroup@deploy1002> Finished scap: Backport for [[gerrit:924086|Revert "Rename wgPageContentLanguage to wgPageViewLanguage" partially (T337634)]] (duration: 09m 17s)

matmarex assigned this task to Func.

Looks resolved by the deployment (although the errors were already subsiding on their own). Here's a query for one of the error messages: https://logstash.wikimedia.org/goto/962f47235e752b51e0b56ea0899503be

image.png (549×2 px, 73 KB)