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]: RangeError when adding child job #2820

Open
1 task done
jonknyc opened this issue Oct 11, 2024 · 4 comments
Open
1 task done

[Bug]: RangeError when adding child job #2820

jonknyc opened this issue Oct 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jonknyc
Copy link

jonknyc commented Oct 11, 2024

Version

^5.18.0

Platform

NodeJS

What happened?

When adding a child job (following the steps documented here: https://docs.bullmq.io/patterns/process-step-jobs#waiting-children), I get an error:

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: "length" is outside of buffer bounds
    at proto.utf8Write (node:internal/buffer:1066:13)
    at Packr.encodeUtf8 (/Users/jonk/celebrate2/node_modules/msgpackr/pack.js:31:18)
    at pack (/Users/jonk/celebrate2/node_modules/msgpackr/pack.js:324:15)
    at packArray (/Users/jonk/celebrate2/node_modules/msgpackr/pack.js:238:5)
    at pack (/Users/jonk/celebrate2/node_modules/msgpackr/pack.js:424:7)
    at Packr.pack.encode (/Users/jonk/celebrate2/node_modules/msgpackr/pack.js:129:6)
    at Scripts.addStandardJob (/Users/jonk/celebrate2/node_modules/bullmq/src/classes/scripts.ts:158:15)
    at Scripts.addJob (/Users/jonk/celebrate2/node_modules/bullmq/src/classes/scripts.ts:219:27)
    at Job.addJob (/Users/jonk/celebrate2/node_modules/bullmq/src/classes/job.ts:1212:25)
    at Function.create (/Users/jonk/celebrate2/node_modules/bullmq/src/classes/job.ts:254:24) {
  code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}

If I add the job without specifying the parent details, it works. But when I specify the parent, it fails:

            // create child job
            await queue.add(JobType.FOO, data, {
              parent: {
                id: job.id!,
                queue: job.queueQualifiedName,
              },
            })

I have confirmed that the job ID exists and everything looks correct. As I said, I am basically copying the documentation.

How to reproduce.

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jonknyc jonknyc added the bug Something isn't working label Oct 11, 2024
@Botelho31
Copy link

I believe this is a node version error, it should only be ocurring in version 22.7, if you could upgrade it to 22.8 or downgrade to 22.5 it should be fixed.

@xtrinch
Copy link

xtrinch commented Oct 17, 2024

@Botelho31 Are we sure about that? I'm getting this same error in node 20.18.0

@duckboy81
Copy link

duckboy81 commented Oct 24, 2024

Same issue with node v23.0.0

EDIT: Just rolled node back to v20.13.1 and it worked just fine. Probably can close this issue.

@manast
Copy link
Contributor

manast commented Oct 24, 2024

v23 is definitely broken, dozens of tests are just failing miserably with many obscure errors.

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

5 participants