Skip to content

TypeError: Cannot read property 'callback' of undefined #1427

@jackycchen

Description

@jackycchen

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions