While trying to debug some strange MaxAttemptsExceededException
errors, I stumbled upon a strange thing on horizon screen.
For the failed job, it shows
Attempts 5 Retries 0
which means, the job is attempted 5 times but never retried.
Is this a horizon bug? If not how can overcome this issue?
I have
'tries' => 1, 'timeout' => 360, and 'retry_after' => 420,
I’m using laravel 8.30.1 and horizon 5.7.0
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Attempts 5 Retries 0
Retries is a Horizon feature, it’s not related to tries
config or public $tries = 5;
.
Attempts: 5
means the job retried 5 times before it was be considered a “failed” job.
If you press the retry button on Horizon dashboard, you will notice that Horizon will create a new job with label Retry of 1d56c51b
and the Retries
of the previous job now is 1.
In the previous job detail, you also see the list of retries jobs.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0