Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nicktenc's avatar

We are facing some what similar issue where some queued jobs or event listeners are failed with exception 'Illuminate\Database\Eloquent\ModelNotFoundException'. We are using Redis as the queue driver and these failed jobs are not falling to the failed jobs table too. This has happened randomly, like twice in the last week, so really can't figure out what is causing the ModelNotFoundException.

We can rule out the case that model doesn't exist the database, as I can confirm that data is always there. Is there any chance that worker was not able to get back to the job from Redis and then it throws exception.

Detailed explanation added here.

https://laracasts.com/discuss/channels/laravel/queueable-listeners-randomly-start-to-fail-and-dont-end-up-in-the-failed-jobs-table

Any help would be appreciated.

zapps's avatar

Had the same issue today.

7 jobs in the queue but it would stop after processing 4 queued jobs each time.

It turns out it was a memory issue. No errors given as its running out of memory and just crashing without logging anything. Had to manually restart the queues each time and it would continue to correctly process the rest of the jobs.

To be sure, I used this in the Job file to see exactly what was happening:

Log::info('Peak memory usage during job: ' . memory_get_peak_usage(true));

I got my confirmation that the jobs were maxing out the allotted memory and crashing.

So, couple of options. Either:

Increase the allotted memory of the queue, or

Just add the queue as a supervisor job with an auto restart => Opted for this as it was quick and easy.

jaguar_rave's avatar

I've two servers staging and production. Both servers have the same code and relevant .env. But when I run php artisan queue:work in staging, the jobs are not running. Works fine in production. Jobs table has the records and not attempted even once. It can't be memory issue since memory_limit in php ini is -1. Tried php artisan queue:work tries=3 timeout=5000, nothing works. Using laravel 11

Previous

Please or to participate in this conversation.