프로덕션 환경에서 메일을 보내려고 시도 중이지만 Activejob deserailization을 던지고 있습니다. error.sidekiq가 백그라운드에서 실행 중입니다. 사이드 킥 보석을 추가했습니다. comment_notification.rb에 사용자에게 전자 메일을 보내기위한 한 가지 방법을 썼습니다. 그런 다음 동작을 만들 수있는 컨트롤러에서 나는 그것은 로컬 서버에서 잘 작동 한이ActiveJob :: DeserializationError : 인수를 deserialize하려고 시도하는 중 오류가 발생했습니다.
def create
CommentNotification.send_comment_mail(@current_user).deliver_later(wait: 1.minute)
end
def send_comment_email(current_user)
mail(to: current_user.email,
:subject => "commented on post",
:from => "<[email protected]>")
end
을 추가했지만 생산에 나는
/home/apps/commentpost/shared/bundle/ruby/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/processor.rb:69:in `run'
/home/apps/commentpost/shared/bundle/ruby/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/util.rb:17:in `watchdog'
/home/apps/commentpost/shared/bundle/ruby/2.3.0/gems/sidekiq-4.2.3/lib/sidekiq/util.rb:25:in `block in safe_thread'
2016-11-18T06:47:16.162Z 19093 TID-uw66g ActionMailer::DeliveryJob JID-e56b150964abf082e78089d9 INFO: start
2016-11-18T06:47:16.167Z 19093 TID-uw66g ActionMailer::DeliveryJob JID-e56b150964abf082e78089d9 INFO: fail: 0.005 sec
2016-11-18T06:47:16.167Z 19093 TID-uw66g WARN: {"context":"Job raised exception","job":{"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"ActionMailer::DeliveryJob","job_id":"96e06bc6-1380-47b9-9393-9727868b3897","queue_name":"mailers","priority":null,"arguments":["CommentNotification","send_comment_email","deliver_later",{"_aj_globalid":"gid://commentpost/comment/40"},{"_aj_globalid":"gid://commentpost/User/20"}],"locale":"en"}],"retry":true,"jid":"e56b150964abf082e78089d9","created_at":1479450405.8364522,"enqueued_at":1479451636.1602836,"error_message":"Error while trying to deserialize arguments: Couldn't find Comment with 'id'=40","error_class":"ActiveJob::DeserializationError","failed_at":1479450405.8429642,"retry_count":6,"retried_at":1479451636.1668367},"jobstr":"{\"class\":\"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper\",\"wrapped\":\"ActionMailer::DeliveryJob\",\"queue\":\"mailers\",\"args\":[{\"job_class\":\"ActionMailer::DeliveryJob\",\"job_id\":\"96e06bc6-1380-47b9-9393-9727868b3897\",\"queue_name\":\"mailers\",\"priority\":null,\"arguments\":[\"CommentNotification\",\"send_comment_email\",\"deliver_later\",{\"_aj_globalid\":\"gid://commentpost/comment/40\"},{\"_aj_globalid\":\"gid://commentpost/User/20\"}],\"locale\":\"en\"}],\"retry\":true,\"jid\":\"e56b150964abf082e78089d9\",\"created_at\":1479450405.8364522,\"enqueued_at\":1479451636.1602836,\"error_message\":\"Error while trying to deserialize arguments: Couldn't find Comment with 'id'=40\",\"error_class\":\"ActiveJob::DeserializationError\",\"failed_at\":1479450405.8429642,\"retry_count\":5,\"retried_at\":1479450981.998904}"}
2016-11-18T06:47:16.167Z 19093 TID-uw66g WARN: ActiveJob::DeserializationError: Error while trying to deserialize arguments: Couldn't find Comment with 'id'=40
2016-11-18T06:47:16.167Z 19093 TID-uw66g WARN:/
이 사람이 의심의 여지에 대한 좀 도와 주 시겠어요이 오류는 무엇입니까? 이것을 위해 나는 감사 할 것이다.
오류를 기록 할 때, 인수를 역 직렬화하는 동안 ', 오류를 특히이 부분을 읽어 :'ID '= 40'에 코멘트 찾을 수 없습니다. 문제 해결에 대한 힌트를주지 않습니까? –
ID가 40 인 데이터베이스에 ID가 있으며 주석도 작성 중입니다. 유일한 문제는 메일이 트리거되지 않는 것입니다. – asha