No helpful error message when `par2+` is forgotten

Bug #1829798 reported by Marian Sigler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
New
Undecided
Unassigned

Bug Description

(I think this might be related to 1406173 but it seems different as it is old and marked as fixed)

When backing up with par2 turned on (eg a par2+ssh://... url), *.par2 files get created.
`I just wanted to restore from this and I forgot to add the `par2+` part (I used `file://...` instead of `par2+file://` and I got an AssertionError in `add_filename` (see log below)

I know this is my fault and everything, but if it's not much of a hassle it would be cool if duplicity could recognize this situation and display some meaningful warning (something like "Directory contains .par2 files. Did you mean to say par2+file:///...?")

/tmp/0N2AeR# duplicity restore file:///backups/xxx/duplicity/ restore/etc --file-to-restore etc -v9
Using archive dir: /root/.cache/duplicity/28xxxxef
Using backup name: 28xxxxef
GPG binary is gpg, version 2.2.15
Import of duplicity.backends.acdclibackend Succeeded
Import of duplicity.backends.azurebackend Succeeded
Import of duplicity.backends.b2backend Succeeded
Import of duplicity.backends.botobackend Succeeded
Import of duplicity.backends.cfbackend Succeeded
Import of duplicity.backends.dpbxbackend Failed: No module named dropbox
Import of duplicity.backends.gdocsbackend Succeeded
Import of duplicity.backends.giobackend Succeeded
Import of duplicity.backends.hsibackend Succeeded
Import of duplicity.backends.hubicbackend Succeeded
Import of duplicity.backends.imapbackend Succeeded
Import of duplicity.backends.lftpbackend Succeeded
Import of duplicity.backends.localbackend Succeeded
Import of duplicity.backends.mediafirebackend Succeeded
Import of duplicity.backends.megabackend Succeeded
Import of duplicity.backends.multibackend Succeeded
Import of duplicity.backends.ncftpbackend Succeeded
Import of duplicity.backends.onedrivebackend Succeeded
Import of duplicity.backends.par2backend Succeeded
Import of duplicity.backends.pydrivebackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.ssh_paramiko_backend Succeeded
Import of duplicity.backends.ssh_pexpect_backend Succeeded
Import of duplicity.backends.swiftbackend Succeeded
Import of duplicity.backends.sxbackend Succeeded
Import of duplicity.backends.tahoebackend Succeeded
Import of duplicity.backends.webdavbackend Succeeded
Main action: restore
Acquiring lockfile /root/.cache/duplicity/28xxxxef/lockfile
================================================================================
duplicity 0.7.18.2 (October 17, 2018)
Args: /usr/bin/duplicity restore file:///backups/xxx/duplicity/ restore/etc --file-to-restore etc -v9
Linux dirk 5.0.13-arch1-1-ARCH #1 SMP PREEMPT Sun May 5 18:05:41 UTC 2019 x86_64
/usr/bin/python2 2.7.16 (default, Mar 11 2019, 18:59:25)
[GCC 8.2.1 20181127]
================================================================================
Using temporary directory /tmp/duplicity-W5VLIR-tempdir
Registering (mkstemp) temporary file /tmp/duplicity-W5VLIR-tempdir/mkstemp-xkcP1G-1
Temp has 5367005184 available, backup will use approx 272629760.
Local and Remote metadata are synchronized, no sync needed.
658 files exist on backend
31 files exist in cache
Extracting backup chains from list of files: [...
# >200 archives, for each one there's three files: .gpg, .gpg.par2, .gpg.vol000+100.par2
...

Traceback (innermost last):
  File "/usr/bin/duplicity", line 1560, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1546, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1398, in main
    do_backup(action)
  File "/usr/bin/duplicity", line 1424, in do_backup
    action).set_values()
  File "/usr/lib/python2.7/site-packages/duplicity/collections.py", line 710, in set_values
    self.get_backup_chains(partials + backend_filename_list)
  File "/usr/lib/python2.7/site-packages/duplicity/collections.py", line 836, in get_backup_chains
    add_to_sets(f)
  File "/usr/lib/python2.7/site-packages/duplicity/collections.py", line 824, in add_to_sets
    if set.add_filename(filename):
  File "/usr/lib/python2.7/site-packages/duplicity/collections.py", line 105, in add_filename
    (self.volume_name_dict, filename)
 AssertionError: ({..., 42: 'duplicity-inc.20190325T105242Z.to.20190502T213407Z.vol42.difftar.gpg.par2', ...}, 'duplicity-inc.20190325T105242Z.to.20190502T213407Z.vol42.difftar.gpg.vol000+100.par2')

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.