laravel has been attempted too many times or run too long. The job may have previously timed out error fix
Hmm, hmm... An error occurred! Well, I looked all over and tried everything, but couldn't fix it. When I found the cause, I saw that it appeared like that after
GGAMI·
Hmm, hmm...
laravel has been attempted too many times or run too long. The job may have previously timed out
An error occurred!
Well, I looked all over and tried everything, but couldn't fix it. When I found the cause, I saw that it appeared like that after 90 seconds—but the Queue was processed normally!
Wow, I kept searching, wondering, “Is this just pointlessly piling up in the logs? Why???”
I had Queue jobs that ran for longer than I expected—around 3–5 minutes.
I searched on Google and found that switching to Redis would fix it, so I tried switching the queue to Redis.
In the config/queue.php file above, redis retry_after is probably set to 90.
(Ah~ the image isn't uploading again... what am I supposed to do about the WordPress permissions?)
The problem that arises right here is this: when Redis receives queues:default:reserved, the score—that is, the expiration time—is set to 90 seconds.
In other words, when a queue is reserved and added to Redis, the final expiration time is 90 seconds (it seems to be fixed no matter what, and uses the retry_after value set in queue.php as is...)
Anyway, no matter how much you configure the two values above, you'll run into problems if they're lower than the retry_after value set in Redis's queue.php.
You must make sure the retry_after value is greater than either of the two option values above or the timeout value used when running the queue.
I can't believe I didn't know this one thing all this time while using queues... Good grief...
Also... instead of setting retry_after, since the timeout is probably different for each queue... is it possible to set retry_after for each queue? Hmm... It seems like there should be a way, but maybe there isn't... It might turn up if I look further, but based on what I found by Googling, it seems like there might not be...
So, since I use the --timeout 1800 option with queue:work,
I changed the retry_after value for Redis in queue.php to 1860...