Nextcloud update 13 -> 14 aborting due to backup error

Hi everyone,

I try to upgrade my nextcloud 13 installation to the latest version 14.0.0.6 which is available.

However, the process aborts with the following log messages:

 11936 actions.upgrade.container.4eee   19-01-21 19:45:48 [   DEBUG]: Using container.4eee for container 4eee4273562f5e67b114418c0954ed376b14b7be9fb0ca2369aac45e2b3e8707
 11936 actions.upgrade.container.4eee   19-01-21 19:45:48 [   DEBUG]: Calling docker exec -u root 4eee4273562f5e67b114418c0954ed376b14b7be9fb0ca2369aac45e2b3e8707 /usr/share/univention-docker-container-mode/store_data_custom -$
 11936 actions.upgrade.container.4eee   19-01-21 19:45:48 [ WARNING]: cp: cannot create directory '/var/lib/univention-appcenter/apps/nextcloud/conf/config': No such file or directory
 11936 actions.upgrade                  19-01-21 19:45:48 [CRITICAL]: Image upgrade script (pre) failed
 11936 actions.upgrade                  19-01-21 19:45:48 [CRITICAL]: Storing data for 4.1/nextcloud=13.0.7-0 failed
 11936 packages                         19-01-21 19:45:48 [   DEBUG]: Releasing LOCK
 11936 actions.upgrade                  19-01-21 19:45:48 [CRITICAL]: Could not backup container!
 11936 actions.upgrade                  19-01-21 19:45:48 [ WARNING]: Aborting...

Any ideas where that is comming from ?
The directory in question is accessable by root only is that desired ? chwoning it to www-data does not solve the problem either.

Cheers,
Ludwig

Hi,

I encountered exactly the same issue. As far as I could see as first the folder /var/lib/univention-appcenter/apps/nextcloud/conf is being moved to /var/lib/univention-appcenter/apps/nextcloud/data/integration/conf.

For sure the the directory /var/lib/univention-appcenter/apps/nextcloud/conf/config can not be created as the directory /var/lib/univention-appcenter/apps/nextcloud/conf has been moved.

Is there any workaround to correct this manually or can this only be done with an app update?

Here is my log. That the mv as first was not working is correct as I tried the update several times and the subfolder data/integration/conf was already existing.

mv: das Verschieben zwischen Geräten ist fehlgeschlagen: '/var/lib/univention-appcenter/apps/nextcloud/conf' zu '/var/lib/univention-appcenter/apps/nextcloud/data/integration/conf';
das Ziel kann nicht entfernt werden: Das Verzeichnis ist nicht leer
Starting docker-app-nextcloud (via systemctl): docker-app-nextcloud.service.
Cannot write settings while 4.1/nextcloud=14.0.6-0 is not running
Executing interface update_available for nextcloud
No interface defined
Upgrading image (u'docker.software-univention.de/nextcloud:14.0.6-0')
Verifying Docker registry manifest for app image docker.software-univention.de/nextcloud:14.0.6-0
Pulling Docker image docker.software-univention.de/nextcloud:14.0.6-0
Downloading app image docker.software-univention.de/nextcloud:14.0.6-0
Flag --email has been deprecated, will be removed in 1.14.
Login Succeeded
Running command: docker pull docker.software-univention.de/nextcloud:14.0.6-0
14.0.6-0: Pulling from nextcloud
e22f66ddecae: Already exists
8c11da01fc8c: Already exists
ce440c225783: Already exists
7d1a1dc0830b: Already exists
49cfd961d80c: Already exists
4f50f882fa69: Already exists
5a22d071b613: Already exists
81c80aec7252: Already exists
71efdcfafdf8: Already exists
030b65663d70: Already exists
d05d4921e258: Already exists
08891b71c767: Already exists
691b4b1ea91a: Already exists
4f9a3818f059: Already exists
ad82e2288773: Already exists
7bd045a07f04: Already exists
ec78493679ef: Already exists
85f5ec94e221: Already exists
Digest: sha256:b1bed724e5ce9b9ad74884a274caee1c947093102098de894830b4fc7db0bad5
Status: Image is up to date for docker.software-univention.de/nextcloud:14.0.6-0
Saving data from old container (4.1/nextcloud=13.0.7-0)
Starting docker-app-nextcloud (via systemctl): docker-app-nextcloud.service.
Running command: docker cp 7db3a5085c4a613b72d0306438c90305ae2fd6e9d86b05202aa35258cca0931b:/etc/machine.secret /var/lib/univention-appcenter/apps/nextcloud/machine.secret
Starting docker-app-nextcloud (via systemctl): docker-app-nextcloud.service.
Executing interface store_data for nextcloud
Copying App Center's store_data to container's /usr/share/univention-docker-container-mode/store_data_custom
cp: cannot create directory '/var/lib/univention-appcenter/apps/nextcloud/conf/config': No such file or directory
Image upgrade script (pre) failed
Storing data for 4.1/nextcloud=13.0.7-0 failed
Could not backup container!
Aborting...
Starting docker-app-nextcloud (via systemctl): docker-app-nextcloud.service.

Andy

Sorry no solution from my side but im facing the same issue. Do you have the “standard” installation or did you relocate the Nextcloud Directory to another place using a softlink? Can’t imagine what this should be relevant but… well… clutching at straws.

Michael

I moved the data directory and set a bind to the standard directory. I bellieve we have this scenario since nextcloud v11.

Yesterday somebody opened an issue to this case in the related git hub repository https://github.com/nextcloud/univention-app/issues/83

The same for me. I moved the data directory via symlink to another partition.
Did not have any issues with this so far. (e.g. upgrade Nextcloud 12->13)

Hm, I did not run into the issue when testing the upgrade.

mv: das Verschieben zwischen Geräten ist fehlgeschlagen: '/var/lib/univention-appcenter/apps/nextcloud/conf' zu '/var/lib/univention-appcenter/apps/nextcloud/data/integration/conf';
das Ziel kann nicht entfernt werden: Das Verzeichnis ist nicht leer

Moving failed, but the explanation does not make much sense to me. Does someone has this message in english?

Could you try to do a mkdir -p "/var/lib/univention-appcenter/apps/nextcloud/data/integration" on the host and rerun the installation? Does that help?

1 Like

Hi Blizzz,

did so and the upgrade is now successfully installed. Don’t get it but I’m happy now :slight_smile: Thank you for looking into it and for this suggestion.

Michael

My issues seems to be a bit different…

the script proceeds a mv of /var/lib/univention-appcenter/apps/nextcloud/conf to /var/lib/univention-appcenter/apps/nextcloud/data/integration/conf. This worked for the first update try but not for the second as the target has already been there.

In one later step the script tries to cp to the directory/var/lib/univention-appcenter/apps/nextcloud/conf/config. It seems that this must fail as the directory …/conf/ has been moved in one of the first steps.

I was also trying to create the directory while the download but the script is running to fast.

I am still struggling on that point. recreating this directory while the download also with chmod 777 does not help. If somebody has an idea, it would be great.

Same problem: relocated Nextcloud dir to another place.

Today faced with the same error… As I was under the pressure to finish update I have created the “fix”:

  1. copied data from data path to conf:

    cp -pr /var/lib/univention-appcenter/apps/nextcloud/data/integration/* /var/lib/univention-appcenter/apps/nextcloud/conf/
    
  2. restarted original container (it is required for conf directory to reappear inside)

  3. entered inside the nextcloud container and replaced the bad migration file:

    docker exec -it ID_OF_CONTAINER bash
    /bin/mv /usr/share/univention-docker-container-mode/store_data_custom /usr/share/univention-docker-container-mode/store_data_custom.bak
    echo -e '#!/bin/bash\necho OK\n' > /usr/share/univention-docker-container-mode/store_data_custom
    chmod +x /usr/share/univention-docker-container-mode/store_data_custom
    exit
    
  4. Re-run the upgrade again… and it was OK.

  5. Copied the files back (again!):

    cp -pr /var/lib/univention-appcenter/apps/nextcloud/data/integration/* /var/lib/univention-appcenter/apps/nextcloud/conf/
    
  6. Restarted new container

  7. Executed on the host as advised:

    univention-app shell nextcloud sudo -u www-data /var/www/html/occ db:add-missing-indices
    

This is it!

Enjoy - hope Univention team would address the issue… But I have resolved it with such workaround…
Perhaps I have missed something crucial :slight_smile: But I may live with that!

@akuzkohqs
Thx for the workaround. How large is your data directory ? In my opinion this solution is only feasable for smaller installations.

@UniventionBlog
Is there an official solution exspected to be available soon ?

It is ~2 Tb of filled data from ~7 Tb available. I don’t think it relate to the size of the data.

You are right. Initially I tought the whole data directory is moved but it is only the config.
I followed your path and I successfully upgraded to nextcloud 14 as well.

However I had to configure “config.php” additionally since my nextcloud instance is availabe through a subdomain and is not using “/nextcloud” subdirectory. Those options seem the be lost.

Could realize the update with this workaround as well.

thx

1 Like

After several well working updates in between I ran today into the exact same issue again when updating from 17.0.1-0 to 17.0.2-0.
Unfortunately the update process got rid of the old container as well so that there was no way to run the workaround again.

Mastodon