{"action":"created","issue":{"url":"https://api.github.com/repos/mperham/sidekiq/issues/1356","labels_url":"https://api.github.com/repos/mperham/sidekiq/issues/1356/labels{/name}","comments_url":"https://api.github.com/repos/mperham/sidekiq/issues/1356/comments","events_url":"https://api.github.com/repos/mperham/sidekiq/issues/1356/events","html_url":"https://github.com/mperham/sidekiq/issues/1356","id":23029937,"number":1356,"title":"Workers fail with ruby 2.0 keyword arguments in the perform method","user":{"login":"jeremyhaile","id":382334,"avatar_url":"https://avatars.githubusercontent.com/u/382334?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremyhaile","html_url":"https://github.com/jeremyhaile","followers_url":"https://api.github.com/users/jeremyhaile/followers","following_url":"https://api.github.com/users/jeremyhaile/following{/other_user}","gists_url":"https://api.github.com/users/jeremyhaile/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyhaile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyhaile/subscriptions","organizations_url":"https://api.github.com/users/jeremyhaile/orgs","repos_url":"https://api.github.com/users/jeremyhaile/repos","events_url":"https://api.github.com/users/jeremyhaile/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyhaile/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2013-11-20T22:37:14Z","updated_at":"2015-03-05T21:04:57Z","closed_at":"2013-11-21T00:25:34Z","body":"My worker has a perform method that uses ruby 2.0 keyword arguments:\r\n```ruby\r\ndef perform(user_id: nil, send_notification: false)\r\n```\r\n\r\nThis is then called with:\r\n```ruby\r\nMyWorker.perform_async(user_id: current_user._id, send_notification: true)\r\n```\r\n\r\nSidekiq shows the following options in the web console: (which is correct)\r\n```\r\n{\"user_id\"=>\"4f2ab6349d285906d800000a\", \"send_notification\"=>true}\r\n```\r\n\r\nHowever, the job fails with the following error:\r\n```\r\nWARN: wrong number of arguments (1 for 0)\r\nWARN:my_worker.rb:3:in `perform'\r\nsidekiq-2.16.1/lib/sidekiq/processor.rb:48:in `block (3 levels) in process'\r\n```\r\n\r\nI've played around with adding an initial argument and also keyword arguments. But that then fails with the same error, but just (2 for 1)\r\n\r\nBasically it seems that the Sidekiq introspection code doesn't see the keyword argument at all and fails."},"comment":{"url":"https://api.github.com/repos/mperham/sidekiq/issues/comments/77451419","html_url":"https://github.com/mperham/sidekiq/issues/1356#issuecomment-77451419","issue_url":"https://api.github.com/repos/mperham/sidekiq/issues/1356","id":77451419,"user":{"login":"bshyong","id":303289,"avatar_url":"https://avatars.githubusercontent.com/u/303289?v=3","gravatar_id":"","url":"https://api.github.com/users/bshyong","html_url":"https://github.com/bshyong","followers_url":"https://api.github.com/users/bshyong/followers","following_url":"https://api.github.com/users/bshyong/following{/other_user}","gists_url":"https://api.github.com/users/bshyong/gists{/gist_id}","starred_url":"https://api.github.com/users/bshyong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bshyong/subscriptions","organizations_url":"https://api.github.com/users/bshyong/orgs","repos_url":"https://api.github.com/users/bshyong/repos","events_url":"https://api.github.com/users/bshyong/events{/privacy}","received_events_url":"https://api.github.com/users/bshyong/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T21:04:57Z","updated_at":"2015-03-05T21:04:57Z","body":"+1"}}