[Solved] Nextcloud is automatically getting into Maintenance Mode since yesterday

Hi, since this afternoon my nextcloud apparently got automatically update to this version:

Nextcloud 17.0.2 Build:2020-01-12T23:01:47+00:00 b1176aa9a8151c4b36244b344e9fdc733fafba35

i believe something on that update ether is wrong or went bad cause now my nextcloud is getting randomly into maintenance mode, so i have to log into my console and switch it off manually with

sudo nextcloud.occ maintenance:mode --off

i have snap nextcloud getting updates from the 17/edge channel, i dont really wanna backup my nextcloud and do a fresh install all over again, cause it would take me too long, so if anyone can gimme some help here to fix my issue it would be great

As usual start checking the Nextcloud log file for any possoble reason which could cause the problem.

We have the same problem since today or yesterday. Turning off the maintenance mode in config.php did not help (it was set to true), using your command “sudo nextcloud.occ maintenance:mode --off” did help.

In the log I can see the following errors:
[lib] Error: ResourceLocator can not find a web root (root: /var/snap/nextcloud/18155/nextcloud/extra-apps/deck, file: index.php/css/deck/b654-b56f-style.css?v=f9e2d8a20319e5266176138ed0adc6a2, webRoot: , throw: true)

GET /index.php/apps/deck/
from 87.XXX.XXX.XXX by stefan at 2020-01-13T09:38:31+00:00

[core] Warning: Failed to compile and/or save /snap/nextcloud/18155/htdocs/apps/files/css/merged.scss

GET /index.php/apps/files/
from 87.XXX.XXX.XXX by stefan at 2020-01-13T09:39:09+00:00

We also use snap nextcloud. But we are on version 16.0.7 Build:2020-01-12T23:21:39+00:00 177f0220ae625c21a81711aa07a96a08f7ffdd56.

Wi did not found a solution yet…

That’s the usual way to deactivate the maintenance mode but something must have caused the problem. Have you e.g. updated an app? The mentioned error seems to refer to the deck app.

We did not update manually. Maybe there is an auto-update activated somewhere (if this is an option?!). I checked the deck app, it seems to work but I´ll need to have a closer look later today.

i didnt update manually ether, it automatically updated, my last entry on my log is:

{“reqId”:“ORLkXAMZpn2lQisFaTgX”,“level”:3,“time”:“2020-01-13T15:35:57+00:00”,“remoteAddr”:“”,“user”:“javito”,“app”:“lib”,“method”:“GET”,“url”:"/index.php/apps/files/",“message”:“ResourceLocator can not find a web root (root: /var/snap/nextcloud/18160/nextcloud/extra-apps/spreed, file: index.php/css/spreed/28d1-1640-merged-files.css?v=d41d8cd98f00b204e9800998ecf8427e, webRoot: , throw: true)”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36”,“version”:“”}

i dont not have an app on my nextcloud called spreed, so i do not know where is this comming from, is there a way to downgrade or go back to my previous version of nextcloud, the one that was working, or a way to disable these automatic updates :S

Afaik, an automatic update function doesn’t exist within Nextcloud. If a Nextcloud update or an app update has taken place, someone has kicked it off manually. Would it be possible that someone has updated the php components of your server in the background? Very often people are updating their environment without thinking about a possible impact on installed software.

“speed” is the former name of the talk-app which hasn’t been fully renamed yet.

No, im the sole admin in my nextcloud server, only me has access to that server, no one else, so i dont understand how that happened then :S is there a way to go back to my previous version?, ill disable talk to see if it makes any diference and post back.

Edit: i disable and uninstalled Talk with no success, still goes into Maintenance Mode, one thing i forgot to mention is that if i click refresh on the webpage multiple times, it allows me to go back into my nextcloud, but then when i change pages it goes to maintenance again, so i have to refresh multiple times for the page to load again instead of the maintenance page.

Yes, use your regular backup to revert to the previous version - I still don’t believe that the environment has been updated. Check your log file and verify the software version number. Currently v17.0.2 seems to be installed - which works like a charm on my server.

i do not have a backup, id have to data backup my current nextcloud, uninstall it, install it again and restore a data backup, thats what i was trying to avoid, but if i cant get a solution by tomorrow at least then ill have to do it to restore proper functionality :S i cant have my nextcloud behaving like that, going into maintenance every 5 secs

Unfortunately I’m not an expert on Nextcloud snap. Eventually one of the required components is not running properly, e.g. Redis?! Have you checked the installation using the occ command?

As far as I know snap updates automatically, correct? I read this on various forums, and checking with “snap -list” indeed shows a new version (note the version-date, this is where our problems started).

nextcloud 16-2020-01-13 18155 16/edge nextcloud✓ -

I did not test this yet, but with snaps it should be possible to rollback:
“sudo snap revert nextcloud”. This might break your installation - or not. I did not dare to test this yet…

Tyvm for that command, i wasnt aware of it, i did dare to execute it and now everything is back to normal hehe, now i just have to look for ways to disable automatic updates on nextcloud snap :S u should use 17 tho :slight_smile:

Can you post a solution to disable snap updates? A very quick research showed: it´s complicated up to not possible. I´m open for ideas…

Version 17, yes, - it only had some problems with our aws storage, this is why we use 16 for now… This might be solved now, but still was a problem in December…

if ur using storages why not going for a normal full install instead of the snap? it would allow u to have more control over it, i ran 2 companies, both of them i have them with nextcloud installed manually, i only use the snap version of nextcloud because its for personal use and i dont need anything else than just regular cloud storage, but on my companies i have it integrated with my windows networks and active directory authentication and that requires a bit more tweak to make it work so snap was not an option

I use it on an AWS instance and wanted to test it first. The snap installation was the first tutorial I found :wink:

Anyway, the system is only set up to transfer big amounts of data, so we do not need all the bells and whistles it might offer. Until today it worked like a charm. But auto-updates which can not be postponed or stopped are a problem of course…

Yes they are, im trying to find a solution to stop the auto updates, if i do ill post it back :slight_smile:

Found a way to at least change the amount of times the snap refresh using this command:

sudo snap set system refresh.timer=fri5,4:00-7:00

fri5 will update only on the last friday of the month
4:00-7:00 will refresh from 4 am to 7 am

u can modify any of those to ur like :slight_smile:

theres also a work arround by setting up ur connection as metered, but i think ill stuck with this one for now and see how it goes, to check if ur command ran properly use:

sudo snap refresh --time

mine shows a result like this:

timer: fri5,4:00-7:00
last: today at 08:45 CST
next: in 17 days, at 22:00 CST

hope it helps :slight_smile:

Note: heres the reference link for this in case u wanna take a look at it

Thanks Javito!

ur welcome :slight_smile: