rails - 延迟作业 - 调试失败作业的最佳方法

时间:2010-12-30 22:30:24

标签: ruby-on-rails amazon-s3 ruby-on-rails-3 paperclip delayed-job

我一直在使用延迟工作一段时间我的rails 3 heroku应用程序没有问题。然后前几天它在所有工作上都出错了。现在我对最后一次错误的延迟工作记录感到困惑,但仍坚持如何调查解决。

这是错误:

>> Delayed::Job.find(:last)
=> #<Delayed::Backend::ActiveRecord::Job id: 411, priority: 0, attempts: 15, handler: "--- !ruby/struct:Delayed::PerformableMailer \nobject...", last_error: "{uninitialized constant Attachment::AWS\n/disk1/home...", run_at: "2010-12-31 06:32:52", locked_at: nil, failed_at: nil, locked_by: nil, created_at: "2010-12-29 04:58:45", updated_at: "2010-12-30 16:29:02">
>> 


>> Delayed::Job.find(:last).last_error
=> "{uninitialized constant Attachment::AWS\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/app/models/attachment.rb:53:in `authenticated_url'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/app/mailers/user_mailer.rb:33:in `conversation_notification'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_collection.rb:430:in `method_missing'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_proxy.rb:216:in `method_missing'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_proxy.rb:216:in `each'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_proxy.rb:216:in `send'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_proxy.rb:216:in `method_missing'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.0/lib/active_record/associations/association_collection.rb:430:in `method_missing'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/app/mailers/user_mailer.rb:31:in `conversation_notification'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/abstract_controller/base.rb:150:in `send_action'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/abstract_controller/base.rb:150:in `process_action'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/abstract_controller/base.rb:119:in `process'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionpack-3.0.0/lib/abstract_controller/rendering.rb:40:in `process'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionmailer-3.0.0/lib/action_mailer/old_api.rb:75:in `process'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionmailer-3.0.0/lib/action_mailer/base.rb:446:in `process'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionmailer-3.0.0/lib/action_mailer/base.rb:441:in `initialize'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionmailer-3.0.0/lib/action_mailer/base.rb:425:in `new'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/actionmailer-3.0.0/lib/action_mailer/base.rb:425:in `method_missing'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/performable_mailer.rb:6:in `send'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/performable_mailer.rb:6:in `perform'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/backend/base.rb:83:in `invoke_job'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:119:in `run'\\n/usr/ruby1.8.7/lib/ruby/1.8/timeout.rb:62:in `timeout'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:119:in `run'\\n/usr/ruby1.8.7/lib/ruby/1.8/benchmark.rb:308:in `realtime'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:118:in `run'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:176:in `reserve_and_run_one_job'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:103:in `work_off'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:102:in `times'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:102:in `work_off'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:77:in `start'\\n/usr/ruby1.8.7/lib/ruby/1.8/benchmark.rb:308:in `realtime'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:76:in `start'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:73:in `loop'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/worker.rb:73:in `start'\\n/disk1/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/bundler/gems/delayed_job-411719b38c51/lib/delayed/tasks.rb:9\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'\\n/usr/ruby1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'\\n/home/slugs/352624_9970c44_cd2f-0b8c1103-1ec8-4148-87c9-4d0a96679fd8/mnt/.bundle/gems/ruby/1.8/gems/rake-0.8.7/bin/rake:31\\n/usr/ruby1.8.7/bin/rake:19:in `load'\\n/usr/ruby1.8.7/bin/rake:19"
>> 

您是否有任何提示可以帮助我指出正确的方向来解决错误?

1 个答案:

答案 0 :(得分:1)

追踪它......

user_mailer.rb的第13行 user_mailer.rb的第33行

您正在尝试使用附件,但未定义。您可能需要添加

在邮件程序类中加入“附件”