Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heartbeat: Unsupported command argument type: FalseClass - Redis

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

like image 317
Rashmi Balkur Avatar asked Feb 20 '26 18:02

Rashmi Balkur


2 Answers

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

like image 162
pmv Avatar answered Feb 23 '26 07:02

pmv


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
like image 34
slhck Avatar answered Feb 23 '26 07:02

slhck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!