There are some places in the core documentation pointing to maintenance mode and database offline (theme suggestions etc.).
So I'm not sure, if this is a bug report or feature request.

I'm not able to render fatal errors via the maintenance offline template - like an unavailable database.
The content set from drupal_log_error() in gets output: "The website encountered an unexpected error. Please try again later.<br />" (full response)
→ in Drupal 7 one was able to do so ;)


  • $config['system.logging']['error_level'] = 'hide';

Template in mytheme/templates

  • (maintenance-page.html.twig)
  • maintenance-page--offline.html.twig

Am I missing anything?


seppelM created an issue. See original summary.

kiwimind’s picture

Seeing the same thing here and haven't found a way to get it to work yet.

There's a suggestion in system_theme_suggestions_maintenance_page in core/modules/system/system.module, which looks like it should work, but doesn't.

NikLP’s picture

Yeah this does look like a bug of sorts, the folks in #drupal-uk tried all sorts of things and couldn't get a template working, even putting a forced template in core/modules/system/templates

seppelM’s picture

Like I wrote, fatal errors are directly output without any "rendering",
except within the installation process → install_display_output() which calls drupal_maintenance_theme()
(@see ~ 251)

- Maybe a plain .html file, to get around non-catchable needed services like Twig or dependent ones?
- otherwise render the --offline.html.twig which is enriched with "static" twig template variables or $config (settings.php)?

seppelM’s picture

Any update on this issue?

jenny.cha’s picture

Has anyone found an alternative solution to create a custom offline maintenance page? There hasn't been an update on this issue for about 7 months now...

cilefen’s picture

Version: 8.1.1 » 8.3.x-dev