Hi i have just tried using RPI-CLONE to take a backup of the disk attached and seemed to work OK…
then i thought id be smart and put nextcloudn into maintenance mode & stopping apache & mysql
sudo php /var/www/nextcloud/occ maintenance:mode --on
sudo systemctl stop apache2
sudo systemctl stop mariadb
Cannot write into “config” directory!This can usually be fixed by giving the webserver write access to the config directory. But, if you prefer to keep config.php file read only, set the option “config_is_read_only” to true in it. See https://docs.nextcloud.com/server/23/go.php?to=admin-config
is there something else i need to do to get it out of maintenenace mode?
(i have tried enabling/disabling again & restarting)
Thanks!
[/details]
Nextcloud version (eg, 20.0.5): 23.0
Operating system and version (eg, Ubuntu 20.04): rasppi bullseye
Apache or nginx version (eg, Apache 2.4.25): not sure
PHP version (eg, 7.4): 7.4
Someone/thing changed the permissions. Try putting it in maintenance mode and then recheck permissions on the config.php file. Then take it out of maintenance and check again. Perhaps for some reason the cloning script you are using is doing it or just user error?
hi thanks for the reply…
I’ve just done the same again without the rpi-clone
maintenance mode on
stop Apache
stop mysql
start mysql
start Apache
maintenance mode off
same error, I had to do the permissions again on the config, so must be some oddness with maintenance mode, at least I know what to if I need to clone the drive again.
Turn on maintenance mode. Then check the permissions on /var/www/nextcloud/config/config.php
See if it changed. If it didnt then do the same with apache. If it does then an idea would be to check your .htaccess file to see if something is not right there.
To my understanding, You do not need to stop apache or mysql in order to run a backup.
Thanks again, its definatley the maintenance mode on, then off that triggers this, ive just done
show permissions/maint on/off and login fails again with the original error until i do the chmod
output below
pi@nc:/var/www/nextcloud/config $ ls -l /var/www/nextcloud/config/
total 72
-rw-rw---- 1 root www-data 1187 Jan 12 17:17 config.php
-rw-rw---- 1 root www-data 672 Dec 19 16:13 config.php.save
-rw-r–r-- 1 www-data www-data 62977 Nov 26 20:51 config.sample.php
pi@nc:/var/www/nextcloud/config $ sudo php /var/www/nextcloud/occ maintenance:mode --on
Maintenance mode enabled
pi@nc:/var/www/nextcloud/config $ ls -l /var/www/nextcloud/config/
total 72
-rw-r----- 1 root www-data 1186 Jan 13 09:30 config.php
-rw-rw---- 1 root www-data 672 Dec 19 16:13 config.php.save
-rw-r–r-- 1 www-data www-data 62977 Nov 26 20:51 config.sample.php
pi@nc:/var/www/nextcloud/config $ sudo php /var/www/nextcloud/occ maintenance:mode --off
Maintenance mode disabled
pi@nc:/var/www/nextcloud/config $ ls -l /var/www/nextcloud/config/
total 72
-rw-r----- 1 root www-data 1187 Jan 13 09:30 config.php
-rw-rw---- 1 root www-data 672 Dec 19 16:13 config.php.save
-rw-r–r-- 1 www-data www-data 62977 Nov 26 20:51 config.sample.php