Page MenuHomePhabricator

Cannot read property 'substring' of null
Closed, ResolvedPublic


The following error started appearing in RESTBase logs:

Cannot read property 'substring' of null
TypeError: Cannot read property 'substring' of null
    at Object.extractExtBody (/srv/deployment/parsoid/deploy-cache/revs/8a2c0ce70f3b548b806556247962077b9d951791/src/lib/utils/Util.js:1277:13)
    at Object.Util.getArgInfo (/srv/deployment/parsoid/deploy-cache/revs/8a2c0ce70f3b548b806556247962077b9d951791/src/lib/utils/Util.js:1554:25)

Its happening on requests to transform some content. Which exact content is being transformed is unknown.

Event Timeline

Arlolra triaged this task as Medium priority.Nov 2 2017, 5:31 PM

One way to reproduce this is echo "-{</nowiki>bo:g;us:xyz;zh-cn:abc}-" | node bin/parse --domain

But I'm wondering why this is only showing up lately. Was VE recently enable on a wiki supporting LC?

I should look at the RESTBase logs to see where this is showing up, even if we don't know the content.

AFAIK, VE has always been enabled, just not used by default. And I think we're still pulling all the LC wiki content into restbase via changeprop. So it's possible we've got a particular user using VE heavily or particular set of pages which just got created.

According to Logstash it appeared at the beginning of October, and then sporadically appearing towards the middle of the month, only to disappear and reappear in higher volume at the end of the month.

Ok, all those logs are from zh or sr which have LC enabled.

A specific example is http://localhost:8000/ which points to the same place in the tokenizer as the above snipit.

Pushing my fix.

Change 388157 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] [WIP] T179579: Fix nowiki in LC markup tokenizing

Change 388157 merged by jenkins-bot:
[mediawiki/services/parsoid@master] T179579: Fix nowiki in LC markup tokenizing