skip to Main Content

This error makes no sense because brpoplpush in Ruby Redis 5.0.5 expects three arguments, and Sidekiq Pro 5.5.2 calls brpoplpush with three arguments on line 355 of lib/sidekiq/pro/super_fetch.rb:

      result = conn.brpoplpush(queue, working_queue, config[:fetch_timeout] || 1)

Here is the error in Sentry:

enter image description here

From our Gemfile.lock:

sidekiq-pro (5.5.2)
  sidekiq (>= 6.5.0)

redis (5.0.5)
  redis-client (>= 0.9.0)

2

Answers


  1. The signature on that method includes a named argument timeout which defaults to 0. Ruby will accept a hash at end of the list of arguments, but not an Integer or similar.

    I suspect config[:fetch_timeout] is nil, therefore the value of 1 is being passed, thus the error message.

    Maybe see where config[:fetch_timeout] is being set and make sure it contains a hash value like { timeout: 1 }.

    If you want to get your head around why you get that particular error message, consider this method:

    def foo(a, test: 1)
      puts test
    end
    

    Calling foo(1, 1) will trigger a (wrong number of arguments (given 2, expected 1)) error, whereas foo(1, test: 2) will work.

    Login or Signup to reply.
  2. Yes, the issue you’re seeing is a gem incompatibility.

    If you upgrade to sidekiq 6.5.8, the redis version will be constrained automatically:

         sidekiq (6.5.8)
          connection_pool (>= 2.2.5, < 3)
          rack (~> 2.0)
          redis (>= 4.5.0, < 5)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search