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

[8.x] Fixing the new maintenance mode #34264

Merged
merged 1 commit into from Sep 11, 2020
Merged

[8.x] Fixing the new maintenance mode #34264

merged 1 commit into from Sep 11, 2020

Conversation

arcanedev-maroc
Copy link
Contributor

@arcanedev-maroc arcanedev-maroc commented Sep 10, 2020

  • Laravel Version: 8.x
  • PHP Version: 7.4.9
  • Database Driver & Version: none

Description:

I can't use the new maintenance mode on my machine because it's caused by this line:

<?php
// storage/framework/maintenance.php

// Check if the application is in maintenance mode...
if (! file_exists($down = __DIR__.'/../storage/framework/down')) { // <-------------- this one
    return;
}

// The rest of the file...

The file_exists($down = __DIR__.'/../storage/framework/down') always returns false.

Steps To Reproduce:

  • Disable/comment the \App\Http\Middleware\PreventRequestsDuringMaintenance middleware in Http Kernel
  • Run php artisan down --render="errors::503"
  • Visit the website
  • You should see the maintenance page even the middleware is disabled

Related: #34085

@taylorotwell
Copy link
Member

taylorotwell commented Sep 10, 2020

The down file does not live in the same directory as index.php.

@arcanedev-maroc
Copy link
Contributor Author

arcanedev-maroc commented Sep 10, 2020

@taylorotwell I'm not editing public/index.php.

This is about storage/framework/maintenance.php file which is located in the same folder as down file.

Check here: https://github.com/laravel/framework/blob/8.x/src/Illuminate/Foundation/Console/DownCommand.php#L44-L52

@arcanedev-maroc
Copy link
Contributor Author

arcanedev-maroc commented Sep 10, 2020

@arcanedev-maroc
Copy link
Contributor Author

arcanedev-maroc commented Sep 11, 2020

Hi @driesvints, can you check this PR & explain the issue to @taylorotwell ?

It seems he doesn't replies to my comments

@driesvints
Copy link
Member

driesvints commented Sep 11, 2020

Please reply to #34085 (comment) so we can focus the discussion in one place.

@laravel laravel locked and limited conversation to collaborators Sep 11, 2020
@taylorotwell taylorotwell reopened this Sep 11, 2020
@taylorotwell taylorotwell merged commit e5af441 into laravel:8.x Sep 11, 2020
6 of 7 checks passed
@taylorotwell
Copy link
Member

taylorotwell commented Sep 11, 2020

Yep, this is correct. Sorry about that.

@laravel laravel unlocked this conversation Sep 11, 2020
@arcanedev-maroc arcanedev-maroc deleted the patch-1 branch Sep 11, 2020
@willrowe
Copy link
Contributor

willrowe commented Sep 11, 2020

Thanks for taking a look @taylorotwell and @driesvints. This was a confusing one for sure!

@kristijorgji
Copy link

kristijorgji commented Jul 29, 2021

The maintenancemodeexception was better then HttpException here, also including data like availableAt.

Will that be returned back ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants