laravel / octane

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

Cannot reload Laravel Octane #530

Closed PHPGuus closed 2 years ago

PHPGuus commented 2 years ago

Description:

php8.0 artisan octane:reload fails with the following output:

forge@snowy-farm:~/test.itpassion-testing.com$ php8.0 artisan octane:reload

   INFO  Reloading workers...

   RuntimeException

  Cannot reload RoadRunner: 2022/05/26 15:55:56 resetting plugin: [http]

  at vendor/laravel/octane/src/RoadRunner/ServerProcessInspector.php:57
     53▕             '-o', "rpc.listen=tcp://$host:$rpcPort",
     54▕         ], base_path()))->start()->waitUntil(function ($type, $buffer) {
     55▕                //echo $buffer;
     56▕             if ($type === Process::ERR) {
  ➜  57▕                 throw new RuntimeException('Cannot reload RoadRunner: '.$buffer);
     58▕             }
     59▕
     60▕             return true;
     61▕             //return false;

      +18 vendor frames
  19  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

I believe this is due to the fact this version of RoadRunner is now outputting two lines, and somehow the Symfony process is sending a Process::ERR type instead of waiting for further output.

When I run the reset manually, the full output from the rr command is:

forge@snowy-farm:~/test.itpassion-testing.com$ ./rr reset -o rpc.listen=tcp://127.0.0.1:6001
2022/05/26 15:57:39 resetting plugin: [http]
2022/05/26 15:57:39 plugin reset: [http]

Steps To Reproduce:

  1. Clone repo https://github.com/itpassion-ltd/laravel-octane-test
  2. composer install
  3. go through setup steps for Laravel Octane
  4. run php artisan octane:start
  5. run php artisan octane:reload
nunomaduro commented 2 years ago

Thank you for the detailed issue, Guuske.

Please update to the latest version of Octane: v1.2.11.

The issue was fixed here: https://github.com/laravel/octane/pull/525.