framework: Jobs randomly result in composer load class fail without even trying to process it
- Laravel Version: 9.5.1
- PHP Version: 8.1.3
- Database Driver & Version: PGSQL (12.9)
- Queue driver: Redis (with 8 workers on queue “low”)
Description:
Random instances of the same Job lead to composer autoload error. (Failed to open stream: No such file or directory). I use pm2 to create the workers, the job doesn’t even appear at the screen, just print directly in the storage/logs/laravel.log
Job code: https://prnt.sc/pCtZMRf8Er9f (The backoff seems to work)
First error: https://prnt.sc/om8PCthikwEs Second error (after some tries to fix it): https://prnt.sc/o7EIa2qW6wYO
Storage/logs: https://prnt.sc/P5CL-MkAl5jq
Steps To Reproduce:
Unfortunately I can’t reference a repository. The error seems too much random to replicate, sometimes I can run 20 jobs in a row flawless, I tried to test it on my local machine, but the WSL always give a curl timedout.
(The error also happens when I dispatch multiple empty jobs) https://prnt.sc/7z9myHScPrTh After running 3000 jobs on 8 workers, I got 8140 lines of logs of:
include(/home/ubuntu/backend/vendor/composer/../facade/ignition/src/QueryRecorder/Query.php): Failed to open stream: No such file or directory
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (7 by maintainers)
So for anyone facing a similar issue. The problem was some caching happening with Octane or PHP opcache. This happened when OP upgraded from Laravel 8.x to 9.x and the composer class loader file was somehow cached and after a full restart of the server the problem is no longer happening.
You want to continue this on discord? Let’s not spam the issue and I will try to help you debug it?