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

Upgrading from Rails 5.2.4 to 6.1.6 with Delayed Job - Job's not being picked up #1171

Open
bh8ur8js opened this issue May 22, 2022 · 11 comments

Comments

@bh8ur8js
Copy link

Working config

ruby 2.6.2

rails 5.2.4

delayed_job 4.1.8

#config/environments/development.rb

config.active_job.queue_adapter = :delayed_job
config.active_job.queue_name_prefix = "ukcil_#{Rails.env}"
#config/application.rb
config.active_job.queue_adapter = :delayed_job
#Started with

bin/delayed_job -n 1 start
#Environment vairables are

RAILS_ENV=development
QUEUES=*
#config/initializers/delayed_job.rb

Delayed::Worker.queue_attributes = {
  mailers_h: {priority: 0},
  mailers_l: {priority: 10},
  general_h: { priority: 20 },
  general_l: { priority: 30 }
}

After upgrading to

Ruby 2.7.2
Rails 6.1.6
delayed_job 4.1.10

everything is working except for delayed_job .

Jobs are being queued correctly, appearing delayed_job_web front end view, as before

The delayed_job process is running, as per activity monitor, but the jobs are not being picked up or process.

I just can't see what's changed here. It's not showing any errors.

I thought it would be something esoteric that was causing it. I think it might be, I can find no documentation about a similar problem. Any help with be gratefully received.

@bh8ur8js
Copy link
Author

One last thing, if I open a Rails Console

q = Delayed::Worker.new(quiet: false)
q.start

It works. The polling starts and works off the queue.

However when running as a process

bundle exec bin/delayed_job --queues=*  run

It doesn't seem to starting the Worker Object

@joelcahalan
Copy link

I am having this issue also. Did you find a solution?

@bh8ur8js
Copy link
Author

I have not. It's very frustrating.

It's seem so random. We can test all the mechanisms are working. It's just not starting.

Are you using macOS or Linux ? Something has changed in the delayed _job executable.

I can't find anything.

@joelcahalan
Copy link

I have no problem on Rails 6.0 but when I try using Rails 6.1 I get the behavior you describe. I am using macos. I don't have time right now to debug.

@bh8ur8js
Copy link
Author

bh8ur8js commented Jun 23, 2022 via email

@johngronow
Copy link

johngronow commented Jul 20, 2022

I am seeing the exact same behaviour.

Running Ruby 3.0.4. Rails 6.0.5.1 and Delayed Job 4.1.10, everything works perfectly.

Upgrade to Rails 6.1.6.1 with the same versions of Ruby and Delayed Job and workers no longer pick up jobs, except when run from the console.

Can anyone suggest a fix?

Update: This is actually working in production, so my problem is only in my development environment. The difference is that my development machine is a Mac (macOS Monterey 12.4) whereas production is deployed on Ubuntu (20.04 LTS).

@bh8ur8js
Copy link
Author

bh8ur8js commented Sep 4, 2022

@johngronow That's positive. I had a hunch or rather I was hoping that this would be the case with it working in production.

@martinstreicher
Copy link

Did anyone find the cause of this?

@bh8ur8js
Copy link
Author

bh8ur8js commented Feb 8, 2023 via email

@martinstreicher
Copy link

@bh8ur8js When you say "Upgrading to other version", are you talking about a newer Delayed Job? We are also seeing it in Ubuntu.

@dgm
Copy link

dgm commented Feb 9, 2024

I'm seeing this with Rails 7.1, running development mode on OS X. delayed_job run just sits there, I don't see any indication that it's even polling the database for jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants