arena icon indicating copy to clipboard operation
arena copied to clipboard

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

Open antonio0 opened this issue 6 years ago • 10 comments

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)

antonio0 avatar Feb 01 '19 14:02 antonio0

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)?

ttacon avatar Feb 01 '19 14:02 ttacon

I'm running bull v3.4.3

antonio0 avatar Feb 01 '19 14:02 antonio0

May have been introduced by #126 cc @gcox

skeggse avatar Feb 01 '19 16:02 skeggse

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?

gcox avatar Feb 01 '19 17:02 gcox

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 avatar Feb 22 '19 12:02 antonio0

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?

antonio0 avatar Feb 26 '19 17:02 antonio0

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

bellatrix1001 avatar Apr 24 '19 19:04 bellatrix1001

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.

KitoPham avatar Jul 30 '19 23:07 KitoPham

same error on 2.6.3, any news about it?

irzhywau avatar Aug 14 '19 16:08 irzhywau

bump — seeing this issue as well

ric2z avatar Sep 27 '19 21:09 ric2z