You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Envoyer to deploy a Laravel Octane application, taking advantage of its zero-downtime deployment features.
However, Octane currently does not support zero-downtime deployment because it does not follow symlink directories. It always remains in the actual directory (instead of the symlinked one) where the Octane server was initially started. When the outdated release directory is deleted, Octane continues running in that location, causing errors on every request and resulting in 500 response codes on the live application.
Error thrown:
Warning: require(/var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/bootstrap.php): Failed to open stream: No such file or directory in /var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/swoole-server on line 18
Fatal error: Uncaught Error: Failed opening required '/var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/bootstrap.php' (include_path='.:/usr/bin/[email protected]/8.3.16/share/[email protected]/pear') in /var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/swoole-server:18
Stack trace:
#0 /var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/swoole-server(95): {closure}(Array)
#1 [internal function]: {closure}(Object(Swoole\Http\Server), 0)
#2 /var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/swoole-server(170): Swoole\Server->start()
#3 {main}
thrown in /var/www/domain.com/releases/202502010200023/vendor/laravel/octane/bin/swoole-server on line 18
#1 [internal function]: {closure}(Object(Swoole\Http\Server), 1)
#1 [internal function]: {closure}(Object(Swoole\Http\Server), 3)
#1 [internal function]: {closure}(Object(Swoole\Http\Server), 2)
#1 [internal function]: {closure}(Object(Swoole\Http\Server), 4)
#1 [internal function]: {closure}(Object(Swoole\Http\Server), 5)
Steps To Reproduce
Use any 0-downtime deployment or test it manually using the following instructions:
Use the Swoole driver as an example.
cd one directory up from the project's base path.
Create a current symlink directory for your project using the command: ln -nsf ./octane-project-test ./current
Start the Octane server: php ./current/artisan octane:start
Copy your project to another directory: cp -R ./octane-project-test ./octane-project-test-new
Activate the new release: ln -nsf ./octane-project-test-new ./current
Reload the Octane server: php ./current/artisan octane:reload
Remove the original project directory: rm -rf ./octane-project-test
The text was updated successfully, but these errors were encountered:
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.
Octane Version
2.8.1
Laravel Version
10.48.28
PHP Version
8.3.16
What server type are you using?
Swoole
Server Version
6.0.1
Database Driver & Version
No response
Description
I'm using Envoyer to deploy a Laravel Octane application, taking advantage of its zero-downtime deployment features.
However, Octane currently does not support zero-downtime deployment because it does not follow symlink directories. It always remains in the actual directory (instead of the symlinked one) where the Octane server was initially started. When the outdated release directory is deleted, Octane continues running in that location, causing errors on every request and resulting in 500 response codes on the live application.
Error thrown:
Steps To Reproduce
Use any 0-downtime deployment or test it manually using the following instructions:
cd
one directory up from the project's base path.current
symlink directory for your project using the command:ln -nsf ./octane-project-test ./current
php ./current/artisan octane:start
cp -R ./octane-project-test ./octane-project-test-new
ln -nsf ./octane-project-test-new ./current
php ./current/artisan octane:reload
rm -rf ./octane-project-test
The text was updated successfully, but these errors were encountered: