Nextcloud update leading to maintenance mode

I encounter this message, even though the instance has been up and online for more than 4h. Truenas App’s page claims that it is deployed and running.

Here are all of the log entries I could find

Any ideas? I am not that familiar with file locations inside of docker containers, some guides talk about the config.php file, but I cannot seem to find it via the 'find “config.php” '-command. Other guides/threads talk about the memory limits as well, but I do not think it would be that…

application version
27.0.0_1.6.33

I currently don’t really have any ideas where to start from sadly…
If you have any ideas, please feel free to share them with me!

Thank you for your time

Try using the occ commands inside the docker container

https://docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html#maintenance-commands-label

If that doesn’t work for you check this thread out

2 Likes

Looking at that thread, over on the Nextcloud form, it really seems that I am a little bit over my head at the moment.


If I could find that file, I could likely fix this, but it seems that this container has a somewhat different implementation

You don’t have sudo installed… I don’t know about the docker image, but it’s probably bad to run those commands as root.

You could install sudo with apt/yum/dnf/yay install sudo.

Also, when you run the commands, the occ file is in the root of the web directory, so you want to cd there. Again, I don’t know about docker, but on baremetal, it’s usually at/near /var/www/[something something]

Once you turn off maintenance mode, you might have to restart the server and then things will seem like they are working, except maybe the CODE/collabra stuff.

I just had some issues recently upgrading nextcloud, and it was related to the richdocumentscode or CODE/collabra server. Apparently, it’s too large to update through the web UI, so it has to be done manually.

do you have doas? i’m not sure what distro that is, but maybe see if which doas returns anything. I’ve never used it, but I’ve seen it in some youtube videos.

Did you try to exec -it via the www-data user into the docker container shell and then type

" ./occ maintenance:mode --off"

Maintenance mode is completely normal post updates. Often it can be a result of an incompatible or yet to uodate plugin

When you use www-data user into the shell directly you do not need sudo to run occ

3 Likes

He doesnt need sudo. See above. Its a matter of logging into the docker shell with the correct user. Do not run apt update/upgrades in containers or install additional software. Its literally something docker itself recommends against. You build the container for reproducibility.

Almost all containers allow you to login as root or another user that owns your executable

Almost all containers have a text editor. You have what you need.

1 Like

If you are in docker, then maybe this is what you need…

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#http-user-label

runuser --user www-data php occ .... blah blah

1 Like

This works as well. You never want to accidentally screw the permissions by using root inside a docker container. If its a mounted volume things will get painful. If its internal to the container you could fix easily by prune and repull. Its just advisable to respect the user that has permission in the container to do stuff. Ive had to do it a lot. Ive also made a lot of mistakes lol

2 Likes

Thank you all for your input, tried to check your ideas out…
And I am assuming the container would be closest to debian,
image
To me, it looks like there is a user of that name inside the container
image
But it looks like to me that it is disabled, I am guessing this based on that path and my logging attemps. Any ideas on how to proceed?

Once again, a huge thank you for your time and effort!

1 Like

Yeah. Dont use sudo. Loginto the container as www-data

docker exec -it --user www-data <container id> /bin/sh

Then retry your commands. Namely

" ./occ maintenance:mode --off"

Everything seems normal

This is where the fun part comes…
Since I am using the easy version which is somewhat jerryrig from combination of docker and kubernetes by Ix systems…


The app/container info

Once again, thank you!

1 Like

Reread your commands. You have extra characters before the docker command.

^[[200-

Where did that come from?

Copy paste issues.

1 Like

Can confirm that it was a copy paste issue.


So I ran the docker PS command, here is the output

And retried the container command…
image

2 Likes

after the -it part and before the --user part add /bin/bash

That will launch an interactive bash shell as the www-data (apache) user.

Then you can cd into where the occ command is run your maintenance commands.

1 Like