Page MenuHomePhabricator

Uncaught TypeError: Cannot read property 'toLowerCase' of null
Closed, ResolvedPublic

Description

Error counts between 2016-05-18 20:33:39 and 2016-05-24 17:15:38, for this and similar error messages:

51 Uncaught TypeError: Cannot read property 'toLowerCase' of null
13 Unable to get property 'toLowerCase' of undefined or null reference
 6 TypeError: null is not an object (evaluating 'extension.toLowerCase')
 1 No se puede obtener la propiedad 'toLowerCase' de referencia nula o sin definir

Event Timeline

matmarex created this task.May 25 2016, 7:42 PM

UW has 'extension.toLowerCase' in only two places, and in both we definitely correctly check for null. There is an 'extension.toLowerCase' also in mw.Title.normalizeExtension. We use that in a few places, but they all should be at points where only files with valid extensions can appear.

Huh… apparently Commons has some redirects in the File namespace without an extension, for example https://commons.wikimedia.org/w/index.php?title=File:2010-02-19_16500x2000_chicago&redirect=no or https://commons.wikimedia.org/w/index.php?title=File:Antigua_escuela_de_Tresgrandas&redirect=no. When they pop up in the API result in DestinationChecker, this exception happens.

Change 292336 had a related patch set uploaded (by Bartosz Dziewoński):
mw.DestinationChecker: Avoid exception when a file page without extension is returned

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

matmarex claimed this task.Jun 2 2016, 11:21 AM
matmarex triaged this task as Normal priority.

Change 292336 merged by jenkins-bot:
mw.DestinationChecker: Avoid exception when a file page without extension is returned

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

matmarex closed this task as Resolved.Jun 3 2016, 4:52 PM
matmarex removed a project: Patch-For-Review.

I think that was the only source of these. We'll find out for certain next week when it's deployed.

matmarex reopened this task as Open.Jun 30 2016, 11:33 PM

Nah…

matmarex added a comment.EditedJun 30 2016, 11:48 PM

Last 10 days:

76	Uncaught TypeError: Cannot read property 'toLowerCase' of null
23	TypeError: extension is null

Change 297120 had a related patch set uploaded (by Bartosz Dziewoński):
Set 'group' => 'ext.uploadWizard' for all our modules

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

Change 297120 merged by jenkins-bot:
Set 'group' => 'ext.uploadWizard' for all our modules

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

matmarex closed this task as Resolved.Jul 19 2016, 6:04 PM

None of the remaining results are logged with event_url like '%ext.uploadWizard%', and I already went through UploadWizard with a fine comb twice, so I am confident these are not coming from our code.