Skip to content
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

[Bug]: Command queue state error #2505

Open
1 task done
robhicks opened this issue Apr 2, 2024 · 0 comments
Open
1 task done

[Bug]: Command queue state error #2505

robhicks opened this issue Apr 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@robhicks
Copy link

robhicks commented Apr 2, 2024

Version

v5.5.0

Platform

NodeJS

What happened?

Since I couldn't figure out how to get Redis connection events from BullMQ directly, I have attempted to create IORedis connections directly, and then pass those connections to workers and queues.

I have also added, as described in the IORedis documentation, a monitor function so I can debug potential errors.

Here's an example:

import { Queue } from 'bullmq'
import { redisConnection } from './config.js'
import IORedis from 'ioredis'

const { host, port } = redisConnection.connection

const connection = new IORedis(+port, host, { maxRetriesPerRequest: null })

export const jobs = new Queue('jobs', { connection })

connection.monitor((err, monitor) => {
  console.log(`err`, err)
  // if (monitor) {
  //   monitor.on('monitor', (time, args, source, database) => {
  //     console.log(time, args, source, database)
  //   })
  // }
})

The error logger emits this:

err Error: Command queue state error. If you can reproduce this, please report it. Last reply: 1712098529.327989 [0 127.0.0.1:62763] "info"
    at DataHandler.shiftCommand (/Users/robhicks/dev/rqas-nodejs/node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/DataHandler.js:173:27)
    at DataHandler.returnReply (/Users/robhicks/dev/rqas-nodejs/node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/DataHandler.js:50:27)
    at JavascriptRedisParser.returnReply (/Users/robhicks/dev/rqas-nodejs/node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/DataHandler.js:21:22)
    at JavascriptRedisParser.execute (/Users/robhicks/dev/rqas-nodejs/node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js:544:14)
    at Socket.<anonymous> (/Users/robhicks/dev/rqas-nodejs/node_modules/.pnpm/ioredis@5.3.2/node_modules/ioredis/built/DataHandler.js:25:20)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:368:12)
    at readableAddChunk (node:internal/streams/readable:341:9)
    at Readable.push (node:internal/streams/readable:278:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
node:events:495
      throw er; // Unhandled 'error' event

How to reproduce.

See the code snippet above.

The version of IORedis is 5.3.2.
The version o f NodeJS is 18.19.1
The Redis server version is 7.2.4

Relevant log output

See above.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@robhicks robhicks added the bug Something isn't working label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant