Error: Must have start <= end
zxfrank opened this issue · 4 comments
Hello I get this error randomly
buffer.js:416 return this.parent.utf8Slice(start, end); ^ Error: Must have start <= end at Buffer.toString (buffer.js:416:26) at convertBufferRange (node_modules/redis-parser/lib/parser.js:80:24) at parseBulkString (node_modules/redis-parser/lib/parser.js:153:10) at parseType (node_modules/redis-parser/lib/parser.js:220:14) at parseArray (node_modules/redis-parser/lib/parser.js:201:20) at parseType (node_modules/redis-parser/lib/parser.js:226:14) at JavascriptRedisParser.execute (node_modules/redis-parser/lib/parser.js:421:20) at Socket.<anonymous> (node_modules/redis/index.js:267:27)
nodejs -v v0.10.37
redis 2.6.3
redis-parser 2.1.1
I don't have any details on the content of the data but the server crashed...
@zxfrank what Redis version do you use and do you use any proxy?
And can you get hands on any of the data? And as you say you get the error randomly: can you reproduce this constantly?
Redis server v=2.8.4 sha=00000000:0 malloc=jemalloc-3.4.1 bits=64 build=a44a05d76f06a5d9
no proxy
The error has not occured since I added some logs... This is on my production cluster so it's hard to debug. It started this afternoon after an update, occured on 2 servers only. This is not of a great help but if someone run in this issue at least we have a starting point
The only way to trigger something like this for me is by sending malformed data to the parser. So if you have the chance to switch to the hiredis parser and check if it's still happening or not and also check if updating Redis helps. The hiredis node parser is actually a bit more error tolerant than the current parser as it allows non spec values to be parsed as valid entries e.g. $-5\r\n
.
We updated to nodejs v6 and the error haven't reappeared
thank you for your time