Ensure sidekiq is running?

AI-generated summary

Users are troubleshooting an issue where Sidekiq appears not to be running despite being active, causing scheduler jobs to fail. RBoy initially reported the problem, noting it began suddenly and persisted despite manual upgrades, reboots, and Redis flushes. After multiple attempts—including running Sidekiq.redis { |r| puts r.flushall }, restarting the app via sudo ./launcher restart app, and rebooting—the issue resolved, though logs remained empty. hellekin criticized the solution for lacking clarity and requiring a reboot, expressing concern about reliability. RBoy agreed, admitting uncertainty about the root cause. Stranik sought clear steps, prompting RBoy to outline a procedure: upgrade to the latest version (e.g., +101), flush Redis via Rails console, restart the app, and reboot—repeating if needed. Alternatives include waiting 24 hours for the scheduler to auto-recover or manually triggering Jobs::VersionCheck via yourwebsite/sidekiq. fefrei endorsed waiting or manual triggering, avoiding Rails console changes. hellekin confirmed success after upgrading to v1.9.0.beta2 +98 without rebooting, suggesting the issue may be resolved in newer versions without drastic measures.

This started today out of the blue.

I’ve searched the forum and tried all this:

  1. Upgrading manually to the latest git and rebuilding the app
  2. Rebooting the machine as @codinghorror suggested
  3. Checked diskspace, over 20GB free
  4. Trying what @clay suggested - trying to flush the queue (and then restarted and EVEN rebooting the machine) and I got:

[1] pry(main)> Sidekiq.redis { |r| puts r.flushall }
Passing ‘flushall’ command to redis as is; administrative commands cannot be effectively namespaced and should be called on the redis connection directly; passthrough has been deprecated and will be removed in redis-namespace 2.0 (at (pry):1:in `block in pry’)
OK
=> nil

Taking my clues from here, nothing seems to work. Any ideas what’s going on and how to fix it?

Here’s what finally worked:

I ran this again
Sidekiq.redis { |r| puts r.flushall }

Then I restarted the app
sudo ./launcher restart app

Then I rebooted the machine (again)

And now it started working.

Oddly, my logs are completely empty.

I have the same issue. This ‘solution’ is not satisfying since:

  • it does not tell why this happened.
  • it does not make clear which steps are required, and what they do exactly.
  • it requires a reboot!!!

I would expect restart to fix it, and I certainly do not plan on rebooting the machine.

I would agree, I really don’t know why it happened and what exactly fixed it. Just that repeating the steps over a few times and rebooting a few times fixed it, but like you said I’m not convinced that’s the long term solution.

Hello. So what actions should I take?

First upgrade to the latest version (there are some new patches related to this I think that went in a few hours ago). Open yourwebsite/admin/upgrade and upgrade to the latest version (+101 is working for me now, so you’re good there)

Then from the terminal

cd /var/discourse
sudo ./launcher enter app
rails c
Sidekiq.redis { |r| puts r.flushall }
exit
exit
sudo ./launcher restart app

Then reboot the machine. I did this loop 2 times and it solved the issue.

I think someone also mentioned you can try a few things

  1. Leave it for 24 hours and the scheduler should kick off again and this error should go away
  2. Force the schedules to start, open yourwebsite/sidekiq, goto scheduler and trigger the schedule Jobs::VersionCheck

Yeah, simply updating and waiting 24 hours (or manually triggering Jobs::VersionCheck in the web UI as you suggested) should suffice, no messing within Rails necessary :slight_smile:

I simply upgraded to the latest version (now running v1.9.0.beta2 +98), and didn’t have to reboot.