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

Maintenance $except not working when run with Envoy #48055

Closed
LocalHeroPro opened this issue Aug 13, 2023 · 2 comments
Closed

Maintenance $except not working when run with Envoy #48055

LocalHeroPro opened this issue Aug 13, 2023 · 2 comments

Comments

@LocalHeroPro
Copy link

LocalHeroPro commented Aug 13, 2023

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
];
  1. Run deploy:
$ php vendor/bin/envoy run deploy-stg 
  1. in @task we have
php artisan down --render="errors::503"
php artisan opcache:clear
  1. opcache:clear call GET https://stg.examle.com/opcache-api/clear [503]
    We get 503 HTML page.
[user@web-1]: Illuminate\Http\Client\RequestException
[user@web-1]: HTTP request returned status code 503:
[user@web-1]: <!DOCTYPE html>
[user@web-1]: <html lang="en">
[user@web-1]: <head>
[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]: 275▕
[user@web-1]: 276▕     /**
[user@web-1]: +14 vendor frames 
[user@web-1]: 15  artisan:35
[user@web-1]: Illuminate\Foundation\Console\Kernel::handle()
[✗] This task did not complete successfully on one of your servers.
@crynobone
Copy link
Member

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
Copy link
Member

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

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

3 participants