Automattic / Automattic/kue

TypeError: Object QUEUED has no method 'forEach'

Open
#909 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Hi, my kue worker just crashed out of the blue after running without issue for a few months now. I'm using version 0.9.3.

```
TypeError: Object QUEUED has no method 'forEach'
at /home/ubuntu/MYAPP/workers/node_modules/kue/lib/kue.js:226:15
at try_callback (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:592:9)
at RedisClient.return_reply (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:685:13)
at ReplyParser. (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:321:14)
at ReplyParser.EventEmitter.emit (events.js:95:17)
at ReplyParser.send_reply (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/lib/parser/javascript.js:300:10)
at ReplyParser.execute (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/lib/parser/javascript.js:173:22)
at RedisClient.on_data (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:547:27)
at Socket. (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:102:14)
at Socket.EventEmitter.emit (events.js:95:17)
ERROR: Uncaught Exception, shutting down gracefully....
TypeError: Object QUEUED has no method 'forEach'
at /home/ubuntu/MYAPP/workers/node_modules/kue/lib/kue.js:189:15
at try_callback (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:592:9)
at RedisClient.return_reply (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:685:13)
at ReplyParser. (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:321:14)
at ReplyParser.EventEmitter.emit (events.js:95:17)
at ReplyParser.send_reply (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/lib/parser/javascript.js:300:10)
at ReplyParser.execute (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/lib/parser/javascript.js:173:22)
at RedisClient.on_data (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:547:27)
at Socket. (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:102:14)
at Socket.EventEmitter.emit (events.js:95:17)
TypeError: Cannot read property '0' of undefined
at /home/ubuntu/MYAPP/workers/node_modules/kue/lib/queue/worker.js:252:24
at /home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:1170:13
at try_callback (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:592:9)
at RedisClient.return_reply (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:685:13)
at ReplyParser. (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:321:14)
at ReplyParser.EventEmitter.emit (events.js:95:17)
at ReplyParser.send_reply (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/lib/parser/javascript.js:300:10)
at ReplyParser.execute (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/lib/parser/javascript.js:189:22)
at RedisClient.on_data (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:547:27)
at Socket. (/home/ubuntu/MYAPP/workers/node_modules/kue/node_modules/redis/index.js:102:14)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the callbacks at lib/kue.js lines 189 and 226, then inspect queue/worker.js around line 252 and the Redis responses shown in the stack trace. Determine why the worker receives QUEUED where an iterable response is expected, reproduce the failure against kue 0.9.3, and verify that the worker no longer crashes when the affected Redis response occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.