Prestashop: Maintenance mode not working as expected

Created on 25 Nov 2020  路  5Comments  路  Source: PrestaShop/PrestaShop

Describe the bug

Maintenance message isn't shown when shop is accessed via domain name (without any suffix in url).
User can see oridinary 503 error like this:
"Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."
instead message configured in backend.

Expected behavior

Display maintenance message configured in backend.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Disable any additional languages, leave only one (very important!)
  2. Remove yours IP from maintenance whitelist.
  3. Enable maintenance mode.
  4. Go to shop via domain.com
  5. see the bug.
  6. Got o shop via domain.com/something
  7. see proper maintenance screen.

Additional information

When only one language is active, no language code is added to the URL.

Tested on a fresh, clean install.

  • PrestaShop version: 1.7.6.9
  • PHP version: 7.2
1.7.6.9 BO Bug Maintenance No change required Shop parameters

All 5 comments

Hello @mateusz-szafraniec

I didn't manage to reproduce your issue with PS 1.7.6.9, see the attached screen record below:

https://drive.google.com/file/d/14jpUK3E9qc-2Gs936Pz8uEE3M_fz6Brd/view

Please check and feedback.

Thanks!

Strange...
How to pinpoint this issue?

When i comment out line no 722 in classes/controller/FrontController.php

717     protected function displayMaintenancePage()
718     {
719         if ($this->maintenance == true || !(int) Configuration::get('PS_SHOP_ENABLE')) {
720             $this->maintenance = true;
721             if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))) {
722                 //header('HTTP/1.1 503 Service Unavailable');

Maintenanse screen is shown, but with HTTP 200 not 503.

Server is running on Ubuntu 18.04/20.4 (no matter) and Apache with FPM

HI, @mateusz-szafraniec I'm also with Apache and PHP FPM, and I'm not able to reproduce the issue.
Make sure you don't have a custom 503 handler in your apache configuration. It's maybe why it can't be reached properly.

It was a "ProxyErrorOverride On" option enabled in Apache.
Shame on me.
Thanks for help!

Thank you @PierreRambaud !

I close this issue.

Was this page helpful?
0 / 5 - 0 ratings