Coursemology/coursemology.org

NoMethodError: undefined method `id' for nil:NilClass

jsyeo opened this issue · 0 comments

View details in Rollbar: https://rollbar.com/jsyeo/coursemology.org/items/83/


NoMethodError: undefined method `id' for nil:NilClass
  File "/home/raymoond/jenkins/workspace/coursemology_second/app/models/user_course.rb", line 188, in check_achievement
  File "/home/raymoond/jenkins/workspace/coursemology_second/app/jobs/background_job.rb", line 111, in block in check_achievement
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.14/lib/active_record/associations/collection_proxy.rb", line 89, in each
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/activerecord-3.2.14/lib/active_record/associations/collection_proxy.rb", line 89, in method_missing
  File "/home/raymoond/jenkins/workspace/coursemology_second/app/jobs/background_job.rb", line 109, in check_achievement
  File "/home/raymoond/jenkins/workspace/coursemology_second/app/jobs/background_job.rb", line 25, in perform
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/backend/base.rb", line 105, in block in invoke_job
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/rollbar-1.3.1/lib/rollbar/delayed_job.rb", line 9, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/rollbar-1.3.1/lib/rollbar/delayed_job.rb", line 9, in block in wrap_worker
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in block (2 levels) in add
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in block in initialize
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in block in add
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 65, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 65, in execute
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 38, in run_callbacks
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/backend/base.rb", line 102, in invoke_job
  File "(eval)", line 3, in block in invoke_job_with_newrelic_transaction_trace
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/newrelic_rpm-3.9.1.236/lib/new_relic/agent/instrumentation/controller_instrumentation.rb", line 364, in perform_action_with_newrelic_trace
  File "(eval)", line 2, in invoke_job_with_newrelic_transaction_trace
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 207, in block (2 levels) in run
  File "/home/raymoond/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb", line 91, in block in timeout
  File "/home/raymoond/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb", line 101, in call
  File "/home/raymoond/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/timeout.rb", line 101, in timeout
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 207, in block in run
  File "/home/raymoond/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/benchmark.rb", line 294, in realtime
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 206, in run
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 274, in block in reserve_and_run_one_job
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in block in initialize
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 65, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 65, in execute
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 38, in run_callbacks
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 274, in reserve_and_run_one_job
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 190, in block in work_off
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 189, in times
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 189, in work_off
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 154, in block (4 levels) in start
  File "/home/raymoond/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/benchmark.rb", line 294, in realtime
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 153, in block (3 levels) in start
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in block in initialize
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 65, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 65, in execute
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 38, in run_callbacks
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 152, in block (2 levels) in start
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 151, in loop
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/worker.rb", line 151, in block in start
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/plugins/clear_locks.rb", line 7, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/plugins/clear_locks.rb", line 7, in block (2 levels) in <class:ClearLocks>
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in block (2 levels) in add
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 60, in block in initialize
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/lib/delayed/lifecycle.rb", line 78, in call
  File "/home/raymoond/.rvm/gems/ruby-2.1.2/gems/delayed_job-4.0.2/l