client.get -> TypeError: Cannot read property 'length' of undefined #26

fatum opened this Issue Jun 23, 2010 · 9 comments


None yet
7 participants

fatum commented Jun 23, 2010

If i execute some code:
var client = require("./redis-node-client/lib/redis-client").createClient();
client.set('test', 'data');

when gets error like :
var callback = originalCommand[originalCommand.length - 1];
TypeError: Cannot read property 'length' of undefined

redis-node-client version 1.3.5
redis version 1.2.6
node.js version 0.1.97
Sorry for my bad english, i'm from russia)

The sample code you have works ok for me, no issues.

sneeu commented Jul 13, 2010

I'm getting this same error with Redis 0.900 on Ubuntu 9.10, but not with Redis 1.2.0 on Ubuntu 10.04.

I'm using the latest version of node.js, and redis-node-client.

With debug on, the following output is given:

node-router server instance at
DEBUG: [SEND] *2<CRLF>$4<CRLF>incr<CRLF>$19<CRLF>buffer:offset<CRLF> originalCommands = 1
DEBUG: [RECV] -ERR unknown command<CRLF>-ERR unknown command<CRLF>-ERR wrong number of arguments<CRLF>-ERR unknown command<CRLF>-ERR unknown command<CRLF>
DEBUG: [SEND] *3<CRLF>$5<CRLF>lpush<CRLF>$12<CRLF>buffer<CRLF>$200<CRLF>{"offset":null,"value":"value"}<CRLF> originalCommands = 1
DEBUG: [SEND] *3<CRLF>$5<CRLF>ltrim<CRLF>$1<CRLF>0<CRLF>$2<CRLF>30<CRLF> originalCommands = 1

    var callback = originalCommand[originalCommand.length - 1];
TypeError: Cannot read property 'length' of undefined
    at Client.onReply_ (/var/www/my_project/vendor/redis-client.js:394:51)
    at /var/www/my_project/vendor/redis-client.js:143:30
    at ReplyParser.feed (/var/www/my_project/vendor/redis-client.js:160:55)
    at Stream.<anonymous> (/var/www/my_project/vendor/redis-client.js:337:28)
    at Stream.emit (events:25:26)
    at IOWatcher.callback (net:512:16)
    at node.js:266:9

sneeu commented Jul 15, 2010

Upgrading Redis to 1.3.12 fixed this issue for me. I assume slightly earlier versions would fix it too.

scsibug commented Nov 22, 2010

I had this problem with node 0.2.5 and redis 2.0.3. leepa has fixes for node 0.2.4+ here:

nym commented Feb 6, 2011

I'm getting the same problem with Node v0.2.6, Redis 2.0.2, and redis-node-client 0.3.5. Publisher.js seems to work as expected.

same issue on redis 2.2.1 with redis-client@0.3.5 and node@v0.4.1

tomaj commented Mar 21, 2011

same issue on redis 2.1.12 with redis-client@0.3.5 and node@0.4.3

I switched to this: a long time ago. It gets updated pretty often and I've been using it production and it's been working great.

tomaj commented Mar 21, 2011

thanks, its looks pretty good and its working

@fatum fatum closed this Oct 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment