Server: Unsetting maintenance mode using occ doesn't work

Created on 27 Jan 2017  路  5Comments  路  Source: nextcloud/server

Steps to reproduce

  1. Set maintenance mode using occ to true --> maintenance mode is ON
  2. Unset maintenance mode using occ (set to false) --> maintenance mode is still ON
  3. Manually changing 'maintenance' => 'false' to 'maintenance' => false (removed the single quotes) --> maintenance mode is OFF

Server configuration

Operating system: Ubuntu 16.04
Web server: Nginx 1.11.9
Database: MariaDB 10.0.29
PHP version: 7.1
Nextcloud version: 11.01
Updated from an older Nextcloud/ownCloud or fresh install:fresh install

Most helpful comment

I think he used the occ config:system:set maintenance command, but in an incorrect way.
The complete command for that is:
occ config:system:set maintenance --value=false --type=bool

All 5 comments

I tried to reproduce it on Nextcloud 11.0.1 with php 5.6 and 7.0 (dot-deb packages) on debian 8 with apache.

  1. sudo -u www-data php occ maintenance:mode --on
    -> config/config.php, maintenance was set to true
  2. sudo -u www-data php occ maintenance:mode --off
    -> config/config.php, maintenance was set to false
  3. Could open the login page.

Only used the occ-command to enable and disable the maintenance mode, the value was always set correctly (without quotes around true or false).

Do you still have a different php version installed on your system as well? Perhaps it's a bug with php 7.1?

I think he used the occ config:system:set maintenance command, but in an incorrect way.
The complete command for that is:
occ config:system:set maintenance --value=false --type=bool

I agree on the incorrect way I was using the commands. It feels like a bug however that setting the mode without the type option works and unsetting without does not work.

Well "setting" only works, because php says that 'true' == true, but 'false' != false

The value in config.php was 'maintenance' => 'false',
(I don't know why as I have not edited this file manually.)

These commands didn't work
sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ maintenance:mode --off

This command fixed the problem (Thank you @nickvergessen for the help)
occ config:system:set maintenance --value=false --type=bool

Version: Nextcloud 15.0.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arno01 picture arno01  路  3Comments

mfechner picture mfechner  路  3Comments

brylie picture brylie  路  3Comments

williambargent picture williambargent  路  3Comments

juliushaertl picture juliushaertl  路  3Comments