TypeError: Cannot read property 'length' of null #28

Open
Valid opened this Issue Jun 25, 2010 · 5 comments

Comments

Projects
None yet
4 participants
@Valid

Valid commented Jun 25, 2010

TypeError: Cannot read property 'length' of null
at Client.handlePublishedMessage_ (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:423:42)
at Client.onReply_ (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:390:14)
at /home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:136:34
at ReplyParser.feed (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:198:25)
at Stream. (/home/phazm/.node_libraries/redis-node-client/lib/redis-client.js:337:28)
at Stream.emit (events:25:26)
at IOWatcher.callback (net:369:16)
at node.js:204:9

Using the latest from HEAD for redis, node, and redis-node-client

I'm not actually doing anything with pubsub, so I think there's an errant call somewhere, when it's running the code when it doesn't need to.

@Sembiance

This comment has been minimized.

Show comment
Hide comment
@Sembiance

Sembiance Jul 4, 2010

I'm getting this too.

Here is how you reproduce it:

redis.hmget("AntKey", "any0", "any1", "any2", "any3", function() {} );

That will produce this exception:

                      reply.value[0].value.length == 8 &&
                                          ^
TypeError: Cannot read property 'length' of null
    at Client.handlePublishedMessage_ (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:427:43)
    at Client.onReply_ (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:390:14)
    at /mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:136:34
    at ReplyParser.feed (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:183:29)
    at Stream. (/mnt/compendium/DevLab//lib/redis-node-client/lib/redis-client.js:337:28)
    at Stream.emit (events:25:26)
    at IOWatcher.callback (net:510:16)
    at node.js:228:9

You get a slightly different error if you reduce the number of keys requested down to 3.

If you reduce it to two, it doesn't throw any exceptions.

I'm getting this too.

Here is how you reproduce it:

redis.hmget("AntKey", "any0", "any1", "any2", "any3", function() {} );

That will produce this exception:

                      reply.value[0].value.length == 8 &&
                                          ^
TypeError: Cannot read property 'length' of null
    at Client.handlePublishedMessage_ (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:427:43)
    at Client.onReply_ (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:390:14)
    at /mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:136:34
    at ReplyParser.feed (/mnt/compendium/DevLab/lib/redis-node-client/lib/redis-client.js:183:29)
    at Stream. (/mnt/compendium/DevLab//lib/redis-node-client/lib/redis-client.js:337:28)
    at Stream.emit (events:25:26)
    at IOWatcher.callback (net:510:16)
    at node.js:228:9

You get a slightly different error if you reduce the number of keys requested down to 3.

If you reduce it to two, it doesn't throw any exceptions.

@Sembiance

This comment has been minimized.

Show comment
Hide comment
@Sembiance

Sembiance Jul 4, 2010

I made a patch, you can find it here:
http://www.telparia.com/redis-client.js.patch

Seems to work, but I don't have enough understanding of the code to know whether or not this causes more issues.

I made a patch, you can find it here:
http://www.telparia.com/redis-client.js.patch

Seems to work, but I don't have enough understanding of the code to know whether or not this causes more issues.

@MiketoString

This comment has been minimized.

Show comment
Hide comment
@MiketoString

MiketoString Sep 23, 2010

Seeing the same issue, patched seemed to fix it for me as well. Getting error on a "smembers" call.

Seeing the same issue, patched seemed to fix it for me as well. Getting error on a "smembers" call.

@lacker

This comment has been minimized.

Show comment
Hide comment
@lacker

lacker Oct 2, 2010

It looks like this happens when you do a hmget on a key that doesn't exist yet.

lacker commented Oct 2, 2010

It looks like this happens when you do a hmget on a key that doesn't exist yet.

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