Probably you have developer mode enabled. If you take a look at vendor/magento/framework/App/Http.php
, method catchException is trying to handle Exception
Unable to proceed: the maintenance mode is enabled.
thrown in vendor/magento/framework/App/Bootstrap.php
. and in the case of developer mode it is supposed to send 500 response code. In production mode handleBootstrapErrors method redirects user to errors/503.php
:
/**
* {@inheritdoc}
*/
public function catchException(Bootstrap $bootstrap, \Exception $exception)
{
$result = $this->handleDeveloperMode($bootstrap, $exception)
|| $this->handleBootstrapErrors($bootstrap, $exception)
|| $this->handleSessionException($exception)
|| $this->handleInitException($exception)
|| $this->handleGenericReport($bootstrap, $exception);
return $result;
}
/**
* Error handler for developer mode
*
* @param Bootstrap $bootstrap
* @param \Exception $exception
* @return bool
*/
private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception)
{
if ($bootstrap->isDeveloperMode()) {
if (Bootstrap::ERR_IS_INSTALLED == $bootstrap->getErrorCode()) {
try {
$this->redirectToSetup($bootstrap, $exception);
return true;
} catch (\Exception $e) {
$exception = $e;
}
}
$this->_response->setHttpResponseCode(500);
$this->_response->setHeader('Content-Type', 'text/plain');
$this->_response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString());
$this->_response->sendResponse();
return true;
}
return false;
}
/**
* Handler for bootstrap errors
*
* @param Bootstrap $bootstrap
* @param \Exception &$exception
* @return bool
*/
private function handleBootstrapErrors(Bootstrap $bootstrap, \Exception &$exception)
{
$bootstrapCode = $bootstrap->getErrorCode();
if (Bootstrap::ERR_MAINTENANCE == $bootstrapCode) {
require $this->_filesystem->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/503.php');
return true;
}
if (Bootstrap::ERR_IS_INSTALLED == $bootstrapCode) {
try {
$this->redirectToSetup($bootstrap, $exception);
return true;
} catch (\Exception $e) {
$exception = $e;
}
}
return false;
}