laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.63k stars 11.03k forks source link

ErrorException: require(/var/www/public/bootstrap/cache/routes-v7.php) failed for cached routes file: No such file or directory in very high demand scenario #53602

Closed jbidad closed 1 day ago

jbidad commented 1 day ago

Laravel Version

11.23.5

PHP Version

8.3

Database Driver & Version

MySQL 8.0.31

Description

update #53577

Steps To Reproduce

  1. Deploy the application in a production environment.
  2. Use route caching by running php artisan route:cache.
  3. Trigger the deployment using a CI/CD pipeline (e.g., GitHub Actions, GitLab CI/CD).
  4. Introduce a high-load scenario during or immediately after deployment (e.g., concurrent requests to the application or commands being executed). Here there are two possible scenarios: a. if the deployment process is performed on the production directory, while the old cache has been replaced by the run command(route:cache) one of the requests detects the cached file has existed but when it wants to use require method to included in project cached the mentioned error; b. The second one occurred when using the rsync command to sync CI\CD directory within production one, Like the last scenario, the cache file existence has been passed, but when it wants to use require method to include it in the project cached the mentioned error;
crynobone commented 1 day ago

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question which may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repository you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.