This content has been automatically translated from Ukrainian.
Recently, while deploying a Rails application on Coolify, I encountered an error that is not immediately obvious. Sidekiq starts, connects to Redis, but immediately crashes with the following error:
ArgumentError: wrong number of arguments (given 1, expected 0) /gems/connection_pool-3.0.2/lib/connection_pool/timed_stack.rb:62:in `pop' /gems/sidekiq-7.3.9/lib/sidekiq/scheduled.rb:226:in `initial_wait'
Reason
The connection_pool gem has been updated to version 3.0, where the API of the pop method has changed - it no longer accepts arguments. Sidekiq 7.3.x still calls it the old way, with an argument.
Bundler automatically pulls in the latest version of connection_pool, and the Sidekiq scheduler crashes immediately.
Fix
Add a version constraint in the Gemfile:
gem 'connection_pool', '~> 2.4'
Then:
bundle update connection_pool
This will install the latest compatible version (2.5.5), and Sidekiq will work correctly.
If your Sidekiq starts but immediately crashes with ArgumentError in connection_pool - check the version. This is a classic case where a transitive dependency breaks everything without any changes in your code.
This post doesn't have any additions from the author yet.