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
[8.x] Issue with the new maintenance mode #34085
Comments
cc @driesvints |
Eh, have you moved around your directories away from the default structure? Works fine for me using a fresh Laravel app. |
No, i've tested with a fresh laravel (develop) installation |
Works fine for me. The file is DEFINITELY not in DIR.'/down'. |
I think the issue here is that it is difficult to test how this is not working as expected. All of the functionality of maintenance mode is technically working except the use case of the The reason it appears to be working is that all of the redirect, secret, and template functionality is also implemented in the I believe the best way to test this is to disable the As @arcanedev-maroc mentioned, the issue is that the |
As @willrowe mentioned above, the best way to test this issue is to disable |
To be completely clear, I believe this is indeed a bug and this issue should be re-opened. Seeing as this feature is supposed to be released today as part of v8, I am concerned that this could cause some issues when used in production that will not be caught until it is too late. I could be doing something wrong, but I think it is at least worth following the steps outlined above to test if the new maintenance mode features are indeed functioning as expected. |
i have this issues too. Laravel Version: 8.0 |
ping @driesvints |
@arcanedev-maroc I'll try to reproduce this tomorrow. |
A simple way to prove this is by adding a simple syntax error to the framework code, for instance, in web.php Maintenance.php should prevent the framework from booting as a result of a web request, but it does not. Whilst the application has any error then the end user sees a 500 error and not the intended down message. Issue should be renamed to reflect that this is only for the Pre-rendered maintenance mode view |
Checking into this again and trying to wrap my head around this. Couple of things:
If you can give me steps to reproduce this without disabling parts that the maintenance functionality obviously needs then I can look into this again. |
From my comment here: Perhaps the simplest way to see whether this is working correctly or not would be to add: var_dump('bypassing framework');
die after this block and: var_dump('using framework');
die after this block. Then you can run the down command using different options and see whether it is bypassing the framework when you expect it to. The difficulty here is that it will not be reproducible except when there is an issue with the framework not being available during a composer update or something like that, which is why the new options are supposed to bypass booting of the framework. If you are testing with the framework fully intact then it will work without any issue, so you need to test it for the case these options were made for. That is why I suggested removing the middleware, to simulate something in the framework missing. When you are bypassing the framework, it should not matter that the middleware is missing, since it should never be reached. |
A simple way to check this would be to |
@driesvints, if you read the release note about the new maintenance mode (Pre-Rendering The Maintenance Mode View)
Run <?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
*/
Route::get('/', function () {
return view('welcome');
});
abort(404); |
We've finally managed to reproduce the path error and are looking into fixing this. Thanks for reporting and your patience 👍 |
We merged #34264 |
Description:
I can't use the new maintenance mode on my machine because it's caused by this line:
The
file_exists($down = __DIR__.'/../storage/framework/down')
always returnsfalse
.Steps To Reproduce:
\App\Http\Middleware\PreventRequestsDuringMaintenance
middlewarephp artisan down --render="errors::503"
php artisan serve
Solution
I fixed the issue by replacing the path
__DIR__.'/../storage/framework/down'
by__DIR__.'/down'
The text was updated successfully, but these errors were encountered: