laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.73k stars 288 forks source link

Fatal error: Uncaught Error: Class "Laravel\Octane\Octane" not found when using --watch #828

Closed Amirali-Bagheri closed 6 months ago

Amirali-Bagheri commented 6 months ago

Octane Version

2.3.2

Laravel Version

10.43.0

PHP Version

8.1

What server type are you using?

Swoole

Server Version

latest

Database Driver & Version

No response

Description

Issue Description:

When running Laravel Octane with the --watch option, the following error occurs: only when --watch used in supervisor config of octane, i have below error, otherwise without --watch there is no error. also without supervisor, when i run command octane start manually, have error when using --watch

Error Message:

  | 2024-01-31 13:20:36,205 WARN exited: octane_00 (exit status 255; not expected)
  | 2024-01-31 13:20:37,211 INFO spawned: 'octane_00' with pid 981
  | 2024-01-31 13:20:38,235 INFO success: octane_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
  | 
  |    INFO  Server running…
  | 
  |   Local: http://0.0.0.0:8000 
  | 
  |   Press Ctrl+C to stop the server
  | 
  | Fatal error: Uncaught Error: Class "Laravel\Octane\Octane" not found in /var/www/html/vendor/laravel/octane/src/Stream.php:57
  | Stack trace:
  | #0 /var/www/html/vendor/laravel/octane/bin/createSwooleServer.php(19): Laravel\Octane\Stream::shutdown(Object(Swoole\Exception))
  | #1 /var/www/html/vendor/laravel/octane/bin/swoole-server(35): require('/var/www/html/v...')
  | #2 {main}
  |   thrown in /var/www/html/vendor/laravel/octane/src/Stream.php on line 57

Supervisor Config:

[supervisord] logfile=/var/log/supervisord_octane.log logfile_maxbytes=40MB logfile_backups=5 loglevel=info pidfile=/var/run/supervisord_octane.pid nodaemon=true minfds=1024 minprocs=200 user=root

[program:octane] process_name=%(programname)s%(process_num)02d command=php -d variables_order=EGPCS /var/www/html/artisan octane:start --watch --server=swoole --host=0.0.0.0 --port=8000 --workers=20 --task-workers=auto --max-requests=2000 user=root autostart=true autorestart=true environment=LARAVEL_OCTANE="1" stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 numprocs=1

composer dump autoload and artisan cache clear not worked

Steps To Reproduce

When running Laravel Octane with the --watch option, the following error occurs: only when --watch used in supervisor config of octane, i have below error, otherwise without --watch there is no error. also without supervisor, when i run command octane start manually, have error when using --watch

driesvints commented 6 months ago

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.

Thanks!