Backup fails to collect app files

Using sudo yunohost backup create gives errors for each individual app and only backs up the system components.

My YunoHost server

Hardware: Old laptop or computer
YunoHost version: 4.2.6.1
I have access to my server : Through SSH and webadmin. I also have direct physical access to the server if needed.
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

If, through the CLI, I attempt to create a backup that contains app data, the backup will fail on every app. For instance:

Info: Collecting files to be backed up for gitea…
Error: Could not back up gitea
Info: Collecting files to be backed up for freshrss…
Error: Could not back up freshrss
Info: Collecting files to be backed up for wallabag2…
Error: Could not back up wallabag2

You can see the log from sudo yunohost backup create --apps here. As you can see, every app fails when collecting files, so in the end, nothing is backed up.

If I run sudo yunohost backup create -n foobar -o /foo/bar without specifying --apps or --system, then I’ll encounter the same errors for all apps, but then the backup script will back up the non-app system components as intended.

In the past, I could sometimes “force” a full backup, apps included, by running the backup command a second time after the first completed. I can’t replicate this hack now.

In the last few minutes as I’ve been testing this, however, I’ve found an odd discrepancy: Earlier today, sudo yunohost backup create -n foobar -o /foo/bar --dry-run ran successfully, with info messages indicating a successful (dry run) backup for each app:

Info: Collecting files to be backed up for my_webapp…
Info: Loading installation settings…
Info: Declaring files to be backed up…
Info: Backup script completed for my_webapp. (YunoHost will then actually copy those files to the archive).
Info: Collecting files to be backed up for calibreweb…
Info: Loading installation settings…
Info: Declaring files to be backed up…
Info: Backup script completed for calibreweb. (YunoHost will then actually copy those files to the archive).

But now, if I copy-paste the exact same command, including the --dry-run option, I’m left with the errors mentioned above.

Ideally, of course, I’d like to use the GUI-based backup utility in the admin panel, but I have a custom location for my backups on a Samba-shared mounted drive, and there’s no easy way to change the backup location in the admin panel. Hence, using the CLI. Backups are quickly becoming the biggest thorn in my side with YunoHost.

My first guess would be that there’s something going on with your custom location … Can you confirm that you’re able to create a file in that folder ? E.g. touch /your/custom/location/foobar

That’s certainly yielding less-than-ideal results:

$ touch /your/custom/location/archives
touch: setting times of '/your/custom/location/archives': Permission denied

I checked some permissions:

$ ls -al /your/custom/location/archives/ (the custom location)
drwxr-xr-x 2 root root 0 Nov 1 15:49 .

$ ls -al /home/yunohost.backup/archives (the default YunoHost backup location)
drwxr-x--- 2 admin root 4096 Nov 1 15:48 .

It seems like the default directory is owned by my YunoHost admin user, whereas the custom directory is owned by root.

I tried to update the custom directory’s ownership using the default directory as a reference. It reported success, but then the next time I tried touch, it still failed:

$ sudo chown -v --reference=/home/yunohost.backup/archives /your/custom/location/archives
changed ownership of '/media/external-backup/archives' from root:root to admin:root
$ touch /your/custom/location/archives
touch: setting times of '/your/custom/location/archives': Permission denied

Lolz I never ever saw that error before … “setting times”, wut ? I guess that’s related to setting the create/modified timestamp metadata …

Not sure exactly but this seems to be related to using Samba: https://bugzilla.redhat.com/show_bug.cgi?id=541506

I mean naively I’d really dig in how the disk is mounted and what could have changed since the last time it worked

I’ll look into that. It doesn’t seem to explain to me why the --dry-run would list successes for each app on first run and fail afterward, though. Nothing changed about the mounted drive between those two executions.

Any ideas about that?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.