All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

Sidekiq 7.3.x and connection_pool 3.0 - incompatibility that breaks workers

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.

What is a B-Tree (Balanced Tree)?
22 Nov 12:58

What is a B-Tree (Balanced Tree)?

Нотатки про Ruby та RoR
Нотатки про Ruby та RoR@kovbaska
Fix for the issue of installing Ruby 3.4.3 (and not only) via RVM on macOS (Apple Silicon)
30 Dec 14:05

Fix for the issue of installing Ruby 3.4.3 (and not only) via RVM on macOS (Apple Silicon)

Нотатки про Ruby та RoR
Нотатки про Ruby та RoR@kovbaska
Thundering Herd Problem: what it is and why it breaks production
15 Jan 10:14

Thundering Herd Problem: what it is and why it breaks production

Нотатки про Ruby та RoR
Нотатки про Ruby та RoR@kovbaska
What is Exponential Backoff and Random Jitter?
15 Jan 15:24

What is Exponential Backoff and Random Jitter?

Нотатки про Ruby та RoR
Нотатки про Ruby та RoR@kovbaska
Connecting the Elasticsearch service to a Rails application (Coolify in the cloud, server on Hetzner).
15 Feb 13:45

Connecting the Elasticsearch service to a Rails application (Coolify in the cloud, server on Hetzner).

Нотатки про Ruby та RoR
Нотатки про Ruby та RoR@kovbaska
"No space left on device" - when Docker has consumed the entire disk
15 Feb 19:57

"No space left on device" - when Docker has consumed the entire disk

Нотатки про Ruby та RoR
Нотатки про Ruby та RoR@kovbaska