Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentError: wrong number of arguments (given 1, expected 2) #190

Closed
varunlalan opened this issue Jul 8, 2016 · 1 comment
Closed

Comments

@varunlalan
Copy link

varunlalan commented Jul 8, 2016

Recently, I upgraded sidekiq gem in my app. Hence, I upgraded subsequent dependent gems as well including sidekiq-unique-jobs.

Following is the snapshot of sidekiq related gems in Gemfile.lock:

screen shot 2016-07-08 at 9 01 34 pm

When I ran specs that tests one of the unique jobs, it failed giving error:

     ArgumentError:
       wrong number of arguments (given 1, expected 3)
     # ./lib/jobs/worker.rb:7:in `unique_args'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:123:in `filter_by_symbol'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:97:in `filtered_args'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:57:in `unique_args'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:24:in `block in initialize'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/logging.rb:32:in `with_context'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:20:in `initialize'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:16:in `new'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/unique_args.rb:16:in `digest'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/lock/while_executing.rb:44:in `create_digest'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/lock/while_executing.rb:12:in `initialize'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/options_with_fallback.rb:21:in `new'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/options_with_fallback.rb:21:in `lock'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/client/middleware.rb:30:in `acquire_lock'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/client/middleware.rb:26:in `disabled_or_successfully_locked?'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-unique-jobs-4.0.17/lib/sidekiq_unique_jobs/client/middleware.rb:18:in `call'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-pro-3.3.1/lib/sidekiq/batch/middleware.rb:15:in `call'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/middleware/chain.rb:133:in `invoke'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/client.rb:205:in `process_single'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/client.rb:65:in `push'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/worker.rb:116:in `client_push'
     # /Users/.rvm/gems/ruby-2.3.1/gems/sidekiq-4.1.2/lib/sidekiq/worker.rb:60:in `perform_async'

I suspect it to be because of sidekiq version. I am still debugging it but does anyone have any idea?
Is latest version of sidekiq-unique-jobs compatible with latest version of sidekiq?

@varunlalan
Copy link
Author

I was passing more than 1 arguments to self.unique_args. I changed it to pass one single argument to make it run. Following is the snapshot of the changes:

screen shot 2016-07-09 at 12 58 04 pm

Issue solved and thus closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant