Page MenuHomePhabricator

'TypeError: imeLanguageList.forEach is not a function' when editing Commons pages
Closed, ResolvedPublic

Description

The error seen in attached screenshot appears while any edit window is open on Wikimedia Commons. It disappears after a few seconds but reappears once typing resumes. I have not encountered the error on any other project.

t mw.ime.getIMELanguageList URL1:1:1478
at mw.ime.addIme URL1:5:592
at mw.ime.handleFocus URL1:5:499
at mw.ime.setup/< URL1:5:44
at dispatch URL2:193:742
at add/elemData.handle URL2:190:388
at trigger URL2:239:596
at simulate URL2:240:460
at handler URL2:240:843

URL1: https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.uls.i18n%2Cime%2Clanguagenames%2Cmediawiki%2Cmessages%7Cjquery.i18n%2Cime%2Culs%7Cjquery.uls.grid&skin=vector&version=1n1zi
URL2: https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.TemplateWizard%2Ccharinsert%2CeventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.TwoColConflict.JSCheck%7Cext.centralNotice.geoIP%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.echo.api%2Cinit%7Cext.uls.common%2Ccompactlinks%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cjquery%2Cmoment%2Coojs%2Coojs-ui-core%2Coojs-ui-toolbars%2Coojs-ui-widgets%2Coojs-ui-windows%2Csite%7Cjquery.client%2Ccookie%2ClengthLimit%2CmakeCollapsible%2CtextSelection%7Cjquery.makeCollapsible.styles%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2Cicon%2CjqueryMsg%2Clanguage%2Cstorage%2Cuser%2Cutil%2Cwidgets%7Cmediawiki.ForeignApi.core%7Cmediawiki.action.edit%7Cmediawiki.action.edit.collapsibleFooter%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmediawiki.ui.button%7Cmediawiki.widgets.DateInputWidget%2CUserInputWidget%2CvisibleLengthLimit%7Cmediawiki.widgets.DateInputWidget.styles%7Coojs-ui-toolbars.icons%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.icons-content%2Cicons-interactions%2Cicons-movement%7Cskins.vector.legacy.js%7Cuser.defaults&skin=vector&version=kj8an

Steps to reproduce

  1. Enable input methods
  2. Execute this on console: $.ime.preferences.registry.previousLanguages = '["en"]'
  3. Activate an input field

This corrupted value can be persisted by now opening ULS input preferences, doing a change and saving. The proposed patch will ignore corrupted values on load.

Expected outcome

Corrupted input method preference values will not prevent input methods from working and log spam is gone.

Event Timeline

Are you using Internet Explorer?

The latest version of Firefox. I can reproduce the issue on other browsers, though.

When you observe this error, can you execute these lines of code one by one in your browser's JavaScript console and paste here what it returns:

$.ime.preferences.getPreviousLanguages();

localStorage.getItem( 'uls-previous-languages' );

When you observe this error, can you execute these lines of code one by one in your browser's JavaScript console and paste here what it returns:

$.ime.preferences.getPreviousLanguages();

localStorage.getItem( 'uls-previous-languages' );
$.ime.preferences.getPreviousLanguages();
"[\"en\"]"

localStorage.getItem( 'uls-previous-languages' );
"[\"fromgov\",\"ownwork\",\"en\"]"

First value is corrupted, it should be an array, not a string. Are you logged in or logged out?

Jdlrobson added a subscriber: Jdlrobson.

Quite a few of these are showing up in our logstash instance.
https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2020.09.16/clienterror/?id=AXSWwi8zLNRtRo5Xwcbu

at mw.ime.getIMELanguageList URL1:1:1478
at mw.ime.addIme URL1:5:592
at mw.ime.handleFocus URL1:5:499
at mw.ime.setup/< URL1:5:44
at dispatch URL2:200:742
at add/elemData.handle URL2:197:388
at trigger URL2:246:596
at simulate URL2:247:460
at handler URL2:247:843

URL1: https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.uls.i18n%2Cime%2Clanguagenames%2Cmediawiki%2Cmessages%7Cjquery.i18n%2Cime%2Culs%7Cjquery.uls.grid&skin=vector&version=1ushi
URL2: https://meta.wikimedia.org/w/load.php?lang=en&modules=ext.TemplateWizard%2Ccharinsert%2CeventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.TwoColConflict.JSCheck%7Cext.centralNotice.geoIP%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.echo.api%2Cinit%7Cext.uls.common%2Ccompactlinks%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.wikimediaEvents.loggedin%7Cjquery%2Cmoment%2Coojs%2Coojs-ui-core%2Coojs-ui-toolbars%2Coojs-ui-widgets%2Coojs-ui-windows%2Csite%7Cjquery.client%2Ccookie%2ClengthLimit%2CmakeCollapsible%2CtextSelection%7Cjquery.makeCollapsible.styles%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2Cicon%2CjqueryMsg%2Clanguage%2Cstorage%2Cuser%2Cutil%2Cwidgets%7Cmediawiki.ForeignApi.core%7Cmediawiki.action.edit%7Cmediawiki.action.edit.collapsibleFooter%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.page.watch.ajax%7Cmediawiki.ui.button%7Cmediawiki.widgets.DateInputWidget%2CUserInputWidget%2CvisibleLengthLimit%7Cmediawiki.widgets.DateInputWidget.styles%7Coojs-ui-toolbars.icons%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.icons-content%2Cicons-interactions%2Cicons-movement%7Cskins.vector.legacy.js%7Cuser.defaults&skin=vector&version=ninfb
Nikerabbit triaged this task as Medium priority.Sep 28 2020, 2:57 PM

This is a frequent error. Fixing it seems simple.

This error is now the #7 most frequent.

Change 657050 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/UniversalLanguageSelector@master] Handle corrupted values in input preferences

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

Change 657050 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] Handle corrupted values in input preferences

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

Jpita added a subscriber: Jpita.

@Nikerabbit can you find this error in logstash?
I searched for "getIMELanguageList" and couldn't find any error in the last week

You can use this dashboard to track errors in language engineering products:
https://logstash.wikimedia.org/goto/3473af6723105453182f2bd096b4168c

thanks @Jdlrobson , I was looking for the wrong string

The error is still present today. Strangely it seems to occur a lot of no.wikipedia.org (as do a lot of other ULS errors) when the nb language is set.
Is there something special about that wiki / language ?

As far as I can see this is still not yet deployed.

Not sure if there is something wrong with Logstash, but I can't find any signs of this error even if I search for past 3-4 weeks.

Looks like whatever it was causing it stopped on 16th:


https://logstash.wikimedia.org/goto/01c51554b6c54c697579cea8f3994bdb

Thanks all!