Page MenuHomePhabricator

TypeError: Cannot read properties of undefined (reading 'length')
Closed, InvalidPublicPRODUCTION ERROR

Description

Error
normalized_message
TypeError: Cannot read properties of undefined (reading 'length')
exception.trace
at HTMLDocument.<anonymous>  <anonymous>:311:4017
at mightThrow  https://it.wikipedia.org/w/load.php?lang=it&modules=jquery%2Coojs-ui-core%7Cjquery.ui&skin=vector&version=1tfq5:49:833
at process  https://it.wikipedia.org/w/load.php?lang=it&modules=jquery%2Coojs-ui-core%7Cjquery.ui&skin=vector&version=1tfq5:50:498
Impact

25 in last 12 hours

https://logstash.wikimedia.org/goto/dd7df7c2010be9dcc3a55037a2b29356

188 in last 30 days

https://logstash.wikimedia.org/goto/81e773cb8c1d8b8c3156ce469d4a5913

Notes

T296614 might be related?

Event Timeline

Jdlrobson subscribed.

The stack traces are not very useful here, but the majority are coming from a Chinese Wikipedia gadget, https://vi.wikipedia.org/wiki/MediaWiki:Gadget-markblocked.js, https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&, https://en.wikipedia.org/w/index.php?title=User:Awesome_Aasim/usergroups.js&action=raw*, and a Object.window.mirokado.loadit script.

https://logstash.wikimedia.org/goto/6793aec99a728cabe64aff4a1230b8bd

The ones that remain are only occurring on Special:Book, Special:Contributions and Special:ContentTranslation. Untagging our backlog as we don't maintain any of these pages.

The ContentTranslation stack trace is a little more useful:

at VeDmCXTransclusionBlockNode.ve.dm.MWTransclusionNode.getPartsList  URL1:171:354
at VeDmCXTransclusionBlockNode.ve.dm.MWTransclusionNode.isSingleTemplate  URL1:170:703
at VeUiCXTransclusionContextItem.VeUiMWTransclusionContextItem  URL1:274:391
at VeUiCXTransclusionContextItem  URL2:552:551
at VeUiContextItemFactory.OO.Factory.create  <anonymous>:426:592
at VeUiCXDesktopContext.ve.ui.Context.setupMenuItems  URL3:622:919
at VeUiCXDesktopContext.ve.ui.Context.toggleMenu  URL3:622:628
at VeUiCXDesktopContext.ve.ui.LinearContext.afterContextChange  URL3:625:765
at VeUiCXDesktopContext.ve.ui.DesktopContext.afterContextChange  URL3:1186:385
at VeUiCXDesktopContext.ve.ui.CXDesktopContext.afterContextChange  URL4:807:116
tags
	input-kafka-clienterror-codfw, kafka, es, es, throttle-exempt, normalized_message_untrimmed

URL1: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.visualEditor.desktopTarget%2Cicons%2Clanguage%2Cmwalienextension%2Cmwextensions%2Cmwformatting%2Cmwgallery%2Cmwimage%2Cmwlanguage%2Cmwtransclusion%7Cext.visualEditor.mwextensions.desktop%7Cext.visualEditor.mwimage.core&skin=contenttranslation&version=dpp86
URL2: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.CodeMirror.visualEditor%7Cext.CodeMirror.visualEditor.init%7Cext.TemplateSandbox.visualeditor%7Cext.abuseFilter.visualEditor%7Cext.cite.styles%2CvisualEditor%7Cext.cite.visualEditor.core%7Cext.citoid.visualEditor%7Cext.citoid.visualEditor.data%7Cext.confirmEdit.CaptchaInputWidget%2CvisualEditor%7Cext.disambiguator.visualEditor%7Cext.geshi.visualEditor%7Cext.graph.data%2CvisualEditor%7Cext.kartographer%7Cext.kartographer.editing%2Cutil%2CvisualEditor%7Cext.math.styles%2CvisualEditor%7Cext.score.visualEditor%7Cext.score.visualEditor.icons%7Cext.spamBlacklist.visualEditor%7Cext.templateDataGenerator.editPage%7Cext.titleblacklist.visualEditor%7Cext.visualEditor.data%2CmoduleIcons%2CmoduleIndicators%7Cext.wikihiero.visualEditor%7Cext.wikimediaEvents.visualEditor%7Cmediawiki.ForeignStructuredUpload%2CForeignUpload%2CUpload%7Cmediawiki.ForeignStructuredUpload.BookletLayout%7Cmediawiki.Upload.BookletLayout%7Cmediawiki.language.names%7Cmediawiki.libs.jpegmeta%7Cmediawiki.page.gallery.styles%7Cmediawiki.widgets.CategoryMultiselectWidget%2CDateInputWidget%2CMediaSearch%2CTable%2CUserInputWidget%7Cmediawiki.widgets.DateInputWidget.styles%7Cmoment%7Cmw.cx.visualEditor%7Coojs-ui.styles.icons-editing-citation%2Cicons-editing-list%2Cicons-editing-styling%2Cicons-layout%2Cicons-location%2Cicons-movement%2Cicons-user%2Cicons-wikimedia&skin=contenttranslation&version=1m4ni
URL3: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.visualEditor.base%2Ccore%2Cdiffing%2Cmediawiki%2Cmwcore%2Cmwlink%2Cmwmeta%2Csanitize%2Cswitching%2Cwelcome%7Cext.visualEditor.core.desktop%2Cutils&skin=contenttranslation&version=1ktcx
URL4: https://es.wikipedia.org/w/load.php?lang=es&modules=diffMatchPatch%2Cdompurify%2Cjquery%2Coojs-ui-core%2Coojs-ui-widgets%2Cpapaparse%2Crangefix%2Cspark-md5%2CtreeDiffer%2Cunicodejs%7Cext.cx.wikibase.link%7Cmediawiki.action.view.redirectPage%7Cmediawiki.deflate%2Cpulsatingdot%7Cmediawiki.interface.helpers.styles%7Cmediawiki.skinning.content.parsoid%7Cmw.cx.dm%2Cinit%7Cmw.cx.dm.Translation%7Cmw.cx.tools.TranslationTool%7Coojs-ui.styles.icons-accessibility%2Cicons-editing-advanced%7Cve.ce.CXLintableNode%7Cve.dm.CXLintableNode%7Cve.init.mw.CXTarget&skin=contenttranslation&version=1izx9

Marking as low, as number of errors is < 100.

Krinkle removed a project: ContentTranslation.
Krinkle subscribed.

This task seems to be about the ones coming from the zhwiki gadget, since the reported trace is about eval'ed user scripts running on special pages that are not related to CX.

The CX trace is not related, other than that it too contains code where the word "length" appears somewhere in an undefined property. e.g. fooArray.length. Arrays are common in JavaScript. We generally don't use the same task for different instances of the same programmer mistake in multiple/unrelated code bases.

The CX issue is tracked at T296614 already. For issues with gadgets, and more generally issues with low incidence rate, it is probably not worth keeping a task open for as it isn't actionable and has no teams associated with it.