title: How to debug sidekiq?
body: <p>Today airbrake reported an exception. Its summary said that the problem occures when sidekiq tries retry the job after a failure. Here's what summary params look like:</p>
  
  <pre><code>{
   "retry"=&gt;"true",
   "queue"=&gt;"default",
   "class"=&gt;"AdwordsReportWorker",
   "args"=&gt;"[\"2\", \"2012-11-13\"]",
   "jid"=&gt;"51d568e46c412adc327153c8",
   "error_message"=&gt;"wrong number of arguments(1 for 0)",
   "error_class"=&gt;"ArgumentError",
   "failed_at"=&gt;"2012-11-14 13:56:12 UTC",
   "retry_count"=&gt;"0",
   "controller"=&gt;"",
   "action"=&gt;""
  }
  </code></pre>
  
  <p>I seems that the exception is only taking palce when the job fails and retries. I would like to debug this, but I can't get my head around where to start :-(</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Under what conditions worker understands it <strong>failed</strong> finishing the job (from which he descides to retry)? How do I force the worker to fail in attempt to, say, reproduce the problem?</li>
  <li>Is there a good tutorial on debugging/examples sidekiq workers?</li>
  <li>I am using <strong>sidekiq 2.3.3</strong>. Will upgrading to newer version solve the problem?</li>
  </ol>
  
  <p><strong>Bonus track</strong>.
  The <a href="http://pastie.org/private/yccpaccwnc0mdzohkptl5a" rel="nofollow">actual stacktrace</a> unexpectedly ends up in </p>
  
  <pre><code>[GEM_ROOT]/gems/activerecord-3.2.8/lib/active_record/associations/association.rb:98:in `initialize'
  </code></pre>