Stuck in Maintenance mode, though according to config file not

Hi ilippert,
please try this to get beyond the maintenance mode screen. Oddly this issue has been around since NextCloud 12 and we spent a fair amount of time to find the solution, too. Same issue occurs also in docker when installing a fresh instance or upgrading. This solution was found in the German NextCloud forum.

On a regular/local server enter these two commands:
chmod 700 occ
sudo -u www-data ./occ config:system:set overwriteprotocol --value="https"

If your NextCoud is runing on Docker it’s just one command:
docker exec -it -u www-data NAME_NEXTCLOUD_CONTAINER bash -c './occ config:system:set overwriteprotocol --value=“https”'

Reference to the original German post with solutions in last two posts of the thread: Zugriff gewähren lädt ohne Ende

Thanks for this pointer. It does not solve the issue. Hmm, should I now “unset” the command that you recommended?

1 Like

Thank you for your message. Your opening seems to imply that the database db might actually store maintenance information. Where/which table would it store that in the db? I would like to check up on that.

1 Like

No, what I meant is that if you restored the db and the files then Nextcloud should work as before, because nothing else has state (your browser excluded, which should not be a problem).

I am not sure but think that the db does not store whether Nextcloud is in maintenance mode or not, at least it does not contain the word “maintenance”.

Before you do anything else, I strongly suggest that you check the nextcloud log file. See my previous post for its location.

1 Like

Thank you for clarifying.

ok, I have now found an error in the log file

Base table or view not found: 1146 Table 'db.oc_appconfig' doesn't exist",{"errorInfo":["42S02",1146,"Table 'db.oc_appconfig' doesn't exist"],"__class__":"Doctrine\\DBAL\\Driver\\PDOException"}]}

might this cause the trouble? It may be the effect of a failed upgrade.

Actually a table oc_appconfig with content does exist in the db.

elsewhere I learn, Index oc_activity is corrupted.

1 Like

I note Table 'nextcloud.oc_appconfig' doesn't exist | Internal Server Error but I am not sure how this might help me.

1 Like

AFAICS this table is mandatory. You need to provide more of the log file. You are posting one line which makes it hard to see whether other things have gone wrong.

Since your table is missing, you have not restored the db properly. I suggest, to use your backups to return to a working state and try to update again from there.

1 Like

I pasted the log here

1 Like

I do see the table in phpMyAdmin. So it cannot be missing.

with respect to the index corrupted I get confused, because

> check table oc_activity;
+--------------------------+-------+----------+----------+
| Table                    | Op    | Msg_type | Msg_text |
+--------------------------+-------+----------+----------+
| db_name.oc_activity | check | status   | OK       |
+--------------------------+-------+----------+----------+

Are you sure? Try to run:

SELECT * FROM oc_appconfig;
1 Like

the SELECT command works on oc_appconfig shows 262 rows in my db.

I note that in the table the core information is wrong


| core                      | lastupdateResult                       | {"version":"19.0.4.2","versionstring":"Nextcloud 19.0.4","url":"https:\/\/download.nextcloud.com\/server\/releases\/nextcloud-19.0.4.zip","web":"https:\/\/docs.nextcloud.com\/server\/19\/admin_manual\/maintenance\/upgrade.html","changes":"https:\/\/updates.nextcloud.com\/changelog_server\/?version=19.0.4","autoupdater":"1","eol":"0"}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

ok, so the database backup that I use was initiated after trying to install 19.04. but that install was aborted… Also, also, the maintenance stuck issue is still the case, even if I upgrade to 19.04. or even to 20.

Should I provide the details of the oc_appconfig table?

I am running in to the same issue with the MSQL upgraded issue. I am upgrading form 19.02 to 19.03. The error I am runinning in to see a Attachment. I really don want to delete my nextcloud where I am now just to keep up with a new up grade. Can some one look at the error attached and my be let me know what I should do next.

Thanks.

AFAICS you have changed the database backup version between your posts, so i don’t know the current state. As I have said, you need to restore the state of db that matches your files. I am assuming that you have backups of dbs for the different versions of NC.

Find out what NC version your current db belongs to. Find out which version of files you are using in config/config.php and compare them. I am not sure about config.php, maybe it was already changed although the update didn’t finish.

I just remembered this: Check /var/www/nextcloud/data/updater-…/ for backups of NC files.

If you can’t do that at this point its probably easier to reinstall Nextcloud and let it scan files again. I don’t know what other apps and data you have except files.

Also, it is hard to understand what you are writing. If English is not your native language, i suggest you post in one of the international channels here.

good luck

The above has worked on all previous instances on docker compose, sorry it seems not to work on your bare metal and for NextCloud v20.

With some help of a friend we have figured out that you need to turn off the maintenance mode in ~/config.php manually. It should reside in /var/www/html/config/config.php

Open with your favourite text editor.

You will find a line:

’maintenance’ => true,

this needs to be changed to

’maintenance’ => false,

Save and exit.

You can probably do it with a command like this, too:

sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off

But I suggest to change it manually.

For reference to those running NextCloud in a docker image (our setup is using nextcloud:fpm-alpine docker container) here it worked to do:

docker exec -it -u www-data YOUR_DOCKER-CONTAINER_ID sh -c ‘php ./occ maintenance:mode --off’

Hopefully this will also work on your end!

Final note: your config.php looks corrupted as the line ‘maintenance’ shows up twice. Maybe a clean install will help a lot and then move your backed up data in again.

1 Like

Thanks PancakeConnaisseur.

I was answering to ilippert. i think, you should create a new thread for your problem. This is probably why nobody has answered you yet. Then please provide an output of your log or at least click on the “Detailed Log” think in the webpage you screenshot. It might give you hints on what went wrong.

Hi all,
after days of resetting to the original database, resetting to earlier database backups, and original file structures, updated file structures… the following simple change was the solution.

Remove the complete maintenance line from the config file.
'maintenance' => false,
then it worked.

p.s. I had checked several times for multiple lines of the maintenance entry - no! Only one existed.

1 Like

@PancakeConnaisseur @Hauke_Plambeck and @maxxer thanks for your engagement!