laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.32k stars 10.95k forks source link

Maintenance $except not working when run with Envoy #48055

Closed LocalHeroPro closed 1 year ago

LocalHeroPro commented 1 year ago

Laravel Version

10.18.0

PHP Version

8.2.8

Database Driver & Version

No response

Description

Use Envoy to deploy app: Call maintenance mode using down --render="errors::503". Clear cache using opcache:clear. // repository: https://github.com/appstract/laravel-opcache Laravel don't recognize URL, when using Envoy. // repository: https://github.com/laravel/envoy When using Envoy, deploys are broken.

Please fix it.

Steps To Reproduce

  1. Setup in PreventRequestsDuringMaintenance class;
    protected $except = [
    '/opcache-api/*',
    '/opcache-api/clear', // or even
    ];
  2. Run deploy:
    $ php vendor/bin/envoy run deploy-stg 
  3. in @task we have
    php artisan down --render="errors::503"
    php artisan opcache:clear
  4. opcache:clear call GET https://stg.examle.com/opcache-api/clear [503] We get 503 HTML page.
    
    [user@web-1]: HTTP request returned status code 503:
    [user@web-1]: <!DOCTYPE html>
    [user@web-1]: <html lang="en">
    [user@web-1]: <meta charset="utf-8">
    [user@web-1]: <title>Example APP Service unavailable</tit (truncated...)
    [user@web-1]: at vendor/laravel/framework/src/Illuminate/Http/Client/Response.php:272
    [user@web-1]: 268▕      */
    [user@web-1]: 269▕     public function toException()
    [user@web-1]: 270▕     {
    [user@web-1]: 271▕         if ($this->failed()) {
    [user@web-1]: ➜ 272▕             return new RequestException($this);
    [user@web-1]: 273▕         }
    [user@web-1]: 274▕     }
    [user@web-1]: 276▕     /**
    [user@web-1]: +14 vendor frames 
    [user@web-1]: 15  artisan:35
    [✗] This task did not complete successfully on one of your servers.
crynobone commented 1 year ago

Hey there, thanks for reporting this issue.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?

Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

driesvints commented 1 year ago

Feel free to resubmit this issue once you have a repo ready 👍