NextCloud stuck in Maintenance Mode

Folks - thanks in advance for your help. I have been stumbling around for over a month and cannot find a solution on my own.

I am using UCS via the downloaded VMWare image and have installed the NextCloud app earlier this year and all was running smoothly until about a month ago. I am unaware what initially caused the problem, upgrading UCS, upgrading NextCloud… my son pressing the power button on my server… … at one point I noticed the IP address was incorrect on the UCS server start-up page, restarting a couple of times and tinkering with VMWare network settings and it is now back to the correct IP address…

Now when navigating to NextCloud using the ip address I see it is in ‘maintenance mode’. Also when attempting to navigate using X.com/NextCloud/ I get a message that x.com is not in the trusted domains.

I tried manually adjusting the config.php file using:

sudo vi /var/lib/univention-appcenter/apps/nextcloud/conf/config/config.php

adding the line for
2 => 'x.com',
also set
'maintenance' => false,

no luck when restarting.

The currently installed release version is 4.3-2 errata257.

I receive a WARNING Check File Permissions when running System Diagnostics from UCS:

File ‘/var/cache/univention-system-activation’ has mode 777, 700 was expected.

Checking my license from UCS and looks okay.

I do keep seeing a notification to upgrade UCS, I check, no upgrades available… except for Kopano webapp… so I will upgrade that too…

NextCloud Log File
looking at…
sudo vi /var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data/nextcloud.log
… and I see a number of
…Trusted domain error … [IP Adress] tried to access using “x.com” as host…
seeing this even after manually fixing the config.php file.
I then changed ‘loglevel’ => 0 (e.g. changed to 0 from 2)… I also noticed the errors were because all our devices were trying to upload files to NextCloud - so I turned off my Port Forwarding… now I see no new messages in the log… doesn’t quite help.

Receiving this when attempting to navigate to NextCloud instance:

This Nextcloud instance is currently in maintenance mode, which may take a while.
This page will refresh itself when the Nextcloud instance is available again.
Contact your system administrator if this message persists or appeared unexpectedly.
Thank you for your patience.

  • as you can likely tell - I am very new to UCS, NextCloud and not very skilled in Linux as of yet, again, appreciate any help! Thanks for your time and have an awesome day!

… continuing on

I also tried

sudo univention-app shell nextcloud
sudo -u www-data /var/www/html/occ upgrade --verbose

it runs through to

Repair step:Clean tags and favorites

then I see

OC\ServerNotAvailableException: Lost Connection to LDAP Server
Update Failed
Maintenance mode is kept active
Reset log level

Hi,

the main difference to a plain Nextcloud installation is that the app is running in a Docker container.
It appears as if the config.php you have modified outside the conatiner doesnt get updated on a restart of the container. Maybe the update happens during an upgrade of the app through Univention Appcenter, but I am not sure.

What you can do is to switch to the container and do the required changes there.

univention-app shell nextcloud sudo -u www-data php /var/www/html/occ maintenance:mode --off

I am also not sure how to deal with the trusted domain issue. It may work to get a shell (univention-app shell nextcloud) , install an editor and change /var/www/html/config/config.php directly. You may also watch out for other differences to the config.php outside the container.

hth,
Dirk Ahrnke

1 Like

Dirk,

Really appreciate the quick response. And I apologize that my additional edits to my post were not saved prior. I was able to turn maintenance mode off as you suggested; however, I quickly received a note that an upgrade was required. Upon running the upgrade, I receive the error below:

sudo univention-app shell nextcloud
sudo -u www-data /var/www/html/occ upgrade --verbose

it runs through to

Repair step:Clean tags and favorites

then I see

OC\ServerNotAvailableException: Lost Connection to LDAP Server
Update Failed
Maintenance mode is kept active
Reset log level

Looking to the log file…
image

Hi,

from my understanding of apps inside a container the direct update is a bit critical. The original config.php shows 'updatechecker' => 'false', and we should not see the hint that a new version is available. The recomended way would be to wait for a new version of the app (a new container).
To fix you LDAP-issue you can try the occ ldap:... commands

# univention-app shell nextcloud sudo -u www-data php /var/www/html/occ ldap

                                                                  
  [Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "ldap" is not defined.                                  
  Did you mean one of these?                                      
      ldap:check-user                                             
      ldap:create-empty-config                                    
      ldap:delete-config                                          
      ldap:search                                                 
      ldap:set-config                                             
      ldap:show-config                                            
      ldap:show-remnants                                          
      ldap:test-config                                        

In case you need something to compare:

# univention-app shell nextcloud sudo -u www-data php /var/www/html/occ ldap:show-config 
+-------------------------------+----------------------------------------------------------------+
| Configuration                 | s01                                                            |
+-------------------------------+----------------------------------------------------------------+
| hasMemberOfFilterSupport      | 0                                                              |
| hasPagedResultSupport         |                                                                |
| homeFolderNamingRule          |                                                                |
| lastJpegPhotoLookup           | 0                                                              |
| ldapAgentName                 | cn=nextc-05083597,cn=memberserver,cn=computers,dc=xxx,dc=xxxxx |
| ldapAgentPassword             | ***                                                            |
| ldapAttributesForGroupSearch  |                                                                |
| ldapAttributesForUserSearch   | uid;givenName;sn;employeeNumber;mailPrimaryAddress             |
| ldapBackupHost                |                                                                |
| ldapBackupPort                |                                                                |
| ldapBase                      | dc=xxx,dc=xxxxx                                                |
| ldapBaseGroups                | cn=groups,dc=xxx,dc=xxxxx                                      |
| ldapBaseUsers                 | dc=xxx,dc=xxxxx                                                |
| ldapCacheTTL                  | 600                                                            |
| ldapConfigurationActive       | 1                                                              |
| ldapDefaultPPolicyDN          |                                                                |
| ldapDynamicGroupMemberURL     |                                                                |
| ldapEmailAttribute            | mailPrimaryAddress                                             |
| ldapExperiencedAdmin          | 1                                                              |
| ldapExpertUUIDGroupAttr       |                                                                |
| ldapExpertUUIDUserAttr        |                                                                |
| ldapExpertUsernameAttr        | uid                                                            |
| ldapGidNumber                 | gidNumber                                                      |
| ldapGroupDisplayName          | cn                                                             |
| ldapGroupFilter               | (&(objectclass=nextcloudGroup)(nextcloudEnabled=1))            |
| ldapGroupFilterGroups         |                                                                |
| ldapGroupFilterMode           | 1                                                              |
| ldapGroupFilterObjectclass    | nextcloudGroup                                                 |
| ldapGroupMemberAssocAttr      | uniqueMember                                                   |
| ldapHost                      | www.xxx.xxxxx                                                  |
| ldapIgnoreNamingRules         |                                                                |
| ldapLoginFilter               | (&(objectclass=nextcloudUser)(nextcloudEnabled=1)(uid=%uid))   |
| ldapLoginFilterAttributes     |                                                                |
| ldapLoginFilterEmail          | 0                                                              |
| ldapLoginFilterMode           | 1                                                              |
| ldapLoginFilterUsername       | 1                                                              |
| ldapNestedGroups              | 0                                                              |
| ldapOverrideMainServer        |                                                                |
| ldapPagingSize                | 500                                                            |
| ldapPort                      | 7389                                                           |
| ldapQuotaAttribute            | nextcloudQuota                                                 |
| ldapQuotaDefault              |                                                                |
| ldapTLS                       | 0                                                              |
| ldapUserAvatarRule            | default                                                        |
| ldapUserDisplayName           | displayName                                                    |
| ldapUserDisplayName2          |                                                                |
| ldapUserFilter                | (&(objectclass=nextcloudUser)(nextcloudEnabled=1))             |
| ldapUserFilterGroups          |                                                                |
| ldapUserFilterMode            | 1                                                              |
| ldapUserFilterObjectclass     |                                                                |
| ldapUuidGroupAttribute        | auto                                                           |
| ldapUuidUserAttribute         | auto                                                           |
| turnOffCertCheck              | 0                                                              |
| turnOnPasswordChange          | 0                                                              |
| useMemberOfToDetectMembership | 0                                                              |
+-------------------------------+----------------------------------------------------------------+

Hello @Tstoner

what Nextcloud version are you running? Please run univention-app info.

Best regards,
Nico

UCS: 4.3-2 errata257
installed: kopano-core=8.6.2.1-1 kopano-webapp=3.4.21.1 kopano-webmeetings=3.0.1.10 letsencript= 2-3 4.1/nextcloud=13.0.6-1
Upradeable:

Going to try the upgrade … doubt it will be successful though based on prior results…

I think I am going to try to backup the database… uninstall and then reinstall Nextcloud from UCS… and THEN restore the database… here’s to hoping I can get that.

Thanks again for the responses and sorry it has been some time since my last update. Will let you know what I find!

Hey there, i have the same problem after upgrading to Nextcloud 17, it is still in maintenence mode. Is there any working solution for this now?

Based on the instructions in How To Edit config.php in Nextcloud App you could use occ to turn off the maintenance mode.

Mastodon