Owncloud maintenance mode and Could not open input file: occ

owncloud

#1

Hi. Help pls.
After the update owncloud on the univention server i got message:

This ownCloud instance is currently in maintenance mode, which may take a while.

root@ucs:~# cd /var/www/owncloud
root@ucs:/var/www/owncloud# sudo -u www-data php occ maintenance:mode --off
Could not open input file: occ
root@ucs:/var/www/owncloud#

Maybe this is the directory of the old version of owncloud? I can not find where else config files can be.

and what is this?


#2

Hi Tengri,

I have the same problem. After updating from UCS 4.2 to 4.3 and owncloud update, I ran into the maintenance mode.
However, I found the config.php on my server in:
/var/lib/univention-appcenter/apps/owncloud/conf
I changed 'maintenance' => true to 'maintenance' => false . This took away the maintenance mode error, but gives me a ‘update needed’ message:
Unbenannt

So I guess you will also end up with it, but perhaps it will work for you.
I am missig a manual on how to use the occ(owncloud console) within Univention server. Maybe someone can give a hint. With occ you might be able to skip the manual change of the config.php.

Kind regards,
Sascha


#3

Hey,

Nextcloud is not installed directly on the UCS server but inside a docker container. Therefore it’s normal that /var/www/nextcloud doesn’t exist, or that it’s empty if it does exist.

In order to run the occ utility you have to run it inside the docker container, e.g. like this:

# Outside the container, on the UCS host:
univention-app shell nextcloud
# Now we're inside the container; run 'occ' as user 'www-data':
sudo -u www-data /var/www/html/occ …

As to the upgrade: try running it manually. If that works, disable maintenance mode. Afterwards open the web interface and try logging in.

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

If the manual upgrade fails, please post any message output by the commands above.

For Owncloud instead of Nextcloud the steps are similar but slightly different:

univention-app shell owncloud
su www-data
cd /var/www/owncloud
./occ upgrade
./occ maintenance:mode --off

Edit: accidentally wrote docker where I meant to write nextcloud.

Kind regards,
mosu


#4

Hi Moritz,

thank you for the hint. Finally I got my owncloud updated and running again.
It was a little bit different than you described so I post my way of solving it. Perhaps someone may find it helpful:

1.) I could not run univention-app shell docker:

root@server1:~# univention-app shell docker
usage: univention-app shell [-h] [-i] [-t] app ...
univention-app shell: error: Unable to find app docker. Maybe "/usr/bin/univention-app update" to get the latest list of     applications?

I tried univention-app shell owncloud and that gave me a shell inside owncloud/docker.

2.) Because in the docker container I had no sudo command, I logged in as www-data with su www-data.

3.) There I changed into /var/www/owncloud . From there I could run ./occ upgrade and afterwards ./occ maintenance:mode --off.

4.) I logged into owncloud as super-user “owncloud” and got a integrity error for the file resources/config/ca-bundle.crt. I don’t know what to do with it. Seems to me it’s related to the certificate of the server( I am using Let's encrypt, perhaps that’s changing the file ???). Anyhow the server is working again.

Unbenannt

Any hint in how to solve the integrity error would be appreciated.


#5

Hey,

duh! Stupid mistake on my part. I definitely meant to write univention-app shell owncloud. Sorry 'bout that; it’s late and I’m tired :slight_smile:

Also I tested with Nextcloud, not Owncloud. Paths are slightly different for both. I’ve amended my post above.

Kind regards,
mosu


#6

Can you show us the whole config file (with sensitive information redacted)?


#7

Hi Moritz,

here’s the config.php:

Kind regards,
Sascha


#8

Hey,

oh, it’s not from the config file, but from the app config. So please post the output of this:

univention-app shell owncloud
su - www-data
/var/www/owncloud/occ config:list

I’m only interested in the sub-tree appscore.

Kind regards,
mosu


#9

Hi Moritz,

this is what I have in my apps->core config:

Kind regards,
Sascha


#10

Hey,

thanks, but I misinterpreted the error message. OC is verifying the checksum of several files in its installation folder against a list of known checksums. In this case it’s the CA certificate bundle file that fails the check. Did you modify that file, e.g. by adding the UCS CA certificate? You can try figuring out what the difference is between your copy of the file and a pristine one by downloading the OC installation source tarball from the OC website. You can copy the file OC complains about from the docker container to the host with something like this:

docker cp $(ucr get appcenter/apps/owncloud/container):/var/www/owncloud/resources/config/ca-bundle.crt /tmp/

Kind regards,
mosu