TypeError: Cannot read property 'substring' of undefined - RESTART!
We have a very active set of pads, with several hundred users on them. Unfortunately, something is causing etherpad to restart on a regular basis, this is the log of when it does:
[2015-11-17 07:27:54.247] [WARN] client - Uncaught TypeError: Cannot read property 'data' of undefined -- { errorId: 'ZdIdZ8nXVLQTE9tVbPgb',
msg: 'Uncaught TypeError: Cannot read property \'data\' of undefined',
url: '[REDACTED]',
linenumber: 3902,
userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36' }
[2015-11-17 07:28:13.168] [WARN] client - TypeError: undefined is not an object (evaluating 'rowsPresent[index].data') -- { errorId: '7FGxdP5milNbRykoStKV',
msg: 'TypeError: undefined is not an object (evaluating \'rowsPresent[index].data\')',
url: '[REDACTED]',
linenumber: 3902,
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7' }
[2015-11-17 07:28:45.256] [WARN] client - SyntaxError: expected expression, got ')' -- { errorId: 'X45Sz4e8TZIuMmRRkoCA',
msg: 'SyntaxError: expected expression, got \')\'',
url: '[REDACTED]',
linenumber: 1,
userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0' }
[2015-11-17 07:28:46.691] [WARN] client - Uncaught Error: Failed assertion: mismatched apply: 6831 / 6841 -- { errorId: 'I07sb37FnB4hqN8MEU8S',
msg: 'Uncaught Error: Failed assertion: mismatched apply: 6831 / 6841',
url: '[REDACTED]',
linenumber: 492,
userAgent: 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36' }
[2015-11-17 07:28:46.779] [WARN] client - Error: Failed assertion: mismatched apply: 6831 / 6840 -- { errorId: 'mpoHFiJQyUqHJG6BmXc1',
msg: 'Error: Failed assertion: mismatched apply: 6831 / 6840',
url: '[REDACTED]',
linenumber: 5871,
userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0' }
[2015-11-17 07:28:56.631] [ERROR] console - TypeError: Cannot read property 'substring' of undefined
at Object.insert (/srv/etherpad-lite/src/static/js/Changeset.js:794:44)
at Object.exports.mutateTextLines (/srv/etherpad-lite/src/static/js/Changeset.js:966:11)
at /srv/etherpad-lite/src/node/handler/PadMessageHandler.js:1511:19
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:610:21
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:249:17
at iterate (/srv/etherpad-lite/src/node_modules/async/lib/async.js:149:13)
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:160:25
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:251:21
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:615:34
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:254:17
RESTART!
which commit are you using? can you cherry pick https://github.com/ether/etherpad-lite/pull/2801
83597562c1dd8f9d284cc68a8a94b63cdac039a1
I tried to cherry-pick 1ee1f818dbe29e09a4733d0248663e52451e90dc to start, but got a conflict that I was not sure how to resolve. I suspect your version is based off of a different place than the 1.5.7 release?
try cherry-picking 31f7c7e0f2e31b9a0573382481841215f4f01dc8 before 1ee1f818dbe29e09a4733d0248663e52451e90dc
thanks, cherry-picked both of those and restarted the server, will report back
Just got another restart:
[2015-11-17 09:51:37.247] [ERROR] console - TypeError: Cannot read property 'substring' of undefined
at Object.insert (/srv/etherpad-lite/src/static/js/Changeset.js:794:44)
at Object.exports.mutateTextLines (/srv/etherpad-lite/src/static/js/Changeset.js:966:11)
at /srv/etherpad-lite/src/node/handler/PadMessageHandler.js:1517:19
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:610:21
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:249:17
at iterate (/srv/etherpad-lite/src/node_modules/async/lib/async.js:149:13)
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:160:25
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:251:21
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:615:34
at /srv/etherpad-lite/src/node_modules/async/lib/async.js:254:17
RESTART!
ok I try to find the bug. as a workaround you can filter GET requests to /p//timeslider (which will block accessing timeslider and clients from accidently triggering the bug) or insert "return" right at the beginning of handleChangesetRequest in PadMessageHandler.js
Do you mean in the function, like this:
function handleChangesetRequest(client, message)
{
+ return;
//check if all ok
if(message.data == null)
{
messageLogger.warn("Dropped message, changeset request has no data!");
return;
}
Because I tried that and the timeslider is still working.
yep, it's loading timeslider's html but you won't be able to issue requests to the timeslider (which contain the actual revisions) - at least it should work like this imo :)
*bump
I can reproduce the bug now but the test data is huge and the area it occurs is not documented. investigating now, but not sure I'll find it today...
I have got the same problem over here: [2016-01-11 13:17:46.347] [ERROR] console - TypeError: Cannot call method 'substring' of undefined at Object.insert (/usr/share/etherpad-lite/src/static/js/Changeset.js:794:45) at Object.exports.mutateTextLines (/usr/share/etherpad-lite/src/static/js/Changeset.js:966:11) at async.series.callback.forwardsChangesets (/usr/share/etherpad-lite/src/node/handler/PadMessageHandler.js:1540:19) at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:610:21 at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:249:17 at iterate (/usr/share/etherpad-lite/src/node_modules/async/lib/async.js:149:13) at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:160:25 at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:251:21 at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:615:34 at /usr/share/etherpad-lite/src/node_modules/async/lib/async.js:254:17
I was able to reproduce the problem on a different server by exporting and importing the affected etherpad. Unfortunately I cannot publish the file as it contains data of our customers.
I was able to remove all custom text from the etherpad while preserving the error.
Steps to reproduce:
- Download and unzip attached file.
- Create new pad.
- Import etherpad file.
- Open history.
- Jump back some time.
- Etherpad crashes.
Just wanted to add some additional missing information here... we were also getting restarts/crashes when the export was done. Not always, but probably with certain pads with characters/character sets that were not filtered properly. This was causing us such a problem that we had to disable pad exports... but this is something people need so we would like to be able to re-enable it!
sorry for the delay... for the issue described here I opened a pull request at https://github.com/ether/etherpad-lite/pull/2911
RE your export issues please pull from https://github.com/ether/etherpad-lite/tree/fix-export-regressions. It is not ready to be merged in but it should be enough to stop the crashes. It would be awesome if you could try it and if nothing happens grep for "Could not process export request" and send me any warnings you got.
@webzwo0i - great! I'd love to give them a try, but I'm currently running the latest release (1.5.7), and not the tip of master. Unfortunately, I dont want to move the code to master on the live instance. I tried to cherry-pick the commits onto that release, but it wouldn't apply. Are those commits easy to rebase onto that release?
I prepared a patch file for the export fixes at https://gist.github.com/webzwo0i/99c57a5482a0f28eb3e6 You should be able to apply it on 1.5.7 with
git clone https://gist.github.com/webzwo0i/99c57a5482a0f28eb3e6
patch -p1 < 99c57a5482a0f28eb3e6/export-fixes.patch
rm -rf 99c57a5482a0f28eb3e6
the other fix is not ready to apply, I discovered more issues, but I am working on this and will report back soon
Thanks @webzwo0i ! I've applied the export fixes patch as described, and am running it now, so far so good... but I'll need to wait a little bit to see if the original issue comes back.
Since applying that patch from @webzwo0i we haven't experienced that issue!
Well... I spoke too soon. I had a webserver config line that just denied exports.