Weird exception with delayed_job

Posted by Tam on Stack Overflow See other posts from Stack Overflow or by Tam
Published on 2011-01-14T04:50:08Z Indexed on 2011/01/14 4:53 UTC
Read the original article Hit count: 212

Filed under:
|

Trying to queue a job with delayed_job as follows:

Delayed::Job.enqueue(BackgroundProcess.new(current_user, object))

current_user and object are not nil when I print them out. The weird thing is that sometimes refreshing the page or running the command again works!

Here is the exception trace:

  Delayed::Backend::ActiveRecord::Job Columns (44.8ms)   SHOW FIELDS FROM `delayed_jobs`

TypeError (wrong argument type nil (expected Data)):
  /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml.rb:391:in `emit'
  /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml.rb:391:in `quick_emit'
  /Users/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/yaml/rubytypes.rb:86:in `to_yaml'
  vendor/plugins/delayed_job/lib/delayed/backend/base.rb:65:in `payload_object='
  activerecord (2.3.9) lib/active_record/base.rb:2918:in `block in assign_attributes'
  activerecord (2.3.9) lib/active_record/base.rb:2914:in `each'
  activerecord (2.3.9) lib/active_record/base.rb:2914:in `assign_attributes'
  activerecord (2.3.9) lib/active_record/base.rb:2787:in `attributes='
  activerecord (2.3.9) lib/active_record/base.rb:2477:in `initialize'
  activerecord (2.3.9) lib/active_record/base.rb:725:in `new'
  activerecord (2.3.9) lib/active_record/base.rb:725:in `create'
  vendor/plugins/delayed_job/lib/delayed/backend/base.rb:21:in `enqueue'

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about delayed-job