Automattic / Automattic/kue

Error: job "xxxxxxx" doesnt exist revisited

Open
#1,229 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,
The nodejs.log file contains too many errors of this kind. Sorry if the solution has been addressed already. I would like to know what is the best way of dealing with or solving this issue?

Thank you

```
events.js:174
throw er; // Unhandled 'error' event
^

Error: job "23133372" doesnt exist
at Command.callback (/var/app/current/node_modules/kue/lib/queue/job.js:178:17)
at normal_reply (/var/app/current/node_modules/kue/node_modules/redis/index.js:721:21)
at RedisClient.return_reply (/var/app/current/node_modules/kue/node_modules/redis/index.js:819:9)
at JavascriptRedisParser.returnReply (/var/app/current/node_modules/kue/node_modules/redis/index.js:192:18)
at JavascriptRedisParser.execute (/var/app/current/node_modules/kue/node_modules/redis-parser/lib/parser.js:574:12)
at Socket. (/var/app/current/node_modules/kue/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)
Emitted 'error' event at:
at Worker. (/var/app/current/node_modules/kue/lib/kue.js:342:12)
at Worker.emit (events.js:189:13)
at Worker.error (/var/app/current/node_modules/kue/lib/queue/worker.js:104:8)
at /var/app/current/node_modules/kue/lib/queue/worker.js:85:20
at Command.callback (/var/app/current/node_modules/kue/lib/queue/job.js:178:14)
at normal_reply (/var/app/current/node_modules/kue/node_modules/redis/index.js:721:21)
[... lines matching original stack trace ...]
at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! br@1.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the br@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
```

```
let sportQueue = kue.createQueue({
prefix: 'sportQueue',
redis: {
port: 6379,
host: constants.redisHost,
db: 1,
options: {
"detect_buffers": false
}
}
});

// Sync Sports Every 14 Days
cron.schedule('0 0 10 */14 * *', async () =>
{
let job = sportQueue.create('sportQueue', {
title: 'sportQueue',
sports: false,
seasons: false,
teams: true,
athletes: true
}).ttl(60000).priority('high').removeOnComplete(true).save(function (err)
{
if (!err) console.log(job.id);
});
});
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with kue/lib/queue/job.js around line 178 and kue/lib/queue/worker.js around lines 85-104, then trace the Redis state for the shown queue configuration, including ttl and removeOnComplete. Reproduce the missing-job error and determine the expected handling; done means a documented or tested fix that prevents the worker from exiting unexpectedly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.