[Solved] 12.0.2 to 12.0.3 Update Failes at "Create Backup"

While trying to update my nextcloud install from 12.02 to 12.03, the web updater displays the following:

Initializing
Current version is 12.0.2.
Update to Nextcloud 12.0.3 available. (channel: “stable”)
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-12.0.3.zip
Retry update
Check for expected files
Check for write permissions
Enable maintenance mode
Create backup
Could not copy “/var/www/nextcloud/config/config.old” to “/var/www/nextcloud-data//updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0/config/config.old”

The TWO // in the error line is not a type. That is what the error message says.

My server is Ubuntu 16.04 LTS SERVER running in an ESXi 6.5 VM.

I’ve set maintenance mode back to false in the config.php, updated the OS, rebooted, and I still get the error. This was initially a 10.x install that has been updated multiple times, without a single error.

Hi,

AFAIK datadirectory in the config file should not have a trailing slash.

Perhaps you have in the config file something like

‘datadirectory’ => ‘/var/www/nextcloud-data/’,

If so I would remove the last “/”.

Radel

Nice catch, but I"m sad to say after making that change the error message doesn’t have the double //, but it still fails.
Create backup
Could not copy “/var/www/nextcloud/config/config.old” to “/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0/config/config.old”

Any ideas?

To ensure it wasn’t a weird permission issue, I reset perms on the nextclould-data folder with:

sudo chown www-data:www-data /var/www/nextcloud-data -R

No change, still errors out.

does that path exist? especially .../nextcloud-data/... looks strange to me. maybe it should be .../nextcloud/data... instead?

Just to be sure… Is the data-directory ( in your case /var/www/netxcloud-data ) writeable?
This means you need at least a rwx------ permission. I use 750 (rwxr-x—)

So I would go with:
chmod u+rwx /var/www/nextcloud-data

Perhaps there is something useful in the nextcloud.log file: can you find share some parts of it?

Next move could be:
mkdir -p /var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0/config/
chown -R www-data:www-data /var/www/nextcloud-data/updater-oc7ocyzpooo6

1 Like

The directory exists, and is writeable. I made no changes.

root@vm-Nextcloud:/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0# ls -l
total 136
drwxr-x— 37 www-data www-data 4096 Sep 26 06:49 apps
-rw-r–r-- 1 www-data www-data 8868 Sep 26 06:49 AUTHORS
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 config
-rw-r–r-- 1 www-data www-data 4050 Sep 26 06:49 console.php
drwxr-x— 16 www-data www-data 4096 Sep 26 06:49 core
-rw-r–r-- 1 www-data www-data 5057 Sep 26 06:49 cron.php
-rw-r–r-- 1 www-data www-data 41077 Sep 26 06:49 db_structure.xml
-rw-r–r-- 1 www-data www-data 179 Sep 26 06:49 index.html
-rw-r–r-- 1 www-data www-data 2804 Sep 26 06:49 index.php
drwxr-x— 3 www-data www-data 4096 Sep 26 06:49 l10n
drwxr-x— 6 www-data www-data 4096 Sep 26 06:49 lib
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 ocs
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 ocs-provider
-rw-r–r-- 1 www-data www-data 5323 Sep 26 06:49 remote.php
drwxr-x— 4 www-data www-data 4096 Sep 26 06:49 resources
drwxr-x— 14 www-data www-data 4096 Sep 26 06:49 settings
-rw-r–r-- 1 www-data www-data 2110 Sep 26 06:49 status.php
drwxr-x— 3 www-data www-data 4096 Sep 26 06:49 themes
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 updater
-rw-r–r-- 1 www-data www-data 435 Sep 26 06:49 version.php

/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0 is also empty.

I don’t understand… if /var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0 is empty, where the listing above came from?

Moreover I think there is a bit of confusion between the installation directory and the data directory.

Can you list the content of the installation directory, with special attention to the config directory? I suppose you have a config.old file not readable by www-data.

Sorry, I should have included /config on the path when I stated it was empty.

To clarify:

/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0/config
1. Exists
2. Is Empty
3. Perms: drwxr-x— 2 www-data www-data

root@vm-Nextcloud:/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0# ls -l
total 136
drwxr-x— 37 www-data www-data 4096 Sep 26 06:49 apps
-rw-r–r-- 1 www-data www-data 8868 Sep 26 06:49 AUTHORS
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 config
-rw-r–r-- 1 www-data www-data 4050 Sep 26 06:49 console.php
drwxr-x— 16 www-data www-data 4096 Sep 26 06:49 core
-rw-r–r-- 1 www-data www-data 5057 Sep 26 06:49 cron.php
-rw-r–r-- 1 www-data www-data 41077 Sep 26 06:49 db_structure.xml
-rw-r–r-- 1 www-data www-data 179 Sep 26 06:49 index.html
-rw-r–r-- 1 www-data www-data 2804 Sep 26 06:49 index.php
drwxr-x— 3 www-data www-data 4096 Sep 26 06:49 l10n
drwxr-x— 6 www-data www-data 4096 Sep 26 06:49 lib
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 ocs
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 ocs-provider
-rw-r–r-- 1 www-data www-data 5323 Sep 26 06:49 remote.php
drwxr-x— 4 www-data www-data 4096 Sep 26 06:49 resources
drwxr-x— 14 www-data www-data 4096 Sep 26 06:49 settings
-rw-r–r-- 1 www-data www-data 2110 Sep 26 06:49 status.php
drwxr-x— 3 www-data www-data 4096 Sep 26 06:49 themes
drwxr-x— 2 www-data www-data 4096 Sep 26 06:49 updater
-rw-r–r-- 1 www-data www-data 435 Sep 26 06:49 version.php

root@vm-Nextcloud:/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0# cd config
root@vm-Nextcloud:/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0/config# ls -l
total 0
root@vm-Nextcloud:/var/www/nextcloud-data/updater-oc7ocyzpooo6/backups/nextcloud-12.0.2.0/config#

Config directory:

root@vm-Nextcloud:/var/www/nextcloud/config# ls -l
total 56
-rw-r----- 1 root root 1124 Sep 11 11:12 config.old
-rw-r----- 1 www-data www-data 1213 Sep 26 06:49 config.php
-rw-r–r-- 1 www-data www-data 47329 Aug 23 15:14 config.sample.php
root@vm-Nextcloud:/var/www/nextcloud/config#

Removing the config.old fixed it. Very nice catch.

Good to know!

Radel

Update is successfully applied. Thank you, @radel

I’m glad we determined the exact problem, but had I ran:

sudo chown www-data:www-data /var/www/nextcloud -R

when I ran sudo chown www-data:www-data /var/www/nextcloud-data -R (Post #4), it would have fixed it to.

A perfect example of the need to be careful with file permissions.

1 Like