DEV Community

loading...

Where to look when you see "Job has been attempted too many times or run too long"

Mohamed Said
Full-stack web developer working for Laravel.
Originally published at divinglaravel.com ・1 min read

If you've seen this MaxAttemptsExceededException in your error logs or failed_jobs table and you don't have a clue what happened to the job, let me try to explain what may have happened. It's either:

  1. The job timed out and it can't be attempted again.
  2. The job was released back to the queue and it can't be attempted again.

If your job processing time exceeded the timeout configuration, the worker will check the maximum attempts allowed and the expiration date for the job and decide if it can be attempted again. If that's not possible, the worker will just mark the job as failed and throw that MaxAttemptsExceededException.

Also if the job was released back to the queue and a worker picks it up, it'll first check if the maximum attempts allowed was exceeded or the job has expired and throw MaxAttemptsExceededException in that case.

Discussion (0)