Page MenuHomePhabricator

Cannot read property 'insertBefore' of null
Closed, ResolvedPublic

Description

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

trwiki/Batman'da_spor

TypeError: Cannot read property 'insertBefore' of null
    at Object.prependTypedMeta (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/utils/DOMUtils.js:1422:18)
    at Object.addDiffMark (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/utils/DOMUtils.js:1110:7)
    at Normalizer.addDiffMarks (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:41:6)
    at Normalizer.merge (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:124:8)
    at Normalizer.normalizeSiblingPair (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:520:13)
    at Normalizer.processSubtree (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:567:13)
    at Normalizer.processNode (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:601:9)
    at Normalizer.processSubtree (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:561:12)
    at Normalizer.processNode (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:601:9)
    at Normalizer.processSubtree (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:561:12)
    at Normalizer.processNode (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:601:9)
    at Normalizer.processSubtree (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:561:12)
    at Normalizer.processNode (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:601:9)
    at Normalizer.processSubtree (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:561:12)
    at Normalizer.processNode (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:601:9)
    at Normalizer.normalizeDOM (/srv/deployment/parsoid/deploy-cache/revs/d8d7b424aa0f8fc5028099168e3646c2f131212e/src/lib/html2wt/normalizeDOM.js:622:14)

Event Timeline

Arlolra triaged this task as High priority.

This crasher looks like the result of https://github.com/wikimedia/parsoid/commit/58d49a8588b7831af0e3385315f01c72a60b5936

When the sentinel itself is normalized away (it being a text node and as a result of the call to a.normalize()) it is left dangling and eventually throws while trying to addDiffMarks around it.

This crasher looks like the result of https://github.com/wikimedia/parsoid/commit/58d49a8588b7831af0e3385315f01c72a60b5936

When the sentinel itself is normalized away (it being a text node and as a result of the call to a.normalize()) it is left dangling and eventually throws while trying to addDiffMarks around it.

Good catch! You are right. Let us just revert that patch for now and revisit how to redo that functionality.

Change 432624 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] Fix for Cannot read property 'insertBefore' of null

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

Change 432624 merged by jenkins-bot:
[mediawiki/services/parsoid@master] TRY #2: normalizeDOM: normalize a node after it is merged with a sibling

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

Vvjjkkii renamed this task from Cannot read property 'insertBefore' of null to 5fdaaaaaaa.Jul 1 2018, 1:11 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Sbailey as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii edited subscribers, added: Sbailey; removed: gerritbot, Aklapper.
CommunityTechBot renamed this task from 5fdaaaaaaa to Cannot read property 'insertBefore' of null.Jul 2 2018, 1:54 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Sbailey.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot edited subscribers, added: gerritbot, Aklapper; removed: Sbailey.