digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.67k stars 122 forks source link

archive failing with ERROR: chown o257-311460-0 failed: No such file or directory #295

Open Massimo-B opened 5 years ago

Massimo-B commented 5 years ago

Running a command like

btrbk --progress -v archive /mnt/usb/mobiledata/snapshots/ /mnt/local/data/archive/

I always fail to do the complete archive:

Archiving subvolumes: /mnt/usb/mobiledata/snapshots/balintop/home/home.*
No common parent subvolume present, creating full backup...
Creating backup: /mnt/local/data/archive/balintop/home/home.20180807T111135+0200
[send/receive] target: /mnt/local/data/archive/balintop/home/home.20180807T111135+0200
[send/receive] source: /mnt/usb/mobiledata/snapshots/balintop/home/home.20180807T111135+0200
in @ 8183 kiB/s, out @ 8183 kiB/s, 26.5 GiB total, buffer   0% full
summary: 26.5 GiByte in 9h 02min 32.6sec - average of  854 kiB/s
[send/receive] checking target metadata: /mnt/local/data/archive/balintop/home/home.20180807T111135+0200
Creating incremental backup...
Creating backup: /mnt/local/data/archive/balintop/home/home.20190727T114502+0200
[send/receive] target: /mnt/local/data/archive/balintop/home/home.20190727T114502+0200
[send/receive] source: /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200
[send/receive] parent: /mnt/usb/mobiledata/snapshots/balintop/home/home.20180807T111135+0200
in @  0.0 kiB/s, out @  0.0 kiB/s,  0.0 kiB total, buffer   0% full
summary:  0.0 kiByte in 27.6sec - average of  0.0 kiB/s
WARNING: [send/receive] (send=/mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200, receive=/mnt/local/data/archive/balintop/home) At subvol /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200
WARNING: [send/receive] (send=/mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200, receive=/mnt/local/data/archive/balintop/home) ERROR: chown o257-311460-0 failed: No such file or directory
WARNING: [send/receive] (send=/mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200, receive=/mnt/local/data/archive/balintop/home) At snapshot home.20190727T114502+0200
[send/receive] checking target metadata: /mnt/local/data/archive/balintop/home/home.20190727T114502+0200
ERROR: Failed to send/receive btrfs subvolume: /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200 [/mnt/usb/mobiledata/snapshots/balintop/home/home.20180807T111135+0200] -> /mnt/local/data/archive/balintop/home
[delete] options: commit-after
[delete] target: /mnt/local/data/archive/balintop/home/home.20190727T114502+0200
WARNING: Deleted partially received (garbled) subvolume: /mnt/local/data/archive/balintop/home/home.20190727T114502+0200
ERROR: Error while archiving subvolumes, aborting
Archived 1/5 subvolumes
WARNING: Skipping archiving of "/mnt/usb/mobiledata/snapshots/balintop/home/": At least one target aborted earlier
Completed within: 32587s  (Fri Sep 20 23:48:55 2019)

I tried again after removing the failed subvolume, but then I get the same error on the next subvolume and so on.

btrfs check and btrfs scrub have found no errors.

This is the latest btrbk from github:

# btrbk --version
btrbk command line client, version 0.29.0-dev

Kernel is 5.2.15-gentoo and sys-fs/btrfs-progs-5.2.2

Massimo-B commented 5 years ago

Transferring the same subvolume manually works, so this is probably not a btrfs issue:

# btrfs send /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200/ | pv -perabT -B 128M | btrfs receive /mnt/local/data/archive/
At subvol /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200/
At subvol home.20190727T114502+0200
38,5GiB {  0%} [ 886KiB/s] [ 886KiB/s] [                     
digint commented 5 years ago

You did not send with parent, this is why it works. Your log above tells me that btrbk sent this file with parent:

[send/receive] target: /mnt/local/data/archive/balintop/home/home.20190727T114502+0200
[send/receive] source: /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200
[send/receive] parent: /mnt/usb/mobiledata/snapshots/balintop/home/home.20180807T111135+0200

I'm pretty sure this will fail:

btrfs send -p /mnt/usb/mobiledata/snapshots/balintop/home/home.20180807T111135+0200 /mnt/usb/mobiledata/snapshots/balintop/home/home.20190727T114502+0200/ | btrfs receive  /mnt/local/data/archive/
pailloM commented 4 years ago

I get the same error. I can get the archive to work by setting incremental to no in the configuration file. Shall the option incremental from the config file be ignored by the archive action?

schildbach commented 3 years ago

I'm running into the same problem. And yes, I guess I have a gap in the incremental chain at that point (I have to check). Maybe btrbk should explain that situation.

And actually I agree that an archive command should probably not care too much, after all an archive is expected to contain everything from the source, including gaps in the incremental chain.

schildbach commented 3 years ago

…however, in contrast to @pailloM's last comment, it seems as if simply ignoring incremental=strict is not enough: I get the same error if comment the line temporarly. Manually deleting the old source snapshots from before the gap seems to do the trick. However, I assume that deleting old backups might not be acceptable for everyone.

To sum it up, btrbk archive seems to be broken in its current form. The experimental state is declared for a reason.

Massimo-B commented 3 years ago

Talking with the btrfs developers this is a btrfs issue as mentioned before. Using the plain btrfs commands is failing as well:

btrfs send -p /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20200803T060030+0200 /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20180114T131123+0100 | mbuffer -v 1 -q -m 2% | btrfs receive /mnt/local/data/snapshots/root/
At subvol /mnt/usb/mobiledata/snapshots/mobalindesk/root/root.20180114T131123+0100
At snapshot root.20180114T131123+0100
ERROR: chown o257-1571-0 failed: No such file or directory

This is still an issue as of Kernel: 5.9.12-gentoo sys-fs/btrfs-progs-5.9

However I forwarded the issue to the btrfs mailing lists: https://www.spinics.net/lists/linux-btrfs/msg108037.html