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]: Job data gets removed for repeatable job after first run #3009

Closed
1 task done
DieserMerlin opened this issue Jan 13, 2025 · 4 comments · Fixed by #3010
Closed
1 task done

[Bug]: Job data gets removed for repeatable job after first run #3009

DieserMerlin opened this issue Jan 13, 2025 · 4 comments · Fixed by #3010
Labels
bug Something isn't working

Comments

@DieserMerlin
Copy link

Version

v5.34.8 upwards

Platform

NodeJS

What happened?

Hello there,

I discovered an issue with job data getting emptied after the first run when using repeatable / scheduled jobs.
This error occurs with bullmq versions after 5.34.7.

I also looked into my redis and found the data to be completely removed.

How to reproduce.

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

const queue = new Queue("test-queue-1");
const worker = new Worker("test-queue-1", (job) => console.log(job.data), {
  connection: {}, // Default localhost
});

queue.add(
  "example",
  { someId: crypto.randomUUID() },
  { repeat: { every: 5000, key: "example-key" } }
);

Relevant log output

// Output on 5.34.7:
{ someId: 'fb0eceae-2f2e-4faf-945d-8ed475be0242' }
{ someId: 'fb0eceae-2f2e-4faf-945d-8ed475be0242' }
{ someId: 'fb0eceae-2f2e-4faf-945d-8ed475be0242' }

// Output on 5.34.8/9:
{ someId: '908c804c-7fbe-4b74-918d-d97135944bc0' }
{}
{}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@DieserMerlin DieserMerlin added the bug Something isn't working label Jan 13, 2025
@manast
Copy link
Contributor

manast commented Jan 13, 2025

Thanks for reporting this. We are working on a solution, seems like there is some backwards compatibility issue that we have overlooked.

github-actions bot pushed a commit that referenced this issue Jan 14, 2025
## [5.34.10](v5.34.9...v5.34.10) (2025-01-14)

### Bug Fixes

* **job-scheduler:** use delayed job data when template data is not present ([#3010](#3010)) fixes [#3009](#3009) ([95edb40](95edb40))
@roggervalf
Copy link
Collaborator

hi @DieserMerlin pls upgrade to v5.34.10, you might need to upsert your job-schedulers records. Also pls start using upsertJobScheduler method as adding jobs with add method will be deprecated in next breaking change https://docs.bullmq.io/guide/job-schedulers

@DieserMerlin
Copy link
Author

Wow, this was fast. Thanks 🤗

@wolff453
Copy link

Thank you a lot, i was facing the same problem! 🤗🤗

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

Successfully merging a pull request may close this issue.

4 participants