Repository: digint/btrbk

Issue #171: btrbk fails with btrfs-progs v4.12
Created: 2017-07-29T10:11:57Z
As of btrfs-progs-v4.12, the output format of "btrfs subvolume show" has changed (for some good reason I believe, see commit b7df24a), which makes btrbk <= v0.25.0 fail while trying to fetch the full path out of the first line of the output.

Duplicate issue #176: btrfs send has been failing for the past few days and I cant figure out why
Created: 2017-08-19T19:39:37Z
It seems to try to send the snapshot. Finishes. says it completed succesfully, but then
btrbk decides to delete it anyway.
Highlighted log of where it fails:
Creating backup: /run/media/arian/backups/t430s/@.20170812T014321+0200
[send/receive] source: /mnt/arch/@.20170812T014321+0200
[send/receive] parent: /mnt/arch/@.20170811T000035+0200
[send/receive] target: /run/media/arian/backups/t430s/@.20170812T014321+0200
### btrfs send -p /mnt/arch/@.20170811T000035+0200 /mnt/arch/@.20170812T014321+0200 | pv -trab | btrfs receive /run/media/arian/backups/t430s/
6.75GiB 0:03:35 [32.0MiB/s] [32.0MiB/s]
Command execution successful
[send/receive] checking target metadata: /run/media/arian/backups/t430s/@.20170812T014321+0200
### btrfs subvolume show /run/media/arian/backups/t430s/@.20170812T014321+0200
Command execution successful
ERROR: Failed to send/receive btrfs subvolume: /mnt/arch/@.20170812T014321+0200 [/mnt/arch/@.20170811T000035+0200] -> /run/media/arian/backups/t430s
send/received failed, deleting (possibly present and garbled) received subvolume: /run/media/arian/backups/t430s/@.20170812T014321+0200
[delete] options: commit-after
[delete] target: /run/media/arian/backups/t430s/@.20170812T014321+0200
### btrfs subvolume delete --commit-after /run/media/arian/backups/t430s/@.20170812T014321+0200
Command execution successful
WARNING: Deleted partially received (garbled) subvolume: /run/media/arian/backups/t430s/@.20170812T014321+0200
ERROR: Error while resuming backups, aborti

Full log:
❯ sudo btrbk run --progress -l debug
btrbk command line client, version 0.25.0  (Sat Aug 19 21:32:26 2017)
Using configuration: /etc/btrbk/btrbk.conf
Initializing volume section: /mnt/arch
### btrfs subvolume show /mnt/arch
Command execution successful
Real path for subvolume "/mnt/arch" is: /
Parsed 11 subvolume detail items: /mnt/arch
found btrfs root: /mnt/arch
### btrfs subvolume list -a -c -u -q -R /mnt/arch
Command execution successful
Parsed 78 total subvolumes for filesystem at: /mnt/arch
### btrfs subvolume list -a -r /mnt/arch
Command execution successful
Parsed 75 readonly subvolumes for filesystem at: /mnt/arch
Initializing subvolume section: /mnt/arch/@
Found "/mnt/arch/@" (id=257) in btrfs subtree of: /mnt/arch
Initializing subvolume section: /mnt/arch/@home
Found "/mnt/arch/@home" (id=258) in btrfs subtree of: /mnt/arch
Initializing target section: /run/media/arian/backups/t430s
### btrfs subvolume show /run/media/arian/backups/t430s
Command execution failed (exitcode=1): "btrfs subvolume show /run/media/arian/backups/t430s 2>&1"
Resolving btrfs mount point for: /run/media/arian/backups/t430s
### readlink -e /run/media/arian/backups/t430s
Command execution successful
Real path for "/run/media/arian/backups/t430s" is: /run/media/arian/backups/t430s
### cat /proc/self/mounts
Command execution successful
Found btrfs mount point for "/run/media/arian/backups/t430s": /run/media/arian/backups (subvolid=5)
### btrfs subvolume list -a -c -u -q -R /run/media/arian/backups
Command execution successful
Parsed 50 total subvolumes for filesystem at: /run/media/arian/backups
### btrfs subvolume list -a -r /run/media/arian/backups
Command execution successful
Parsed 48 readonly subvolumes for filesystem at: /run/media/arian/backups
Initializing target section: /run/media/arian/backups/t430s
### btrfs subvolume show /run/media/arian/backups/t430s
Command execution failed (exitcode=1): "btrfs subvolume show /run/media/arian/backups/t430s 2>&1"
Resolving btrfs mount point for: /run/media/arian/backups/t430s
Found btrfs mount point for "/run/media/arian/backups/t430s": /run/media/arian/backups (subvolid=5)
Snapshot creation enabled (snapshot_create=always)
Creating subvolume snapshot for: /mnt/arch/@
[snapshot] source: /mnt/arch/@
[snapshot] target: /mnt/arch/@.20170819T213226+0200
### btrfs subvolume snapshot -r /mnt/arch/@ /mnt/arch/@.20170819T213226+0200
Command execution successful
Snapshot creation enabled (snapshot_create=always)
Creating subvolume snapshot for: /mnt/arch/@home
[snapshot] source: /mnt/arch/@home
[snapshot] target: /mnt/arch/@home.20170819T213226+0200
### btrfs subvolume snapshot -r /mnt/arch/@home /mnt/arch/@home.20170819T213226+0200
Command execution successful
Found 40 snapshot children of "/mnt/arch/@" in: /mnt/arch/@.*
Checking for missing backups of subvolume "/mnt/arch/@" in "/run/media/arian/backups/t430s/"
Found receive target of: /mnt/arch/@.20170728T041200+0200
Found receive target of: /mnt/arch/@.20170729T123312+0200
Found receive target of: /mnt/arch/@.20170730T205925+0200
Found receive target of: /mnt/arch/@.20170801T175250+0200
Found receive target of: /mnt/arch/@.20170802T145053+0200
Found receive target of: /mnt/arch/@.20170810T215325+0200
Found receive target of: /mnt/arch/@.20170811T000035+0200
Adding backup candidate: /mnt/arch/@.20170811T125625+0200
Adding backup candidate: /mnt/arch/@.20170811T130757+0200
Adding backup candidate: /mnt/arch/@.20170811T135118+0200
Adding backup candidate: /mnt/arch/@.20170811T135530+0200
Adding backup candidate: /mnt/arch/@.20170812T014321+0200
Adding backup candidate: /mnt/arch/@.20170813T113407+0200
Adding backup candidate: /mnt/arch/@.20170814T191716+0200
Adding backup candidate: /mnt/arch/@.20170815T125542+0200
Adding backup candidate: /mnt/arch/@.20170816T131229+0200
Adding backup candidate: /mnt/arch/@.20170817T201519+0200
Adding backup candidate: /mnt/arch/@.20170818T223900+0200
Adding backup candidate: /mnt/arch/@.20170819T000001+0200
Adding backup candidate: /mnt/arch/@.20170819T210205+0200
Adding backup candidate: /mnt/arch/@.20170819T210515+0200
Adding backup candidate: /mnt/arch/@.20170819T210610+0200
Adding backup candidate: /mnt/arch/@.20170819T210804+0200
Adding backup candidate: /mnt/arch/@.20170819T210848+0200
Adding backup candidate: /mnt/arch/@.20170819T211901+0200
Adding backup candidate: /mnt/arch/@.20170819T211904+0200
Adding backup candidate: /mnt/arch/@.20170819T211905+0200
Adding backup candidate: /mnt/arch/@.20170819T211906+0200
Adding backup candidate: /mnt/arch/@.20170819T211908+0200
Adding backup candidate: /mnt/arch/@.20170819T211910+0200
Adding backup candidate: /mnt/arch/@.20170819T211911+0200
Adding backup candidate: /mnt/arch/@.20170819T211919+0200
Adding backup candidate: /mnt/arch/@.20170819T211922+0200
Adding backup candidate: /mnt/arch/@.20170819T211939+0200
Adding backup candidate: /mnt/arch/@.20170819T211943+0200
Adding backup candidate: /mnt/arch/@.20170819T212006+0200
Adding backup candidate: /mnt/arch/@.20170819T212043+0200
Adding backup candidate: /mnt/arch/@.20170819T212207+0200
Adding backup candidate: /mnt/arch/@.20170819T212415+0200
Adding backup candidate: /mnt/arch/@.20170819T213226+0200
Checking schedule for backup candidates
Schedule: preserving first of day for 20 days; first daily in week (starting on sunday) for 10 weeks; first weekly of month for all months
Scheduler reference time: 2017-08-19T21:32:26+0200
Preserving 8/33 items
Creating subvolume backup (send-receive) for: /mnt/arch/@.20170812T014321+0200
Latest common subvolumes for: /mnt/arch/@.20170812T014321+0200: src=/mnt/arch/@.20170811T000035+0200  target=/run/media/arian/backups/t430s/@.20170811T000035+0200
Creating incremental backup...
Creating backup: /run/media/arian/backups/t430s/@.20170812T014321+0200
[send/receive] source: /mnt/arch/@.20170812T014321+0200
[send/receive] parent: /mnt/arch/@.20170811T000035+0200
[send/receive] target: /run/media/arian/backups/t430s/@.20170812T014321+0200
### btrfs send -p /mnt/arch/@.20170811T000035+0200 /mnt/arch/@.20170812T014321+0200 | pv -trab | btrfs receive /run/media/arian/backups/t430s/
6.75GiB 0:03:35 [32.0MiB/s] [32.0MiB/s]
Command execution successful
[send/receive] checking target metadata: /run/media/arian/backups/t430s/@.20170812T014321+0200
### btrfs subvolume show /run/media/arian/backups/t430s/@.20170812T014321+0200
Command execution successful
ERROR: Failed to send/receive btrfs subvolume: /mnt/arch/@.20170812T014321+0200 [/mnt/arch/@.20170811T000035+0200] -> /run/media/arian/backups/t430s
send/received failed, deleting (possibly present and garbled) received subvolume: /run/media/arian/backups/t430s/@.20170812T014321+0200
[delete] options: commit-after
[delete] target: /run/media/arian/backups/t430s/@.20170812T014321+0200
### btrfs subvolume delete --commit-after /run/media/arian/backups/t430s/@.20170812T014321+0200
Command execution successful
WARNING: Deleted partially received (garbled) subvolume: /run/media/arian/backups/t430s/@.20170812T014321+0200
ERROR: Error while resuming backups, aborting
Created 0/8 missing backups
Found 33 snapshot children of "/mnt/arch/@home" in: /mnt/arch/@home.*
Checking for missing backups of subvolume "/mnt/arch/@home" in "/run/media/arian/backups/t430s/"
Found receive target of: /mnt/arch/@home.20170728T041200+0200
Found receive target of: /mnt/arch/@home.20170729T123312+0200
Found receive target of: /mnt/arch/@home.20170730T205925+0200
Found receive target of: /mnt/arch/@home.20170801T175250+0200
Found receive target of: /mnt/arch/@home.20170802T145053+0200
Found receive target of: /mnt/arch/@home.20170810T215325+0200
Found receive target of: /mnt/arch/@home.20170811T000035+0200
Adding backup candidate: /mnt/arch/@home.20170812T014321+0200
Adding backup candidate: /mnt/arch/@home.20170813T113407+0200
Adding backup candidate: /mnt/arch/@home.20170814T191716+0200
Adding backup candidate: /mnt/arch/@home.20170815T125542+0200
Adding backup candidate: /mnt/arch/@home.20170816T131229+0200
Adding backup candidate: /mnt/arch/@home.20170817T201519+0200
Adding backup candidate: /mnt/arch/@home.20170818T223900+0200
Adding backup candidate: /mnt/arch/@home.20170819T000001+0200
Adding backup candidate: /mnt/arch/@home.20170819T210804+0200
Adding backup candidate: /mnt/arch/@home.20170819T210848+0200
Adding backup candidate: /mnt/arch/@home.20170819T211901+0200
Adding backup candidate: /mnt/arch/@home.20170819T211904+0200
Adding backup candidate: /mnt/arch/@home.20170819T211905+0200
Adding backup candidate: /mnt/arch/@home.20170819T211906+0200
Adding backup candidate: /mnt/arch/@home.20170819T211908+0200
Adding backup candidate: /mnt/arch/@home.20170819T211910+0200
Adding backup candidate: /mnt/arch/@home.20170819T211911+0200
Adding backup candidate: /mnt/arch/@home.20170819T211919+0200
Adding backup candidate: /mnt/arch/@home.20170819T211922+0200
Adding backup candidate: /mnt/arch/@home.20170819T211939+0200
Adding backup candidate: /mnt/arch/@home.20170819T211943+0200
Adding backup candidate: /mnt/arch/@home.20170819T212006+0200
Adding backup candidate: /mnt/arch/@home.20170819T212043+0200
Adding backup candidate: /mnt/arch/@home.20170819T212207+0200
Adding backup candidate: /mnt/arch/@home.20170819T212415+0200
Adding backup candidate: /mnt/arch/@home.20170819T213226+0200
Checking schedule for backup candidates
Schedule: preserving first of day for 20 days; first daily in week (starting on sunday) for 10 weeks; first weekly of month for all months
Scheduler reference time: 2017-08-19T21:32:26+0200
Preserving 8/26 items
Creating subvolume backup (send-receive) for: /mnt/arch/@home.20170812T014321+0200
Latest common subvolumes for: /mnt/arch/@home.20170812T014321+0200: src=/mnt/arch/@home.20170811T000035+0200  target=/run/media/arian/backups/t430s/@home.20170811T000035+0200
Creating incremental backup...
Creating backup: /run/media/arian/backups/t430s/@home.20170812T014321+0200
[send/receive] source: /mnt/arch/@home.20170812T014321+0200
[send/receive] parent: /mnt/arch/@home.20170811T000035+0200
[send/receive] target: /run/media/arian/backups/t430s/@home.20170812T014321+0200
### btrfs send -p /mnt/arch/@home.20170811T000035+0200 /mnt/arch/@home.20170812T014321+0200 | pv -trab | btrfs receive /run/media/arian/backups/t430s/
1.86GiB 0:00:31 [59.6MiB/s] [59.6MiB/s]
Command execution successful
[send/receive] checking target metadata: /run/media/arian/backups/t430s/@home.20170812T014321+0200
### btrfs subvolume show /run/media/arian/backups/t430s/@home.20170812T014321+0200
Command execution successful
ERROR: Failed to send/receive btrfs subvolume: /mnt/arch/@home.20170812T014321+0200 [/mnt/arch/@home.20170811T000035+0200] -> /run/media/arian/backups/t430s
send/received failed, deleting (possibly present and garbled) received subvolume: /run/media/arian/backups/t430s/@home.20170812T014321+0200
[delete] options: commit-after
[delete] target: /run/media/arian/backups/t430s/@home.20170812T014321+0200
### btrfs subvolume delete --commit-after /run/media/arian/backups/t430s/@home.20170812T014321+0200
Command execution successful
WARNING: Deleted partially received (garbled) subvolume: /run/media/arian/backups/t430s/@home.20170812T014321+0200
ERROR: Error while resuming backups, aborting
Created 0/8 missing backups
Found 40 snapshot children of "/mnt/arch/@" in: /mnt/arch/@.*
WARNING: Skipping cleanup of snapshots for subvolume "/mnt/arch/@", as at least one target aborted earlier
Found 33 snapshot children of "/mnt/arch/@home" in: /mnt/arch/@home.*
WARNING: Skipping cleanup of snapshots for subvolume "/mnt/arch/@home", as at least one target aborted earlier
Completed within: 262s  (Sat Aug 19 21:36:48 2017)
--------------------------------------------------------------------------------
Backup Summary (btrbk command line client, version 0.25.0)

    Date:   Sat Aug 19 21:32:26 2017
    Config: /etc/btrbk/btrbk.conf

Legend:
    ===  up-to-date subvolume (source snapshot)
    +++  created subvolume (source snapshot)
    ---  deleted subvolume
    ***  received subvolume (non-incremental)
    >>>  received subvolume (incremental)
--------------------------------------------------------------------------------
/mnt/arch/@
+++ /mnt/arch/@.20170819T213226+0200
!!! /run/media/arian/backups/t430s/@.20170812T014321+0200
!!! Target "/run/media/arian/backups/t430s" aborted: Failed to send/receive subvolume

/mnt/arch/@home
+++ /mnt/arch/@home.20170819T213226+0200
!!! /run/media/arian/backups/t430s/@home.20170812T014321+0200
!!! Target "/run/media/arian/backups/t430s" aborted: Failed to send/receive subvolume

NOTE: Some errors occurred, which may result in missing backups!
Please check warning and error messages above.
                                                 

Config:
snapshot_preserve_min	2d
snapshot_preserve	14d
snapshot_create		always

target_preserve_min	no
target_preserve		20d 10w *m
timestamp_format long-iso
volume /mnt/arch
  subvolume @
    target send-receive /run/media/arian/backups/t430s
  subvolume @home
    target send-receive /run/media/arian/backups/t430s

Closing comment (2017-08-19T20:03:26Z): Oh. might be a duplicate of #171.  Installing  0.25.1 now