New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'callback' of undefined #1427
Comments
Do you have this code in?
|
It is very hard to debug this. It should actually never happen. This indicates that the state is not correct anymore. Is there any way you are able to reliable trigger this error and do you have more information for me? Like a minimal code snipped, the node_redis version and the parser version, what commands you use and anything else that might be helpful to debug this. |
I am also getting this error intermittently. In my case it seems that sometimes after calling "client.punsubcribe()" I am flooded with these errors until I restart the process. edit: I should also add that there are typically 4 concurrent Redis clients per node instance, two to two different hosts
Traceback is more or less identical to OP's, but for completeness:
|
After running on debug mode I noticed that these errors track with It also only happens intermittently and when the app server is under notably high load from a cron job redis 3.0.2 node 14.15.1, redis-parser 3
Also there are related AbortErrors around the same time that don't crash the server because they're caught
|
Error message detail:
C:\Users\xxxxx\node_modules\redis\index.js:722 if (typeof command_obj.callback === 'function') { ^ TypeError: Cannot read property 'callback' of undefined at normal_reply (C:\Users\xxxxx\node_modules\redis\index.js:722:28) at RedisClient.return_reply (C:\Users\xxxxx\node_modules\redis\index.js:824:9) at JavascriptRedisParser.returnReply (C:\Users\xxxxx\node_modules\redis\index.js:192:18) at JavascriptRedisParser.execute (C:\Users\xxxxx\node_modules\redis-parser\lib\parser.js:574:12) at Socket.<anonymous> (C:\Users\xxxxx\node_modules\redis\index.js:274:27) at Socket.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) at readableAddChunk (_stream_readable.js:265:11) at Socket.Readable.push (_stream_readable.js:220:10) at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
Source code of redis client:
function normal_reply (self, reply) { var command_obj = self.command_queue.shift(); if (typeof command_obj.callback === 'function') { if (command_obj.command !== 'exec') { reply = self.handle_reply(reply, command_obj.command, command_obj.buffer_args); } command_obj.callback(null, reply); } else { debug('No callback for reply'); } }
This error is happened occasionally, not all the time. I think maybe there's a bug, and should check command_obj when shift from comman queue.
The text was updated successfully, but these errors were encountered: