TypeError: Cannot read property 'callback' of undefined

Đang mở
#1,427 4 bình luận 6 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js, redis
Lĩnh vực
backend, databases

Hướng nghiên cứu

Bắt đầu trong node_modules/redis/index.js tại normal_reply và lần theo cách self.command_queue được điền và dịch chuyển, sử dụng stack trace đã báo cáo làm điểm bắt đầu. Nếu có thể, hãy tái hiện lỗi không liên tục và xác minh rằng các replies được xử lý an toàn khi trạng thái của queue không khớp với response; thêm hoặc chạy một regression test tập trung nếu repository cung cấp một test như vậy.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Pending Author Input

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.

Ngôn ngữ chính
TypeScript
Star
17.6k
Fork
2k
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
62

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của redis/node-redis

Tất cả issue của redis/node-redis

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.