sidekiq/sidekiq · critical · ArgumentError
Concurrency of #{@count} is not supported
Error message
Concurrency of #{@count} is not supported What it means
The processor Manager spawns one thread per unit of concurrency, so `Sidekiq::Manager#initialize` requires `capsule.concurrency >= 1` and raises ArgumentError otherwise. Concurrency comes from `Sidekiq.configure_server { |c| c.concurrency = ... }` (or per-capsule config); 0 or negative means no workers could run, which is almost always a misconfiguration.
Source
Thrown at lib/sidekiq/manager.rb:29
#
# 1. start: Spin up Processors.
# 3. processor_died: Handle job failure, throw away Processor, create new one.
# 4. quiet: shutdown idle Processors.
# 5. stop: hard stop the Processors by deadline.
#
# Note that only the last task requires its own Thread since it has to monitor
# the shutdown process. The other tasks are performed by other threads.
#
class Manager
include Sidekiq::Component
attr_reader :workers
attr_reader :capsule
def initialize(capsule)
@config = @capsule = capsule
@count = capsule.concurrency
raise ArgumentError, "Concurrency of #{@count} is not supported" if @count < 1
@done = false
@workers = Set.new
@plock = Mutex.new
@count.times do
@workers << Processor.new(@config, &method(:processor_result))
end
end
def start
@workers.each(&:start)
end
def quiet
return if @done
@done = true
logger.info { "Terminating quiet threads for #{capsule.name} capsule" }View on GitHub (pinned to 1bb4aa06e5)
Solutions
- Default the env var before casting: `config.concurrency = Integer(ENV.fetch('RAILS_MAX_THREADS', 5))`.
- Pass a valid value on the command line: `bundle exec sidekiq -c 10`.
- If you build capsules manually, set `capsule.concurrency = n` before the server starts.
- Add a boot-time sanity check/raise in your initializer if concurrency must come from the environment.
Example fix
// before
Sidekiq.configure_server do |config|
config.concurrency = ENV['SIDEKIQ_CONCURRENCY'].to_i # nil -> 0 -> ArgumentError
end
// after
Sidekiq.configure_server do |config|
config.concurrency = Integer(ENV.fetch('SIDEKIQ_CONCURRENCY', 10))
end Defensive patterns
Strategy: validation
Validate before calling
Sidekiq.configure_server do |config|
concurrency = Integer(ENV.fetch('SIDEKIQ_CONCURRENCY', 10))
raise ArgumentError, 'concurrency must be >= 1' if concurrency < 1
config.concurrency = concurrency
end Prevention
- Never use bare ENV[...].to_i for concurrency — use Integer(ENV.fetch('KEY', default)).
- Set required env vars in deploy manifests for every environment, and fail boot early with a clear message.
- Smoke-start sidekiq in CI/staging with the same env to catch config regressions before production.
When it happens
Trigger: Setting `config.concurrency = ENV['RAILS_MAX_THREADS'].to_i` when the env var is unset/blank (nil.to_i or ''.to_i == 0). Starting sidekiq with `-c 0`. Creating a custom capsule via `config.capsules['name'] = Sidekiq::Capsule.new('name', config)` with concurrency left at 0 or set negative. The raise happens at server boot (Launcher builds the Manager).
Common situations: Docker/Kubernetes deployments where the RAILS_MAX_THREADS/SIDEKIQ_CONCURRENCY env var is missing in one environment. Copying config between apps that use different env var names. Embedding Sidekiq and constructing capsules manually without setting concurrency.
Related errors
- Pool size too small for #{name}
- No such file #{opts[:config_file]}
- #{opt}: #{@config[opt]} is not a valid value
- Symbols only please: #{event}
- Invalid event name: #{event}
AI-assisted analysis of sidekiq/sidekiq@1bb4aa06e5 (2026-08-21).
Data as JSON: /api/errors/680e5c65052882d0.
Report an issue: GitHub.