TrueNas Scale Next Cloud maintenance mode

smic717394

Dabbler
Joined
Apr 27, 2022
Messages
29
Hi guys,

I need a bit of help. I´m currently on TrueNAS-SCALE-22.12.1 and just updated to NextCloud 26.0.0_1.6.20, I´ve noticed that not Next Cloud is stuck on maintenance mode. I tried to rollback but still the same. I tried opened the shell on the next cloud and it shows 2 pods, "nextcloud-postgres-59c55d886b-gngqh" with the container "nextcloud-postgres" and a second pod "nextcloud-6f57d84df7-5xdf6" with 3 containers "nextcloud, neginx and initpostgressdb" I open the second one with the container nextcloud and tried the su -m www-data -c 'php occ maintenance:mode --on' but I gett an error the account is currently not available.

I tried ./occ maintenance:mode --on and I get the following:
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)
i tried to cd config to try to edit the config.php but none nano or vi works.

I tried to edit the file using cat and seen in the end of the file a line maintenance mode on or something like this, because I didnt know how to edit I reload the pod, and I install nano "apt-get update" then "apt-get install nano", but not the config file is empty. and I get an error on the nextcloud page the config.php must be configure. So now I really messed it up.

Please help
 
Last edited:

smic717394

Dabbler
Joined
Apr 27, 2022
Messages
29
I checked under "/volumes/ix_volumes/ix-nextcloud_data" and I have the following folders "config custom_apps data html root themes tmp", under data I have the data for all the users, and under config I have the config.php but its empty, that's why it will not start any way to recover this maybe from an old backup, or should I just delete and start over.

In case I have to delete, can I copy the data and then restore it?
 

colemar

Dabbler
Joined
Feb 12, 2022
Messages
13
@smic717394
I solved it by installing nano text editor and edit config file and change maintenance from true to false. Config after you enter Shell-> Containers: nextcloud
first do
apt update
next
apt install nano
next go into config folder and edit config.php file
change maintenance to false, save changes, stop app and start again. After that enter Nextcloud web page and start update process.
 

mihies

Dabbler
Joined
Jan 6, 2022
Messages
32
Just to add further info to @colemar response. Select pod nextcloud-CODE (not nextcloud-postgres-CODE) and then nginx container.
It worked for me as well, thanks.
 

artstar

Dabbler
Joined
Jan 10, 2022
Messages
36
I ran into it and solved it the proper way:
 

smic717394

Dabbler
Joined
Apr 27, 2022
Messages
29
@smic717394
I solved it by installing nano text editor and edit config file and change maintenance from true to false. Config after you enter Shell-> Containers: nextcloud
first do

next

next go into config folder and edit config.php file
change maintenance to false, save changes, stop app and start again. After that enter Nextcloud web page and start update process.
Thank you, like I said in the post I already did this, but before I opened with nano, I tried with cat command and although I didn't change anything, I at least I thought I didn't, by the time I opened it with nando, the file was empty. I end up copping my data folder from shell, delete the app and reinstall it, this time on its own dataset.
 

dDiver

Cadet
Joined
Oct 28, 2023
Messages
1
In order to disable maintenance mode run these 2 commands one after other as mentioned in the post posted by @artstar
su

su -m www-data -c 'php /var/www/html/occ maintenance:mode --off'
 
Top