1
votes

I'm having a problem with my Rails server that's running in production on Heroku. Just recently, my Sidekiq jobs have stopped processing, and Sidekiq seems to be stuck in some sort of 'idle' state:

enter image description here

I've been running around on the internet all morning, but I can't seem to find any good resources for debugging this. If someone can point me in the right direction, I would really appreciate it.

Relevant Versioning:

Ruby    '2.5.8'
Rails   '5.2.4.4'
Sidekiq '6.1.2'
Redis   '4.2.0'

Relevant Config Vars:

REDIS_PROVIDER=REDISTOGO_URL
REDISTOGO_URL=redis://redistogo:[secret]@crestfish.redistogo.com:11137/
REDIS_URL=redis://redistogo:[secret]@crestfish.redistogo.com:11137/

Sidekiq.yml

:concurrency: 5
staging:
  :concurrency: 10
production:
  :concurrency: 10
:queues:
  - [default, 1]

initializers/sidekiq.rb

Sidekiq.configure_client do |config|
  config.redis = { url: ENV["REDIS_URL"] }
end

initializers/redis.rb

REDIS = Redis.new(uri: URI.parse(ENV["REDIS_URL"] || "redis://localhost:6379/"))

Any help would be greatly appreciated. Thank you!

1
Quick update on this. I tracked down what exactly makes the UI take on that idle state. It comes from this code: workers.size == 0 ? "idle" : "active". Looking into that now.o037

1 Answers

0
votes

Okay I figured this out. The problem was that the Redis version being run in Heroku (through RedisToGo) was using Redis 3.2, not the 4.2.0 that was in my Gemfile.

I figured this out by eventually checking the Heroku logs, which I should have done way sooner, of course. When I restarted my dynos, I got an error like this one.

Solution for me was to downgrade my Sidekiq to version 5.2.9, since it was more expedient to do that than to change Redis providers in production (RedisToGo doesn't support Redis 4 yet).