question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 to self.command_queue.get(0) can return undefined. This will cause the command_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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BridgeARcommented, Aug 1, 2017

Fixed in 2.8.0

0reactions
BridgeARcommented, May 5, 2017

@davidmurdoch thanks a lot for looking deeper into this and great work!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found