Page MenuHomePhabricator

Apply translation does not work: Cannot read properties of undefined (reading 'getTitleForLanguage')
Closed, ResolvedPublic4 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
Translation does not load

image.png (1,511×888 px, 286 KB)

What should have happened instead?:
Translation should have been loaded and applied.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
Noticed on Logstash:

Cannot read properties of undefined (reading 'getTitleForLanguage')
at https://it.wikipedia.org/w/load.php?lang=it&modules=ext.centralNotice.geoIP%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.checkUser.clientHints%7Cext.cx.articlefilters%2Cmodel%7Cext.cx.eventlogging.campaigns%7Cext.dismissableSiteNotice%2CeventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%2CxLab%7Cext.echo.api%2Cinit%7Cext.eventLogging.metricsPlatform%7Cext.growthExperiments.HelpPanel.init%7Cext.growthExperiments.SuggestedEditSession%7Cext.uls.common%2Ccompactlinks%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.urlShortener.toolbar%7Cext.wikimediaEvents.xLab%7Cjquery%2Coojs%2Csite%2Cvue%2Cvuex%7Cjquery.client%2CtextSelection%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CString%2CTitle%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Cstorage%2Cuser%2Cutil%2CvisibleTimeout%7Cmediawiki.ForeignApi.core%7Cmediawiki.editfont.styles%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmw.cx.SiteMapper%2Ceventlogging%2Cutil%7Cmw.cx3&skin=contenttranslation&version=1nq9x:841:596

Source: https://logstash.wikimedia.org/app/discover#/doc/logstash-*/logstash-default-1-7.0.0-1-2025.11.18?id=8HcmlpoB9tkJMVA5owSw

  • 28 November, 2025 - 264 occurences in the last 10 days - 2nd most frequent error.

Event Timeline

abi_ triaged this task as Medium priority.Nov 18 2025, 8:57 AM
abi_ moved this task from Backlog to Ready for dev on the LPL Essential (FY2025-26 Q2) board.
abi_ set the point value for this task to 2.
Wangombe changed the task status from Open to In Progress.Nov 25 2025, 9:11 AM
Wangombe claimed this task.

Is it possible to provide more information about this bug? I tried replicating this with Google and MinT. None produced the results in the ticket description.

Is it possible to provide more information about this bug? I tried replicating this with Google and MinT. None produced the results in the ticket description.

Figuring out the cause is part of the task. This needs debugging. Looking for clues in Logstash, reading the code and generating hypothesis how it may fail, possibly adding more logging to learn more, etc.

Change #1228492 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] CX: Add a null check to getTitleForLanguage

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

The error still occurs (121 occurrences last week).

The root cause of the issue is that the language links for the currently selected article could not be fetched/stored successfully. Adding null checks to the current point of failure, will just close this task and open a new one.

My suggestion is that we need to improve the error handling for the failed API requests, especially for data that are crucial for the application. Until then, we can keep this task open and maybe lower its priority for now.

Change #1276442 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] fetchLanguageTitles API: reject promise on fetch failure

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

Change #1276443 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] Disable article language selector if no language-title group

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

Change #1276445 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] useSuggestionLoad: Throw error if no page stored after metadata fetching

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

Change #1276442 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] fetchLanguageTitles API: reject promise on fetch failure

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

Change #1276445 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] useSuggestionLoad: Throw error if no page stored after metadata fetching

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

Change #1276443 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] Disable article language selector if no language-title group

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

Change #1228492 abandoned by Nikerabbit:

[mediawiki/extensions/ContentTranslation@master] CX: Add logging for language links fetching/storage.

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

I do not see change in error frequency after these patches:

image.png (1,911×968 px, 125 KB)

Changes are not in effect yet, because there hasn't been a CX build.

Change #1286377 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20260512

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

Change #1286377 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 1.0.0+20260512

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

There is already one event in wmf.3 https://logstash.wikimedia.org/app/discover#/doc/logstash-*/logstash-default-1-7.0.0-1-2026.05.21?id=UHHiSZ4Br2RT0BE3ypIc which indicates this is not fully fixed. Can check next week is there is any change in volume to indicate there is another cause.