Sidekiq-status throws error only on Upstash Redis, but is working fine with Redis on Heroku and Aiven

The error happens when calling the store method from Sidekiq-status.

For example, in Rails console:

include Sidekiq::Worker
include Sidekiq::Status::Worker
store(a: 3)

Gets

Exception object expected

However, the app is working just fine on Heroku with its builtin Redis addon, and it’s also fine on fly.io with Avien Redis. Therefore I assume there must be something wrong when interacting with Upstash Redis.

I tried to reproduce, but here is the results I’m getting:

I added the following to a Dockerfile for a minimal application:

RUN bundle add sidekiq-status

Once deployed, I ran rails console:

Loading production environment (Rails 7.0.4)
irb(main):001:0> include Sidekiq::Worker
=> Object
irb(main):002:0> include Sidekiq::Status::Worker
irb(main):003:0> store(a: 3)
2022-12-26T01:23:54.280Z pid=540 tid=2u0 INFO: Sidekiq 7.0.2 connecting to Redis with options {:size=>5, :pool_name=>"internal", :url=>"redis://default:REDACTED@fly-dawn-smoke-700-redis.upstash.io"}
/usr/local/bundle/gems/redis-client-0.11.2/lib/redis_client/command_builder.rb:37:in `block in generate': Unsupported command argument type: NilClass (TypeError)

Thanks.

I tried a million combinations but none worked. I ended up going with self-hosting Redis on fly.io, following the guide from you in another thread. It finally worked but the process was really cumbersome. I wish there could be an easy way to add addons like Heroku.

By the way, how does the pricing work if I have three things in the Procfile (web, sidekiq and redis)? It’s a bit confusing.

Hey,

Exception object expected error is caused by a bug which happens when a publish command is called inside a multi transaction and client is connected to a backup replica. See the actual store code in sidekiq-status: sidekiq-status/storage.rb at 1326c2872d1ce726d089e29427f35acdad818643 · kenaniah/sidekiq-status · GitHub
On both fly.io and aws, Upstash databases are deployed as multi-zone replicas even with a single region setup.

This issue was reported on Upstash Discord channel before (see Discord) and fix is being deployed to all regions gradually. It will be deployed to fly.io in a few days hopefully.

Btw, the error Unsupported command argument type: NilClass (TypeError) in the message from @rubys above is a different one. It happens when sidekiq-status is used when sidekiq 7 (see issue Sidekiq 7 support · Issue #20 · kenaniah/sidekiq-status · GitHub).

1 Like