octane
octane copied to clipboard
base_path used in server.command (StartRoadRunnerCommand.php) breaks octane:reload when using Zero Downtime Deployments e.g. deployer
Octane Version
2.6.1
Laravel Version
11.41.3
PHP Version
8.3
What server type are you using?
Roadrunner
Server Version
2024.3.2
Database Driver & Version
No response
Description
ok this is in the borderline to be a bug but i write it anyway.
i am deploying using deployer , i suppose will happen for any Zero Downtime Deployments.
/releases/99/
/releases/100/
/releases/101/
and then a symbolic link from the latest release to /current , all pretty standard.
the problem come when running artisan octane:start
vendor/laravel/octane/src/Commands/StartRoadRunnerCommand.php
will set roadrunner server with
'-o', 'server.command='.(new PhpExecutableFinder)->find().','.base_path(config('octane.roadrunner.command', 'vendor/bin/roadrunner-worker')),
where base_path(...) will resolve to /releases/101/ not to /current
so in next deployment e.g. (/releases/102/) , when we run artisan octane:reload it will still use old /releases/101/ source code
(i checked and yes if i go back to /releases/101/ and make a change it will be present after artisan octane:reload).
the solution is very simple, in config/octane.php
you just need to add:
'roadrunner'=>[
'command' => env('OCTANE_ROADRUNNER_WORKER_PATH', base_path('vendor/bin/roadrunner-worker')),
]
OCTANE_ROADRUNNER_WORKER_PATH=../../current
would be nice is this added to config/octane.php , and maybe don't use base_path
or even better a option to provide the path in octane:start
Steps To Reproduce
deploy a octane laravel app using deployer , octane:reload will not work as expected
Thank you for reporting this issue!
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Thank you!