DEV Community

Daniele Michelin
Daniele Michelin

Posted on Originally published at daniele-michelin.com

Nextcloud stuck in maintenance mode: how to fix

Nextcloud is in maintenance mode and blocks the web UI, clients and most occ commands – either set on purpose or left behind by an update that did not finish cleanly.

Common causes

  • The web updater or a package update was aborted and occ upgrade never completed.
  • A backup script enabled maintenance mode and failed before turning it off.
  • 'maintenance' => true is still set in config/config.php.
  • Wrong file ownership after the update, so occ cannot write config.php.

How to check it

Show status and versions

sudo -u www-data php /var/www/nextcloud/occ status
Enter fullscreen mode Exit fullscreen mode

Check maintenance in the config

grep -n maintenance /var/www/nextcloud/config/config.php
Enter fullscreen mode Exit fullscreen mode

Latest errors in the Nextcloud log

tail -n 20 /var/www/nextcloud/data/nextcloud.log
Enter fullscreen mode Exit fullscreen mode

What actually helps

  1. Finish the pending upgrade: sudo -u www-data php occ upgrade.
  2. Then turn it off: sudo -u www-data php occ maintenance:mode --off.
  3. Stuck web updater: remove the .step file in data/updater-*/ and rerun the update with php updater/updater.phar.

FAQ

Can I just set maintenance to false in config.php?

Yes, but only if no upgrade is pending. Otherwise Nextcloud shows the update page or errors afterwards. Check occ status first.

How is this different from maintenance:singleuser?

Single-user mode still lets admins in through the browser; regular maintenance mode locks out everyone.


Full page with every command and the German/Italian version: daniele-michelin.com/en/errors/nextcloud-maintenance-mode-enabled/

First published at daniele-michelin.com. The error lexicon covers HTTP, DNS, TLS, mail, database, PHP, nginx, systemd and Nextcloud, in German, English and Italian.

Top comments (0)