skip to Main Content

I have rails application which is using sidekiq for background jobs. Recently upgraded ruby from 2.7.0 to 3.1.2 and respectively redis gem automatically updated to ‘5.0.5’. After this sidekiq(6.4.1) logs throws below error, if i revert to old redis version (4.6.0) in my gemlock, there is no error. Any idea what is the reason for this?

Error message:
enter image description here

2

Answers


  1. The Redis client for Ruby was recently updated and now checks command argument types strictly. Sidekiq as of 6.4.2 was passing a boolean (in your case FalseClass) in the heartbeat code, which the new Redis client rejected, hence the error. Booleans are invalid because Redis hashes don’t support type hints; Redis 4.6 and older would just quietly convert to string.

    Sidekiq has been updated to work with the new Redis client as of 6.5.x. I’m using 6.5.5 and the error is gone:

    gem 'sidekiq', '~> 6.5.5'

    Here’s the PR that introduced the fix for reference: https://github.com/mperham/sidekiq/pull/5298

    Login or Signup to reply.
  2. I came here due to a similar error. In my case it was a bad combination of Gems that had different requirements.

    I am using sidekiq-unique-jobs which (as of November 2022) does not work with Sidekiq 7. However, both this and Sidekiq require a specific version of Redis. Adding redis explicitly allowed me to update to the most recent sidekiq version that had a fix for this issue:

    gem 'sidekiq', '< 7' # 7.0 is not compatible with sidekiq-unique-jobs
    gem 'sidekiq-unique-jobs', '~> 7.1'
    gem 'redis', '~> 4' # sidekiq requires < 5
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search