Nextcloud backup restore fails: add "/./" in path -- EDIT: If archivemount is installed

My YunoHost configuration

Hardware: x86 OVH Kimsufi
Internet access: ethernet at home
**YunoHost version: 2.7.? (upgrade faile)
yunohost: 2.7.12
yunohost-admin: 2.7.12
moulinette: 2.7.12
ssowat: 2.7.12

Have you personalized your yunohost with some specifics configurations or do you use only the yunohost cli/webadmin tool ? basic
If personalized, how:

Description of my problem

yunohost app upgrade launched an upgrade of nextcloud
I figured afterward that I actually didn’t pay attention before and my last apt upgrade on yunohost-admin failed, due to a ca.crt existing but needed not to be there.

Bottom line:
The automatic restore fails.

Step I did from there:
-Fix the yunohst-admin upgrade
-Backup the data directory!
-Restart the restore procedure (I copied the command from the logfile):

sudo yunohost backup restore --ignore-system nextcloud-pre-upgrade2 --apps nextcloud --force --verbose

And the process starts… and is, I believe, going to fail, because I see that:
Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/files_videoplayer’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/files_pdfviewer’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/federatedfilesharing’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/previewgenerator’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/admin_audit’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/user_saml’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/mail’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/logreader’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/theming’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/bruteforcesettings’: No such file or directory Warning: cp: cannot stat ‘/home/yunohost.backup/tmp/nextcloud-pre-upgrade2/apps/nextcloud/backup/var/www/nextcloud/./apps/workflowengine’: No such file or directory

I spare you the rest of the log. I have tons of this.
I went in the backup directory, and the files are there (at least the few I checked), but of course, not with a “/./” in the path.

Soooo!
How do I get a 3rd attempt making sure the path is going to be correct?

Thanks very much!


Hi all,

FIXED!

So, what’s happening:
In /usr/share/yunohost/helpers.d/filesystem:
In the function ynh_restore_file:

# Do a copy if it's just a mounting point
if mountpoint -q $YNH_BACKUP_DIR; then
    if [[ -d "${ARCHIVE_PATH}" ]]; then
        ARCHIVE_PATH="${ARCHIVE_PATH}/."
        mkdir -p "$DEST_PATH"
    fi
    cp -a "$ARCHIVE_PATH" "${DEST_PATH}"
# Do a move if YNH_BACKUP_DIR is already a copy
else
    mv "$ARCHIVE_PATH" "${DEST_PATH}"
fi

AHAH!

ARCHIVE_PATH="${ARCHIVE_PATH}/."

So that’s where it comes from!

I’m not proficient in bash, so I can only speculate there was a good reason for that to be there.
But since there’s a backup involving mv instead of a failing cp due to the “/./” in the path, I went for the simplest:

apt remove archivemount

Then I tried to restore again, and it worked! Actually it was much faster to restore successfully than to fail with the mount…

Of course, I’ve been in this for 3 days, and only now that I zeroed down on archivemount did I find…

https://forum.yunohost.org/t/problem-in-restoring-apps/3238/2

And that’s very very exactly the same issue…

I don’t know if archivemount is required or useful for anything else, but if not, could it be banned by adding a dependency conflict with yunohost?

1 Like

It’s not required, yes, that’s something we hoped to be useful for the backup thing but it turns out to be counter productive …

We still need to take time to properly remove it (probably with a migration or something) or at least disable the piece of code that tries to use it …

1 Like