Page MenuHomePhabricator

Cannot read property 'docId' of undefined
Closed, ResolvedPublic

Description

Deployed was reverted due to these beauties.

https://logstash.wikimedia.org/app/kibana#/doc/logstash-*/logstash-2019.02.25/parsoid?id=AWkmgNN_1DNFq-AXi5N7&_g=h@44136fa

TypeError: Cannot read property 'docId' of undefined
    at Function.setNodeData (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMDataUtils.js:48:27)
    at Function.getNodeData (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMDataUtils.js:37:9)
    at Function.getDataParsoid (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMDataUtils.js:55:19)
    at ConversionTraverser.DOMTraverser.traverse (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMTraverser.js:122:24)
    at ConversionTraverser.DOMTraverser.traverse (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMTraverser.js:140:10)
    at ConversionTraverser.DOMTraverser.traverse (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMTraverser.js:140:10)
    at ConversionTraverser.DOMTraverser.traverse (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/utils/DOMTraverser.js:140:10)
    at Function.baseToVariant (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/language/LanguageConverter.js:457:5)
    at Function.maybeConvert (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/language/LanguageConverter.js:405:8)
    at Object.apiUtils.languageConversion (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/api/apiUtils.js:601:21)
    at /srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/src/lib/api/routes.js:636:21
    at next (native)
    at tryCatchNext (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/node_modules/prfun/lib/index.js:783:28)
    at continuer (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/node_modules/prfun/lib/index.js:800:24)
    at callback (/srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/node_modules/prfun/lib/index.js:812:43)
    at /srv/deployment/parsoid/deploy-cache/revs/cb62482a8f25931b86757b3ff26f8e9565f4005d/node_modules/prfun/lib/index.js:814:9

Event Timeline

So, our pre-deploy testing has a hole for lang variants since rt testing doesn't cover this feature. Presumably, this would have been caught on beta cluster but that is currently readonly. In any case, @cscott, this is a testing gap currently.

Change 492776 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Use env.createDocument in lib/api/apiUtils.js

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

In any case, @cscott, this is a testing gap currently.

Lots of tests mocha were introduced in,
https://github.com/wikimedia/parsoid/commit/4f298233cc95b823c34d605a08f109cf5b1a4157

but it looks like this only would have been caught if the DOMTraverser was given something with encapsulation,
https://github.com/wikimedia/parsoid/blob/master/lib/utils/DOMTraverser.js#L122

Change 492776 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Use env.createDocument in lib/api/apiUtils.js

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

In any case, @cscott, this is a testing gap currently.

Lots of tests mocha were introduced in,
https://github.com/wikimedia/parsoid/commit/4f298233cc95b823c34d605a08f109cf5b1a4157

but it looks like this only would have been caught if the DOMTraverser was given something with encapsulation,
https://github.com/wikimedia/parsoid/blob/master/lib/utils/DOMTraverser.js#L122

That is fixable, but I also meant more generally. RT testing exercises our code more thoroughly .. so, we need an equivalent for lang variants that pushes real pages through the endpoints. I think scott did have a plan for that, but postponed for when we consider the lang variant endpoints non-alpha.