Page MenuHomePhabricator

TypeError: Cannot read property 'type' of undefined (from event dispatch)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • mwversion: 1
  • meta.request_id: e2abfbe8-9f69-4464-a882-23246a3a949f
normalized_message
TypeError: Cannot read property 'type' of undefined
exception.trace
at Object.jQuery.event.fix  URL1:312:258
at dispatch  URL1:226:425
at elemData.handle  URL1:223:848

URL1: https://es.wikipedia.org/w/load.php?lang=es&modules=ext.centralNotice.choiceData%2Cdisplay%2CgeoIP%2CimpressionDiet%2CkvStore%2CstartUp%7Cext.centralauth.centralautologin%7Cext.cite.ux-enhancements%7Cext.cx.eventlogging.campaigns%7Cext.eventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.growthExperiments.SuggestedEditSession%7Cext.quicksurveys.init%2Clib%7Cext.scribunto.logs%7Cext.uls.common%2Ccompactlinks%2Cinterface%2Cpreferences%2Cwebfonts%7Cjquery%2Coojs%2Coojs-router%2Csite%7Cjquery.client%2Ccookie%2Cspinner%2CtextSelection%7Cjquery.spinner.styles%7Cjquery.uls.data%7Cmediawiki.String%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2Ccookie%2Cexperiments%2CjqueryMsg%2Clanguage%2Cstorage%2Ctoc%2Cuser%2Cutil%2CvisibleTimeout%7Cmediawiki.editfont.styles%7Cmediawiki.libs.pluralruleparser%7Cmediawiki.page.ready%7Cmediawiki.ui.button%2Cicon%7Cmmv.bootstrap%2Chead%7Cmmv.bootstrap.autostart%7Cskins.vector.legacy.js%7Cuser.defaults&skin=vector&version=1ksgu
Impact

~150 in last 12 hours

Notes

Urls include:

Event Timeline

Krinkle updated the task description. (Show Details)
Krinkle subscribed.

https://logstash.wikimedia.org/app/dashboards#/view/Reading-Web?_g=h@7689555&_a=h@4866ec0

For me this navigates to the default/unaltered view of the Reading-Web dashboard, with an error message about an unknown temporary session that isn't present in my browser. This share a link with someone to a Logstash entry, expand one of the entries in the list below and copy the View single document link. Or, to share a link to the dashboard with the same altered query and result list you see (e.g. after narrowing down to one specific error message), share a link to that using the SharePermalinksShort URL feature.

Tags: Wikimedia-production-error

Remember to add at least one pink team tag (and a blue core/extension component, if possible) as otherwise this task might linger untriaged. It's okay to make your best guess for where the triage/investigation could start. Assuming we don't intentionally burden any one team in particular, every will do their best with the tasks they get, and, if needed, forward it elsewhere with ideally a bit more information added (or ruled out) as it gets along.

If nothing in the error message, trace function names, and browser URLs look common and familiar among the different entries for the same error message; then a fallback for the starting point could be to co-tag Unstewarded-production-error. It seems this might be one of those indeed as the stack trace is very short with nothing but the browser emitting a user input event, and then internal event handling code crashing right away. This is going to be a fun one.

Urls include: https://es.wikipedia.org/w/load.php?lang=es&modules=jquery […]

I'd recommend looking for URLs in the url field (lower down in the Logstash row) rather than this one from the file_url (which is neatly at the top, but...). Due to how we load our code, this will almost always be either a generic url indicating that the stack trace started in "startup" (script loaded) or "jquery" (browser event), or a very long url with many module names. I think we should actually consider removing this field from the client error schema as I don't recall it ever being useful (and in the rare event it is useful, we still have it within the stack trace, where it makes more sense in context). I've added a few page view URLs instead.

Krinkle renamed this task from TypeError: Cannot read property 'type' of undefined to TypeError: Cannot read property 'type' of undefined (from event dispatch).Aug 24 2021, 10:24 PM

When I query message:"TypeError: Cannot read property 'type' of undefined" AND stack_trace:"jQuery.event.fix" on the mediawiki-client-errors dashboard, we get about 200 of these consistently during any 24 hour period. It's certainly not much by any measure (given our scale and no sampling). But it happens consistently enough, and in a wide range of circumstances that it seems worth looking into.

  • Wikis: en.wikipedia, es.wikipedia, hu.wikipedia, zh.wikipedia, and others. Doesn't seem particularly unlike regular traffic distribution, although zhwiki seems more prominent than one would expect. Might be something specific to something that is common there and less common on other wikis.
  • URLs: edit form, article page views, mediaviewer. Seems all over the place.
  • Browsers: Only Chrome 91 and Chrome 92, mostly on Windows but for two samples from Chrome on Linux.

Thanks @Krinkle for your suggestions - duly noted and I will try to log better tickets in the future

The exception trace refers to jQuery.event.fix, which contains an access to a type property without extra check - https://github.com/jquery/jquery-migrate/blob/c81c190abf54690eb63a1adf68cc6d388b23d420/src/jquery/event.js#L15

But that should be fine for Chrome and all other browsers - https://developer.mozilla.org/en-US/docs/Web/API/Event/type

No such errors in Logstash anymore since 2021-09-22, I assume this ticket can be closed?

Krinkle claimed this task.