Random Mailer Failures
Sending the confirmation mailer in my Rails app sometimes fails randomly without raising any exception. I discover it only when I visit the dashboard, and I see the following error:
Type: ActionView::MissingTemplate Message: Missing template user_mailer/confirmation_instructions with "mailer". Searched in: * user_mailer.
It doenst do it regulary, only sometime. However, when I retry the job, it executes without any problem.
I’m simply using:
UserMailer.confirmation_instructions(@user).deliver_later And: ActionMailer::MailDeliveryJob.rescue_from(Exception) do |exception| Rails.error.report(exception) raise exception end
This doesn’t raise any error in my logs, or exception that will sent to my Mail. The failure seems completely random, and I only notice it when checking Mission Control.
I know Solid Queue doesn’t have any automatic retry mechanism, but since this is a critical system feature in my app, I need a way to automatically retry or re-send the mailer job when it fails.
Although I call the deliver_later method, the job’s arguments are set as: Arguments: UserMailer, confirmation_instructions, deliver_now, { args: [gid://.../User/bc44f55d-a73b-4e11-91e3-76329553623d] }
@Orlovic982 I notice the same error pattern in my application a while ago.
Missing template contact_mailer/send_contact with "mailer". Searched in: * "contact_mailer"
I think it might be not be a Solid Queue issue, could be Rails. Because that application I have not migrate to Solid Queue, I am using Delayed Job.
I have not found a fix so far. It happens like just ~2 times in the entire day. I just rely on Delayed Job's retry feature to resend at the moment.