Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base_path used in server.command (StartRoadRunnerCommand.php) breaks octane:reload when using Zero Downtime Deployments e.g. deployer #996

Open
inikoo opened this issue Feb 13, 2025 · 1 comment

Comments

@inikoo
Copy link

inikoo commented Feb 13, 2025

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

inikoo added a commit to Inikoo-Ltd/aiku that referenced this issue Feb 13, 2025
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants