Page MenuHomePhabricator

TypeError: undefined is not an object (evaluating 'src[src.length-1].res')
Closed, ResolvedPublicPRODUCTION ERROR

Description

at chooseSrc https://en.m.wikipedia.org/w/load.php:16:547
at updateSrc https://en.m.wikipedia.org/w/load.php:14:10
at https://en.m.wikipedia.org/w/load.php:13:686
at https://en.m.wikipedia.org/w/load.php:47:127
at https://en.m.wikipedia.org/w/load.php:47:108
at https://en.m.wikipedia.org/w/load.php:49:787

Observed on https://en.m.wikipedia.org/wiki/Otto_engine iCloud Private Relay Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Mobile/15E148 Safari/604.1

Error was introduced 29th June 2023.
290 errors in last 7 days
https://logstash.wikimedia.org/goto/f48288f69204a0324fcc1031e476cf5c

Event Timeline

Looks like a failure that can happen sometimes if no sources are compatible, which appears to be mostly happening on Safari and other WebKit browsers, judging by the user-agents. This should be improved by the patch for T312152 which is still in CR, which cleans up a bunch of config and adds iOS-friendly video output, but it does sound like there's a straight up bug somewhere in that it should either not assume that array is not empty or ensure it isn't. :D

I haven’t investigated, but we didn’t make any recent changes. Safari update perhaps ?

Still occurring
Appears with stack trace: (*at VideoJsResolutionSwitcherPlugin.chooseSrc*)

Change #1145254 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/TimedMediaHandler@master] Defensively check JS objects in chooseSrc to avoid JS errors

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

Restricted Application changed the subtype of this task from "Bug Report" to "Production Error". · View Herald TranscriptMay 13 2025, 4:08 PM

Change #1145254 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Defensively check JS objects in chooseSrc to avoid JS errors

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

Jdlrobson-WMF subscribed.

Last error was 22nd May 2025 so this looks fixed to me!