tasket / wyng-backup

Fast backups for logical volumes & disk images
GNU General Public License v3.0
251 stars 16 forks source link

AttributeError: 'LvmVolume' object has no attribute 'lv_time'. #181

Closed seven-beep closed 7 months ago

seven-beep commented 7 months ago

Hello,

I have the following error on the beta version, qubes 4.2. I guess it should not happens.

Here are the steps to reproduce :

# wyng arch-init --dest=qubes://disp9963/home/user/qubes.backup
Wyng 0.8beta release 20230807
Enter new encryption passphrase:
Re-enter passphrase:

Encryption    : xchacha20-dgr (xchacha20-poly1305-msr)
Data Hashing  : hmac-sha256
Compression   : zlib:4
Done.

# wyng send vm-lorgnette-dvm-private --dest=qubes://disp9963/home/user/qubes.backup --local=qubes_dom0/vm-pool
Wyng 0.8beta release 20230807
Enter passphrase:
Encrypted archive 'qubes://disp9963/home/user/qubes.backup'
Last updated 2024-03-30 19:28:09.988425 (+01:00)

Preparing snapshots in '/dev/qubes_dom0/'...
  Preparing full scan of 'vm-lorgnette-dvm-private'

Sending backup session 20240330-193335:
————————————————————————————————————————————
   24.4MB |  5s
————————————————————————————————————————————
1 volumes, 2048——>24 MB in 5.7 seconds.

# wyng receive vm-lorgnette-dvm-private --dest=qubes://disp9963/home/user/qubes.backup --local=qubes_dom0/vm-pool
Wyng 0.8beta release 20230807
Enter passphrase:
Encrypted archive 'qubes://disp9963/home/user/qubes.backup'
Last updated 2024-03-30 19:33:48.905588 (+01:00)

!! This will erase all existing data in /dev/qubes_dom0/vm-lorgnette-dvm-private !!
Are you sure? [y/N]: y

Receiving volume 'vm-lorgnette-dvm-private' 20240330-193335
Saving to tlvm pool '/dev/qubes_dom0/vm-lorgnette-dvm-private'
OK Data bytes: 25623536 / 2147483648
Traceback (most recent call last):
  File "/sbin/wyng", line 4672, in <module>
    count = receive_volume(storage, aset.vols[dv], select_ses=options.session or "",
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sbin/wyng", line 4153, in receive_volume
    l_vol.rotate_snapshots(timestamp_path=vol.mapfile())
  File "/sbin/wyng", line 1508, in rotate_snapshots
    t = lvols[self.snap2].gettime()    ; os.utime(timestamp_path, ns=(t,t))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sbin/wyng", line 1689, in gettime
    return int(time.mktime(time.strptime(self.lv_time, r"%Y-%m-%d %H:%M:%S %z"))*1000000000)
                                         ^^^^^^^^^^^^
AttributeError: 'LvmVolume' object has no attribute 'lv_time'. Did you mean: 'lv_name'?
seven-beep commented 7 months ago

It is not 100% reproducible, on the 5 same receive command, it failed 3 times.

tasket commented 7 months ago

@seven-beep Hi... There does seem to be a case where internal LVM entries are re-populated without an lv_time attribute. I'm looking into this now and expect to have a fix tomorrow.

tasket commented 7 months ago

@seven-beep This appears to be a duplicate of issue #174 which was fixed in October, and the release date on the version you're using is earlier than that. I suggest upgrading your copy of Wyng and trying the receive operation again.

seven-beep commented 7 months ago

Sorry, I didn't found out #174 before, probably because of the use of screenshoot does not work well with github search.

Anyway, thank you both @tasket @tlaurion