bee-queue / arena

An interactive UI dashboard for Bee, Bull and BullMQ packages
MIT License
842 stars 235 forks source link

"Internal Server Error" Data must be a string or a buffer #148

Open antonio0 opened 5 years ago

antonio0 commented 5 years ago

There's on job in my queue that I suspect might be in a corrupted state or simply in a state that Arena is having trouble reading. In the UI we just get the message "Internal Server Error". I'm running version 2.5.2

TypeError: Data must be a string or a buffer
at Hash.update (crypto.js:99)
at Object.hashIdAttr (/usr/src/app/node_modules/bull-arena/src/server/views/helpers/handlebars.js:44)
at eval (eval at createFunctionContext (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:8)
at prog (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:221)
at execIteration (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51)
at Object.<anonymous> (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61)
at Object.eval (eval at createFunctionContext (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:86)
at main (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:175)
at ret (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:178)
at ret (/usr/src/app/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:526)
at ExpressHandlebars._renderTemplate (/usr/src/app/node_modules/express-handlebars/lib/express-handlebars.js:247)
at ExpressHandlebars.<anonymous> (/usr/src/app/node_modules/express-handlebars/lib/express-handlebars.js:173)
at <anonymous>
at process._tickDomainCallback (next_tick.js:229)
ttacon commented 5 years ago

That's no good - let's get to the bottom of this! First question, are you running bull or bee-queue (and which version of those are you running)?

antonio0 commented 5 years ago

I'm running bull v3.4.3

skeggse commented 5 years ago

May have been introduced by #126 cc @gcox

gcox commented 5 years ago

I'm guessing the id is undefined somehow. That would have blown up the code prior to #126 as well, though we would have gotten a better error message.

Doesn't seem like there's a valid reason for id not to be a string by the time we're passing it to the hashId helper. Is there?

antonio0 commented 5 years ago

What's the easiest way to debug this? I would like to see the full payload of the job causing the issue. Is there a debug mode?

antonio0 commented 5 years ago

I've put a console.log to print the "jobs" array right before the render method for that, and it showed that one of the items in the array was null. Like

[
  { normal job stuff },
  null,
  { normal job stuff }
]

not sure if this is a problem on the Bull side or Arena.. I was looking at the "active" state. I could make a PR to filter out null values so it won't crash, but it's probably worth investigating how to solve the root cause?

bellatrix1001 commented 5 years ago

Same issue. I tried deleted a stuck job that won't go away from the "Active" tab by manually running: 127.0.0.1:6379: del bull:file:123456 Now the /file/active end point will not load at all: Internal Server Error In the logs, the error is TypeError: Data mus be a string or a buffer

KitoPham commented 4 years ago

Receiving this issue as well, utilizing Redis max-memory policy results in the web ui spitting this error when navigating to page with a list that would contain a job that was evicted from Redis.

irzhywau commented 4 years ago

same error on 2.6.3, any news about it?

ric2z commented 4 years ago

bump — seeing this issue as well