GithubHelp home page GithubHelp logo

felixmosh / bull-board Goto Github PK

View Code? Open in Web Editor NEW
2.0K 14.0 314.0 13.03 MB

🎯 Queue background jobs inspector

License: MIT License

JavaScript 3.01% CSS 13.78% TypeScript 82.80% Dockerfile 0.07% EJS 0.34%
redis bull

bull-board's Introduction

@bull-board @bull-board

Bull Dashboard is a UI built on top of Bull or BullMQ to help you visualize your queues and their jobs. With this library you get a beautiful UI for visualizing what's happening with each job in your queues, their status and some actions that will enable you to get the job done.

npm downloads licence open issues

Overview UI

Packages

Name Version
@bull-board/api npm (scoped)
@bull-board/ui npm (scoped)
@bull-board/express npm (scoped)
@bull-board/fastify npm (scoped)
@bull-board/koa npm (scoped)
@bull-board/hapi npm (scoped)
@bull-board/nestjs npm (scoped)
@bull-board/hono npm (scoped)
@bull-board/h3 npm (scoped)

Notes

As this library provides only the visualization for your queues, keep in mind that:

  • You must have either Bull or BullMQ installed in your projects;
  • Aside the options to retry and clean jobs, this library is not responsible for processing the jobs, reporting progress or any other thing. This must be done in your application with your own logic;
  • If you want to understand the possibilities you have with the queues please refer to Bull's docs or BullMQ's docs;
  • This library doesn't hijack Bull's way of working.

If you want to learn more about queues (Bull or BullMQ) and Redis.

Starting

To add it to your project start by installing a server framework specific adapter to your dependencies list:

yarn add @bull-board/express
# or
yarn add @bull-board/fastify
# or
yarn add @bull-board/hapi
# or
yarn add @bull-board/koa
# or
yarn add @bull-board/nestjs
# or
yarn add @bull-board/hono
# or
yarn add @bull-board/h3

NestJS specific setup

@bull-board provides a module for easy integration with NestJS, for reference on how to use the module refer to the NestJS Module package

Hello World

const express = require('express');
const Queue = require('bull');
const QueueMQ = require('bullmq');
const { createBullBoard } = require('@bull-board/api');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');
const { ExpressAdapter } = require('@bull-board/express');

const someQueue = new Queue('someQueueName', {
  redis: { port: 6379, host: '127.0.0.1', password: 'foobared' },
}); // if you have a special connection to redis.
const someOtherQueue = new Queue('someOtherQueueName');
const queueMQ = new QueueMQ('queueMQName');

const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');

const { addQueue, removeQueue, setQueues, replaceQueues } = createBullBoard({
  queues: [new BullAdapter(someQueue), new BullAdapter(someOtherQueue), new BullMQAdapter(queueMQ)],
  serverAdapter: serverAdapter,
});

const app = express();

app.use('/admin/queues', serverAdapter.getRouter());

// other configurations of your server

app.listen(3000, () => {
  console.log('Running on 3000...');
  console.log('For the UI, open http://localhost:3000/admin/queues');
  console.log('Make sure Redis is running on port 6379 by default');
});

That's it! Now you can access the /admin/queues route, and you will be able to monitor everything that is happening in your queues 😁

For more advanced usages check the examples folder, currently it contains:

  1. Basic authentication example
  2. Multiple instance of the board
  3. With Fastify server
  4. With Hapi.js server
  5. With Koa.js server
  6. With Nest.js server using the built-in module (Thanx to @dennissnijder)
  7. With Nest.js server using the express adapter (Thanx to @lodi-g)
  8. With Hono server (Thanks to @nihalgonsalves)
  9. With H3 server using the h3 adapter (Thanx to @genu)

Board options

  1. uiConfig.boardTitle (default: Bull Dashboard) The Board and page titles
  2. uiConfig.boardLogo (default: empty) { path: string; width?: number | string; height?: number | string } An object that allows you to specify a different logo
  3. uiConfig.miscLinks (default: empty) Array< { text: string; url: string }> An array of misc link that you can add to the dashboard, such as logout link.
  4. uiConfig.favIcon (default: { default: 'static/images/logo.svg', alternative: 'static/favicon-32x32.png', }) { default: string; alternative: 'string' } An object that allows you to specify the default and alternative favicons.
const QueueMQ = require('bullmq');
const {createBullBoard} = require('@bull-board/api');
const {BullMQAdapter} = require('@bull-board/api/bullMQAdapter');

const queueMQ = new QueueMQ();

createBullBoard({
  queues: [new BullMQAdapter(queueMQ)],
  serverAdapter,
  options: {
    uiConfig: {
      boardTitle: 'My BOARD',
      boardLogo: {
        path: 'https://cdn.my-domain.com/logo.png',
        width: '100px',
        height: 200,
      },
      miscLinks: [{text: 'Logout', url: '/logout'}],
      favIcon: {
        default: 'static/images/logo.svg',
        alternative: 'static/favicon-32x32.png',
      },
    },
  },
});

Queue options

  1. readOnlyMode (default: false) Makes the UI as read only, hides all queue & job related actions
const Queue = require('bull')
const QueueMQ = require('bullmq')
const { createBullBoard } = require('@bull-board/api')
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter')
const { BullAdapter } = require('@bull-board/api/bullAdapter')

const someQueue = new Queue()
const queueMQ = new QueueMQ()

createBullBoard({
  queues: [
    new BullAdapter(someQueue, { readOnlyMode: true }), // only this queue will be in read only mode
    new BullMQAdapter(queueMQ, { readOnlyMode: true }),
  ]
})
  1. allowRetries (default: true) When set to false the UI removes the job retry buttons for a queue. This option will be ignored if readOnlyMode is true.
const QueueMQ = require('bullmq')
const { createBullBoard } = require('@bull-board/api')
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter')
const { BullAdapter } = require('@bull-board/api/bullAdapter')

const someQueue = new Queue()
const queueMQ = new QueueMQ()

createBullBoard({
  queues: [
    new BullAdapter(someQueue, { allowRetries: false }), // No retry buttons
    new BullMQAdapter(queueMQ, { allowRetries: true, readOnlyMode: true }), // allowRetries will be ignored in this case in lieu of readOnlyMode
  ]
})
  1. description (default: empty) Queue description text.

  2. prefix (default: empty) Job name prefix.

  3. queueAdapter.setFormatter(field: 'data' | 'returnValue' | 'name', formatter: (fieldData) => any) You can specify a formatter for 'data' | 'returnValue' | 'name' job's fields.

const QueueMQ = require('bullmq');
const fastRedact = require('fast-redact');
const { createBullBoard } = require('@bull-board/api');
const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');

const redact = fastRedact({
  paths: ['headers.cookie', 'password', 'access_token']
})

const queueMQ = new QueueMQ()
const queueAdapter = new BullMQAdapter(queueMQ);
queueAdapter.setFormatter('name', (job) => `#Queue1 - ${job.name}`);
queueAdapter.setFormatter('data', (data) => redact(data));
queueAdapter.setFormatter('returnValue', (returnValue) => redact(returnValue));

createBullBoard({
  queues: [queueAdapter]
})

Hosting router on a sub path

If you host your express service on a different path than root (/) ie. https://<server_name>/<sub_path>/, then you can add the following code to provide the configuration to the bull-board router. In this example the sub path will be my-base-path.

const Queue = require('bull')
const { createBullBoard } = require('@bull-board/api')
const { BullAdapter } = require('@bull-board/api/bullAdapter')
const { ExpressAdapter } = require('@bull-board/express')

const basePath = '/my-base-path';

const someQueue = new Queue('someQueueName')
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath(basePath)

createBullBoard({
  queues: [
    new BullAdapter(someQueue),
  ],
  serverAdapter
})

// ... express server configuration

app.use(basePath, serverAdapter.getRouter());

You will then find the bull-board UI at the following address https://<server_name>/my-base-path/queues.

Contributing

First, thank you for being interested in helping out, your time is always appreciated in every way. πŸ’―

Remember to read the Code of Conduct so you also help maintaining a good Open source community around this project!

Here are some tips:

  • Check the issues page for already opened issues (or maybe even closed ones) that might already address your question/bug/feature request.
  • When opening a bug report provide as much information as you can, some things might be useful for helping debugging and understading the problem
    • Node, Redis, Bull, BullMQ, bull-board versions
    • Sample code that reproduces the problem
    • Some of your environment details
    • Framework you're using (Express, Koa, Hapi, etc).
  • Feature requests are welcomed! Provide some details on why it would be helpful for you and others, explain how you're using bull-board and if possible even some screenshots if you are willing to mock something!

Developing

If you want to help us to solve the issues, be it a bug, a feature or a question, you might need to fork and clone this project.

To fork a project means you're going to have your own version of it under your own GitHub profile, you do it by clicking the "Fork" button on the top of any project's page on GitHub.

Cloning a project means downloading it to your local machine, you do it in the command line:

git clone [email protected]:YOUR_GITHUB_USERNAME/bull-board.git

That will create a bull-board folder inside the directory you executed the command, so you need to navigate inside it:

cd bull-board

This project requires that you have yarn installed

Also make sure you are running Redis for this project (bull-board's example connects to Redis' default port 6379).

Now, to try it out locally you can run:

yarn && yarn build && yarn start:dev

The ui open automaticlly in the browser at http://localhost:3000/ui

Acknowledgements ❀️

  • Juan for building the first version of this library

License

This project is licensed under the MIT License, so it means it's completely free to use and copy, but if you do fork this project with nice additions that we could have here, remember to send a PR πŸ‘

bull-board's People

Contributors

aliceclv avatar dennissnijder avatar dependabot[bot] avatar diegocfreire avatar dimbslmh avatar embraser01 avatar erikengervall avatar ex7r3me avatar eywek avatar felixmosh avatar goferito avatar ivnnv avatar katsanva avatar kody-abe avatar koresar avatar kyleculp avatar mmachatschek avatar nihalgonsalves avatar panzer1119 avatar salman-amjad avatar sandrocaseiro avatar sestolk avatar shane-streettext avatar snyk-bot avatar softbrix avatar tayclark avatar theoilie avatar ttou avatar vcapretz avatar yurickh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bull-board's Issues

Dead dependency, three high security risks

bull-board currently uses vorpal as a dependency, which was last updated in August of 2018.

There are three high-risk security vulnerabilities in a dependency of vorpal relating to lodash which were fixed in 2017, see them using npm audit

Path for all, bull-repl > vorpal > inquirer > lodash

It seems to me the alternatives are to use instead either:

  1. https://github.com/tj/commander.js
  2. https://github.com/oclif/oclif
  3. https://github.com/yargs/yargs
  4. https://github.com/vorpaljs-reforged/vorpal

I am not familiar with Vorpal or Oclif which would we prefer? This security issue really must be addressed and since the only way to do it is to change dependencies, as the one it's in is dead, there needs to be some discussed about what CLI bull-board is going to in-future use.

bull-board(v1.0.0-alpha.0) getting errors while testing the alpha, might be doing something wrong?

import {  router } from 'bull-board';

app.use('/ui', router)

trace:
at Function.render (/Users/dev/platform/node_modules/express/lib/application.js:580:17) at ServerResponse.render (/Users/dev/platform/node_modules/express/lib/response.js:1012:7) at exports.entryPoint (/Users/dev/platform/node_modules/bull-board/src/routes/index.ts:8:7) at Layer.handle [as handle_request] (/Users/dev/platform/node_modules/express/lib/router/layer.js:95:5) at next (/Users/dev/platform/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/Users/dev/platform/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/Users/dev/platform/node_modules/express/lib/router/layer.js:95:5) at /Users/dev/platform/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/Users/dev/platform/node_modules/express/lib/router/index.js:335:12) at next (/Users/dev/platform/node_modules/express/lib/router/index.js:275:10)

progress bar not working ?

Hey, thanks for this great dashboard,
i am not sure, but after a job finishes , the progress bar doesnt go to 100% it gust go to finished tab,
but the percentege progress still 0,

also this is my code :-

myFirstQueue.add('normal', { name: 'Hello', });

myFirstQueue.process('normal', (job, done) => { for (let i=0;i<=1000;i++){ file.write('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'); } done(); });

how could i make the process take time , so i can see the progess in the dashboard,
would appreciate any help,
and thanks for this great work

Use types for `redis-info` from DefinetilyTyped instead of manually declaring them

Context

We're currently declaring the types for redis-info manually at src/declarations.d.ts, but recently we've got access to more complete types through the @types/redis-info package.

Proposal

We should change to use the types in DefinetilyTyped and update some of the types we declare locally to be defined in terms of them.

How to use it in koa2?

I want to use it in an application built by koa2,but I don't get it.
my code like:

const Koa = require('koa');
const app = new Koa();
const { UI } = require('bull-board');

app.use((ctx, next) => {
    if(ctx.path.startWith('/monitor')) {
        if (ctx.status === 404 || ctx.status === '404') {
            delete ctx.res.statusCode
        }
        ctx.respond = false;
        UI(ctx.req, ctx.res);
    } else {
        next();
    }
});

This is from Can we mount express app into koa?

Cannot read property 'id' of null

Reported by sentry, I'm not sure on which specific conditions this happens:

TypeError: Cannot read property 'id' of null File "/usr/src/app/node_modules/bull-board/routes/getDataForQeues.js", line 24, col 13, in formatJob id: job.id, ?, in Array.map File "/usr/src/app/node_modules/bull-board/routes/getDataForQeues.js", line 67, col 20, in null.<anonymous> jobs: jobs.map(formatJob), ?, in runMicrotasks File "internal/process/task_queues.js", line 93, col 5, in processTicksAndRejections ?, in async Promise.all File "/usr/src/app/node_modules/bull-board/routes/getDataForQeues.js", line 54, col 18, in async getDataForQeues const counts = await Promise.all( File "/usr/src/app/node_modules/bull-board/routes/queues.js", line 5, col 5, in async handler await getDataForQeues({

Add integration tests

Integration tests, a suggestion is to use Dockest to spin up a redis instance so it would be possible to add/remove jobs in queues and test the code

Request: Job progress count instead of percentage

Hello.

First of all, thank you for making a nice and clean interface for bull. I use it in my project that syncs data between databases. I do the work using batches, so I never know the max value of things that need processing in order to calculate the percentage. So if i do job.progress(item.count) where item.count is for example 4235 items, the frontend interface will go crazy because the green progressbar will be style="width: 4235%".

What im proposing is a simple check, something along the lines of:
if (job.progress > 100) // Don't render class="progress-bar", style="width: 4235%" and the % sign

progress: ({ job }) => {
    switch (type(job.progress)) {
      case 'Object':
        return (
          <Highlight className="json">
            {JSON.stringify(job.progress, null, 2)}
          </Highlight>
        )
      case 'Number':
       if (job.progress > 100)  {
            return (
          <div className="progress-wrapper"> {job.progress}</div>
        )
        }
        return (
          <div className="progress-wrapper">
            <div
              className="progress-bar"
              style={{
                width: `${job.progress}%`,
              }}
            >
              {job.progress}
              %&nbsp;
            </div>
          </div>
        )
      default:
        return '--'
    }
  },

Thanks in advance

Doesn't work when used with Redis.Cluster

GET /queues
returns
{"status":500,"message":"Cannot use 'in' operator to search for 'redis_version' in undefined"}

when I return new Redis.Cluster(...) in createClient while creating Bull.Queue

BullMQ (4) delayed tab broken

When creating a job with the following properties

await queue.add('job-name', { foo: 'bar' }, {
         repeat: {
           every: 1000,
           startDate: new Date(),
           tz: "America/Los_Angles",
         },
      });

Then clicking on the delayed tab in the UI I get the following error

RangeError: Invalid time value
    at bundle.js:30
    at delay (bundle.js:30)
    at to (bundle.js:22)
    at Gl (bundle.js:22)
    at gu (bundle.js:22)
    at mu (bundle.js:22)
    at ru (bundle.js:22)
    at bundle.js:22
    at t.unstable_runWithPriority (bundle.js:30)
    at La (bundle.js:22)

Access to returned value?

The value returned by your process function will be stored in the jobs object and can be accessed later on, for example in a listener for the completed event

Is the object / value that is returned by the consumer available in the dashboard? I'm seeing the object that is passed to the consumer, and the options β€” but I don't actually see the value that is returned.

Module documentation

Hey folks! first of all, I hope to all of you having a good and stay healthy time on this covid-19 hard times.

I don't know if this could be considered as an issue but I was reading the source code and found that there a few extra definitions that are missing on the README

router.put('/queues/:queueName/retry', wrapAsync(retryAll))
router.put('/queues/:queueName/:id/retry', wrapAsync(retryJob))
router.put('/queues/:queueName/:id/promote', wrapAsync(promoteJob))
router.put('/queues/:queueName/clean/:queueStatus', wrapAsync(cleanAll))

so want to ask if there is an official doc or something to understand what are those routes and which role are playing on the board module

besides that, I didn't found in README regarding my server being hit at this route GET /queues/queues/? and the server is replying with 304 πŸ€”

if anyone can help me will be very appreciated

Closing of Queue isn't handled

Hello
If you will try to setQueue(bullInstance) to the board and then bullInstance.close() => it will produce error "Error: Connection is closed.", please make it just removing it from dashboard

Bullboard is not showing

I was trying to run bullboard with Apollo Server, but somehow is not showing anymore the dashboard, when i try to access the is returning this to me.

Captura de tela de 2020-01-06 09-57-03

I was starting the bullboard with a middleware and adding the queue with this code, after i debug aparently is normally working.

Captura de tela de 2020-01-06 10-20-52

And adding to my application with this code.

Captura de tela de 2020-01-06 10-21-17

Node version: v10.15.2
Bullboard version: ^0.5.0
Bull version: ^3.12.1

For some reason bull-board doesn't render

I'm trying to run bullboard but he just returning me a blank page with HTML code and i dunno how to solved it, can you guys help me:
image

This is the code i'm trying to run:

// bullboard.js

import {UI, setQueues} from 'bull-board'
import Queue from '../services/queueService'

setQueues(Queue.queues.map((queue) => queue.bull))

export default UI
// setup-app.js
import cors from '../middlewares/cors'
import jsonParser from '../middlewares/json-parser'
import rawParser from '../middlewares/raw-parser'
import contentType from '../middlewares/content-type'
import bodyParser from '../middlewares/body-parser'
import logger from '../middlewares/logger'
import bullboard from '../middlewares/bullboard'
import voyager from '../middlewares/voyager'

export default (app) => {
	app.disable('x-powered-by')
	app.use(cors)
	app.use(jsonParser)
	app.use(rawParser)
	app.use(contentType)
	app.use(bodyParser())
	app.use(logger)
	app.use(bullboard)
	app.use('/voyager', voyager)
}
// queueService.js
import Queue from 'bull'

import env from 'env-cat'
import * as jobs from '../jobs'
import * as logger from '../core/logger'

const queues = Object.values(jobs).map((job) => ({
	bull: new Queue(job.key, env.get('REDIS_URL')),
	name: job.key,
	handle: job.handle,
}))

export default {
	queues,
	add(name, data) {
		const queue = this.queues.find((queue) => queue.name === name)
		return queue.bull.add(data)
	},
	process() {
		return this.queues.forEach((queue) => {
			queue.bull.process(queue.handle)

			queue.bull.on('failed', (job, err) => {
				logger.info('Job failed', queue.key)
				logger.info(err)
			})
		})
	},
}
// jobs.js
export {default as Mail} from './Mail'
export {default as Task} from './Task'
export {default as Pipeline} from './Pipeline'
export {default as SegmentUpdate} from './SegmentUpdate'
export {default as SegmentDelete} from './SegmentDelete'

Node version: 12.16.1
NPM Version: 6.13.7

Problem with white-space in <pre>

Hello!

Thank you very much for the work done.
Your UI looks great.
But I have a problem with CSS.

Screen Shot 2019-09-19 at 7 24 11 AM

This can probably be solved with:

pre {
      white-space: pre-wrap;
}

is there a pagination ?

does all the orders appears in one page, no pagaination ?
i could implement one if no any

Bull could be an external dependency instead of being provided by bull-board

This would be a breaking change, basically removing the createQueues method and instead of keeping track of the queues internally, we would rather accept queues as a parameter (probably to UI or a config method).

Major benefit would be that users have more control on how to use Bull on their own and maybe even supporting integration with other libs

Add option to clean jobs

We can start with a button to clean all the jobs in the delayed status, can probably be expanded to all the statuses

cluster setup

I'm using bull-board in a cluster setup and whenever it pulls for new data, the page will become completely empty probably due to different data returned from the workers.

Reciveing loading screen when i try to manage my queues

Hi, I'm trying to test bull-board but using the example but I'm getting a screen with:

loading...

and not bull-board management screen:
Is the same as the example

const { createQueues } = require('bull-board')
 
	const redisConfig = {
  		redis: {
    		port: 6379,
    		host: "127.0.0.1"
  	},
	}
 
	const queues = createQueues(redisConfig)

	const helloQueue = queues.add('helloQueue') // adds a queue
	const helloQueueWithOpts = queues.add('helloQueue', {
  		prefix: 'hello',
	}) // adds a queue with QueueOptions https://github.com/OptimalBits/bull/blob/master/REFERENCE.md#queue
 
	// defines how the queue works
	helloQueue.process(async job => {
  		console.log(`Hello ${job.data.hello}`)
	})
 
	helloQueue.add({ hello: 'world' }) // adds a job to the queue

And later

const { UI } = require('bull-board')
 
	app.use('/admin/bullDash', UI)

Someone knows what is happening?

Finish eslint setup

eslint was set up with the minimal requirements for prettier, but it still doesn't have any rules.

we could at least have eslint:recommended in the extends list and make it work with both React and Node env (routes/ and ui/ folders)

How to show different data-field in the 'completed' tab

As part of monitoring I'd love to see results of individual jobs. I imagine this must be possible by somehow altering what is shown in the data-field as part of the 'completed' tab.

How would I instruct bull to show custom data?

for ref:

Screenshot 2020-02-12 at 01 31 56

Integration with NestJS

How can we integrate the UI to nestjs project where queues are alreay created and maanged by @nest/bull package?

The completed and failed counts don't seem to reflect queue status

We're using Bull Board on a project, and it's been really helpful to visualize what's happening in our queue. However, we're finding that the completed and failed counts don't seem to reflect the current status of the queue. Our code gets all kinds of completed and failed events, which we use to drive our app. But we see nothing in the UI:

Screen Shot 2019-12-04 at 3 47 55 PM

I do find that failed events in Bull don't always have the right err, which I've filed upstream in OptimalBits/bull#1326. But this looks like a Bull Board issue vs Bull.

Board page is not working

When i tried to use bull-board, nothing happens.
With no queues i have "no stats to display" page, but if I add some existing queue like

import { createQueues } from 'bull-board'
const queues = createQueues(myConfig)
export const myQueue = queues.add('MyQueue')

And I try to use it, there is empty white page on '/admin/queues' and I have following errors in browser's console

TypeError: Expected a finite number, got number: NaN
    at e.exports (bundle.js:1)
    at $e (bundle.js:30)
    at Ai (bundle.js:22)
    at Vl (bundle.js:22)
    at Fl (bundle.js:22)
    at Ll (bundle.js:22)
    at Rl (bundle.js:22)
    at bundle.js:22
    at t.unstable_runWithPriority (bundle.js:30)
    at ca (bundle.js:22)

image

updated: I used bull-board api.

queue.client.info is not a function

TypeError: queue.client.info is not a function
at getStats (/Users/macbookpro/Documents/data/node_modules/bull-board/routes/getDataForQeues.js:12:22)
at getDataForQeues (/Users/macbookpro/Documents/data/node_modules/bull-board/routes/getDataForQeues.js:71:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async handler (/Users/macbookpro/Documents/data/node_modules/bull-board/routes/queues.js:5:5)
TypeError: queue.client.info is not a function
at getStats (/Users/macbookpro/Documents/data/node_modules/bull-board/routes/getDataForQeues.js:12:22)
at getDataForQeues (/Users/macbookpro/Documents/data/node_modules/bull-board/routes/getDataForQeues.js:71:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async handler (/Users/macbookpro/Documents/data/node_modules/bull-board/routes/queues.js:5:5)

//////////////////////////////

const { Queue, Worker, QueueEvents } = require('bullmq');

var cluster = require('cluster');
const { setQueues, UI } = require('bull-board')
const app = require('express')()
const port = 3010

var numWorkers = 8;
var queue = new Queue("Paint");
const queueEvents = new QueueEvents('Paint');

setQueues([queue])

if(cluster.isMaster){
for (var i = 0; i < numWorkers; i++) {
cluster.fork();
}

cluster.on('online', function(worker) {
// Lets create a few jobs for the queue workers
for(var i=0; i<500; i++){
queue.add('cars', { color: 'blue' });
};
});

cluster.on('exit', function(worker, code, signal) {
console.log('worker ' + worker.process.pid + ' died');
});
}else{
const worker = new Worker('Paint', async job => {
if (job.name === 'cars') {
await console.log(job.data.color);
}
});
queueEvents.on('waiting', ({ jobId }) => {
console.log(A job with ID ${jobId} is waiting);
});

queueEvents.on('active', ({ jobId, prev }) => {
    console.log(`Job ${jobId} is now active; previous status was ${prev}`);
});

queueEvents.on('completed', ({ jobId, returnvalue }) => {
    console.log(`${jobId} has completed and returned ${returnvalue}`);
});

queueEvents.on('failed', ({ jobId, failedReason }) => {
    console.log(`${jobId} has failed with reason ${failedReason}`);
});

}
app.use('/ui', UI)
app.listen(port, () => console.log(Example app listening at http://localhost:${port}))

Standalone version

I was really excited about this project when I saw it, but I had trouble getting it to work. We have Bull queues running in production in a Docker Swarm with dozens of Fastify worker containers and several different redis endpoints. I tried using fastify.use() but it's not compatible I don't think.

But this kinda sucks anyways β€” we would have to embed the bull-board and all its dependencies (express, react, react-dom, ramda, etc) directly into our server images. I was hoping this would be more of a standalone server that you can point to a redis process and give it a prefix and it'll find your queues for you (via KEYS bull:* every so often). That would mean just adding one more container instead of embedding an instance of it to every worker image.

I think you already have the basis of it here, an UI + Express server, what do you think of modifying it to work without any required integration into your node app that is running Bull?

See job logs

Just trying your nice board! Well done πŸ‘

Is it possible to see job logs logged with job.log()?

It would be nice to know what was logged during jobs runs.

Cheers! 🍻

two queues or more reflect UI ?

if i added more than one queue would the UI create another tabes for the new queue,
ar all queues insert in the same tabs ?

CSP restrictions broke bull-board UI

Due to CSP browser restrictions UI is not working any more in Chrome/FF. Please use window.location.pathname instead of passing basePath via window object (this would allow us to skip inlined <script> tag).

1.0.0-alpha.5 Missing Dependencies

Testing out 1.0.0-alpha.5...

Current package version

  • Bull => 3.13.0
  • BullMQ => Not installed

Steps Taken

1.npm i [email protected]
2. tsc -p project_src

However tsc fails and I get the error below

node_modules/bull-board/dist/index.d.ts:2:34 - error TS2307: Cannot find module 'bullmq'. 2 import { Queue as QueueMq } from 'bullmq';

node_modules/bull-board/dist/index.d.ts:3:30 - error TS2307: Cannot find module 'express-serve-static-core'.
3 declare const router: import("express-serve-static-core").Express;

Note I tested 1.0.0-alpha.4 to confirm and got the same error

Also manually installed bullmq package and error did go away however I received this new error

node_modules/bullmq/dist/interfaces/sandboxed-job.d.ts:3:57 - error TS2304: Cannot find name 'Omit'.

3 export interface SandboxedJob<T = any, R = any> extends Omit<JobJson, 'data' | 'opts' | 'progress' | 'log' | 'returnValue'> {

Help setting up first time

Hello!

Love the screenshot look and tried setting this up for a redis hosted on Heroku.

It's very hard because there are no error messages anywhere and the documentation seems incomplete.

How do I know if my credentials are correct?
How do I specify queues?
When it "fails" it just ends up pending forever and then fails with MaxRetries, is that intended?

After reading around this is what I ended up with

const { createQueues, UI } = require('bull-board');
const app = require('express')();

const redisConfig = {
  redis: {
    port: process.env.REDIS_PORT,
    host: process.env.REDIS_HOST,
    password: process.env.REDIS_PASSWORD,
  },
}

const queues = createQueues(redisConfig);

queues.add('posts');

app.use('/admin/queues', UI)

app.listen( 3000, () => {
    console.log( `Server up and running on port 3000` );
});

I'd gladly help with PRs but right now I don't even know where to start πŸ’ƒ

Extend the failed message in the ui.

Currently the Bull-board is not providing the needed info.

For example when a job fails we retry it X amount of times depending on the endpoint and this returns β€˜job stalled more than allowable limit’ when it fails. Before in Kueue this would give the data object which contained the reason for failing.

Currently it's only possible to see the complete message by calling β€˜jobs/failed/retrieve/0/99999999’ endpoint.

For this I would like the DATA and OPS object to be added to the failed job or an other solution would be to add a link to retrieve the complete message.

Solution one extend the array of queue(ui/components/Queue.js 63) :
failed: ['id', 'failedReason','data', 'timestamps', 'progress', 'attempts', 'retry'],

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.