subscribe_unsubscribe's call to self.command_queue.get(0) can return undefined.
See original GitHub issue- node_redis Version: 2.7.1
- Redis Version: 3.2.4
- Platform: Node.js 6.10.2 on Heroku
- Description:
subscribe_unsubscribe
’s call toself.command_queue.get(0)
can returnundefined
. This will cause thecommand_obj.args
check to throw.
I’m unsure why this happens on our server on occasion, and I have been unable to reliably reproduce this issue. The only thing I can think of that might be causing the problem, based on the comments in the subscribe_unsubscribe
function about the optional callback, is that we omit the callback in our subscribe
and unsubscribe
calls, e.g., pubSubClient.subscribe([channel1, channel2, etc...]);
.
Let me know if you need any more information or if there is anything I can do to help.
Example stack trace:
/app/node_modules/redis/index.js:747
if (command_obj.args.length === 1 || self.sub_commands_left === 1 || command_obj.args.length === 0 && (count === 0 || channel === null)) {
^
TypeError: Cannot read property 'args' of undefined
at subscribe_unsubscribe (/app/node_modules/redis/index.js:747:20)
at return_pub_sub (/app/node_modules/redis/index.js:796:9)
at RedisClient.return_reply (/app/node_modules/redis/index.js:828:9)
at JavascriptRedisParser.returnReply (/app/node_modules/redis/index.js:192:18)
at JavascriptRedisParser.execute (/app/node_modules/redis-parser/lib/parser.js:574:12)
at Socket.<anonymous> (/app/node_modules/redis/index.js:274:27)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Subscribe to observable is returning undefined - Stack Overflow
The component calls subscribe on the returned Observable. The get request is submitted to the server for processing.
Read more >JavaScript Check if Undefined – How to Test for Undefined in JS
An undefined variable or anything without a value will always return "undefined" in JavaScript. This is not the same as null, ...
Read more >background scripts returning "undefined" value - ServiceNow
I am running below background script. As shown in output, count is 1 but number returned is "undefined". Please help me in getting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in 2.8.0
@davidmurdoch thanks a lot for looking deeper into this and great work!