rails - Delayed Job - лучший способ отладки неудачной работы - PullRequest
0 голосов
/ 31 декабря 2010

Я уже некоторое время использую отложенную работу без проблем в моем приложении 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 Ответ

1 голос
/ 31 декабря 2010

trace it ...

строка 13 user_mailer.rb строка 33 user_mailer.rb

Вы пытаетесь использовать приложение, но оно не определено.Возможно, вам понадобится добавить

include 'attachment' к вашему почтовому классу

...