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

Bull-board UI not working on v3.10.1 but working fine on v3.10.0 #391

Closed
rakalicious opened this issue Mar 28, 2022 · 3 comments · Fixed by #392
Closed

Bull-board UI not working on v3.10.1 but working fine on v3.10.0 #391

rakalicious opened this issue Mar 28, 2022 · 3 comments · Fixed by #392

Comments

@rakalicious
Copy link

Getting error (status - 500) for api api/queues?activeQueue=send_messages&page=1
Error -

{"error":"Internal server error","message":"Cannot read property 'attemptsMade' of null","details":"TypeError: Cannot read property 'attemptsMade' of null\n    at /app/node_modules/@bull-board/api/dist/src/queueAdapters/bull.js:29:13\n    at Array.map (<anonymous>)\n    at /app/node_modules/@bull-board/api/dist/src/queueAdapters/bull.js:28:80\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async /app/node_modules/@bull-board/api/dist/src/handlers/queues.js:75:15\n    at async Promise.all (index 0)\n    at async Object.queuesHandler [as handler] (/app/node_modules/@bull-board/api/dist/src/handlers/queues.js:90:39)\n    at async /app/node_modules/@bull-board/express/dist/ExpressAdapter.js:65:34"}

error

  • Mentioned the version as some changes were made related to attemptsMade in v3.10.1 due to this issue
  • Not sure if its related but got this error when connected to elasticache but not when connected to redis-server (server on local)
  • on opening /bull , it redirects to bull/queue/send_messages and then above error
    Related Code
// bull.js
const Queue = require("bull")
const { createBullBoard } = require("@bull-board/api")
const { BullAdapter } = require("@bull-board/api/bullAdapter")
const { ExpressAdapter } = require("@bull-board/express")

const serverAdapter = new ExpressAdapter()

const bullRedisOption = {
  host: process.env.REDIS_HOST,
  port: process.env.REDIS_PORT,
}

let sendMessageQueue = new Queue("send_messages", {
  redis: bullRedisOption,
  prefix: globalKeys.bullPrefix,
})

const { addQueue, removeQueue, setQueues, replaceQueues } = createBullBoard({
  queues: [new BullAdapter(sendMessageQueue)],
  serverAdapter: serverAdapter,
})

serverAdapter.setBasePath("/bull")
let router = serverAdapter.getRouter()

module.exports = {
  router,
  sendMessageQueue
}
//in server.js
const bull = require('./config/bull')
app.use('/bull', bull.router);
//consumers.js
const bull = require('../config/bull')
const { processScheduledMessage } = require("./communication_worker")

// concurrency = 10
bull.sendMessageQueue.process("scheduled_messages", 10, async (job, done) => {
  return await processScheduledMessage(job.data, done)
})

bull.sendMessageQueue.on("completed", function (job, result) {
  console.log(
    `sendMessageQueue job done with result id ${job.id} data ${JSON.stringify(
      job.data
    )} opts ${JSON.stringify(job.opts)} result ${JSON.stringify(result)}`
  )
  redisClient.deleteKey(`${globalKeys.bullPrefix}:send_messages:${job.id}`) //- this deletes entry of job from ui as well 
})

bull.sendMessageQueue.on('failed', function (job, result) {
  console.log(`sendMessageQueue job failed with id ${job.id} reason ${job.failedReason} trace ${job.stacktrace}`)
})
 
@felixmosh
Copy link
Owner

Thank you for reporting this detailed report, I'll investigate it asap.

@felixmosh
Copy link
Owner

Can you check if v3.10.2 solves the issue?

@rakalicious
Copy link
Author

v3.10.2 resolves the issue
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants