KeyError: backup_set.volume_name_dict[vol_num] (lp:#804484)

[Original report](https://bugs.launchpad.net/bugs/804484) created by **Martin Josefsson (josefsson-martin)**
```
I did backups on my laptop a few months ago, and now I'm trying to recover
the files on my fresly installed desktop, but Deja Dup gives me an error
message.

It works like a charm until i hit next after the window where you select
where the backups are located. I select the folder, and hit next, and it
shows a progress bar but then I get this error. I tried with various
snapshots and they are not encrypted.
I'm attaching the error message, in case that helps.

Since I am a good bug reported, I ran "DEJA_DUP_DEBUG=1 deja-dup | tail -n
200 > /tmp/deja-dup.log" and here is the results of that
_______________________________________________________________________________________________________
DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol23.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol25.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol29.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol33.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol36.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol40.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol43.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol50.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110525T220501Z.to.20110601T220533Z.vol51.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110601T220533Z.to.20110608T143124Z.vol1.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110601T220533Z.to.20110608T143124Z.vol6.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110601T220533Z.to.20110608T143124Z.vol7.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110601T220533Z.to.20110608T143124Z.manifest is part of known set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T143124Z.to.20110608T220546Z.vol1.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T143124Z.to.20110608T220546Z.vol2.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T143124Z.to.20110608T220546Z.vol5.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T143124Z.to.20110608T220546Z.vol6.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T143124Z.to.20110608T220546Z.vol9.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-new-
signatures.20110608T143124Z.to.20110608T220546Z.sigtar.gz is not part of a
known set; creating new set

DUPLICITY: DEBUG 1
DUPLICITY: . Ignoring file (rejected by backup set) 'duplicity-new-
signatures.20110608T143124Z.to.20110608T220546Z.sigtar.gz'

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol2.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol3.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol4.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol6.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol12.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol14.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol16.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol17.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . File duplicity-
inc.20110608T220546Z.to.20110609T131140Z.vol21.difftar.gz is part of known
set

DUPLICITY: DEBUG 1
DUPLICITY: . Found backup chain [Tue May 17 14:33:42 2011]-[Tue May 17
14:33:42 2011]

DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Tue May 17 14:33:42
2011 / end_time: Fri May 20 17:13:34 2011)

DUPLICITY: DEBUG 1
DUPLICITY: . Added set Fri May 20 17:13:34 2011 to pre-existing chain [Tue
May 17 14:33:42 2011]-[Fri May 20 17:13:34 2011]

DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Fri May 20 17:13:34
2011 / end_time: Thu May 26 00:05:01 2011)

DUPLICITY: DEBUG 1
DUPLICITY: . Added set Thu May 26 00:05:01 2011 to pre-existing chain [Tue
May 17 14:33:42 2011]-[Thu May 26 00:05:01 2011]

DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Thu May 26 00:05:01
2011 / end_time: Thu Jun  2 00:05:33 2011)

DUPLICITY: DEBUG 1
DUPLICITY: . Added set Thu Jun  2 00:05:33 2011 to pre-existing chain [Tue
May 17 14:33:42 2011]-[Thu Jun  2 00:05:33 2011]

DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Thu Jun  2 00:05:33
2011 / end_time: Wed Jun  8 16:31:24 2011)

DUPLICITY: DEBUG 1
DUPLICITY: . Added set Wed Jun  8 16:31:24 2011 to pre-existing chain [Tue
May 17 14:33:42 2011]-[Wed Jun  8 16:31:24 2011]

DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Wed Jun  8 16:31:24
2011 / end_time: Thu Jun  9 00:05:46 2011)

DUPLICITY: DEBUG 1
DUPLICITY: . Added set Thu Jun  9 00:05:46 2011 to pre-existing chain [Tue
May 17 14:33:42 2011]-[Thu Jun  9 00:05:46 2011]

DUPLICITY: INFO 1
DUPLICITY: . Added incremental Backupset (start_time: Thu Jun  9 00:05:46
2011 / end_time: Thu Jun  9 15:11:40 2011)

DUPLICITY: DEBUG 1
DUPLICITY: . Added set Thu Jun  9 15:11:40 2011 to pre-existing chain [Tue
May 17 14:33:42 2011]-[Thu Jun  9 15:11:40 2011]

DUPLICITY: NOTICE 1
DUPLICITY: . Last full backup date: Tue May 17 14:33:42 2011

DUPLICITY: INFO 3
DUPLICITY: backend GIOBackend
DUPLICITY: archive-dir (() /home/martin/.cache/deja-
dup/d4c11c57566a96caba822aae6cf14753 dir)
DUPLICITY: chain-complete
DUPLICITY:  full 20110517T123342Z 823
DUPLICITY:  inc 20110520T151334Z 417
DUPLICITY:  inc 20110525T220501Z 66
DUPLICITY:  inc 20110601T220533Z 52
DUPLICITY:  inc 20110608T143124Z 9
DUPLICITY:  inc 20110608T220546Z 12
DUPLICITY:  inc 20110609T131140Z 21
DUPLICITY: orphaned-sets-num 0
DUPLICITY: incomplete-sets-num 0
DUPLICITY: . Collection Status
DUPLICITY: . -----------------
DUPLICITY: . Connecting with backend: GIOBackend
DUPLICITY: . Archive dir: /home/martin/.cache/deja-
dup/d4c11c57566a96caba822aae6cf14753
DUPLICITY: .
DUPLICITY: . Found 0 secondary backup chains.
DUPLICITY: .
DUPLICITY: . Found primary backup chain with matching signature chain:
DUPLICITY: . -------------------------
DUPLICITY: . Chain start time: Tue May 17 14:33:42 2011
DUPLICITY: . Chain end time: Thu Jun  9 15:11:40 2011
DUPLICITY: . Number of contained backup sets: 7
DUPLICITY: . Total number of contained volumes: 1400
DUPLICITY: .  Type of backup set:                            Time:      Num
volumes:
DUPLICITY: .                 Full         Tue May 17 14:33:42 2011
823
DUPLICITY: .          Incremental         Fri May 20 17:13:34 2011
417
DUPLICITY: .          Incremental         Thu May 26 00:05:01 2011
66
DUPLICITY: .          Incremental         Thu Jun  2 00:05:33 2011
52
DUPLICITY: .          Incremental         Wed Jun  8 16:31:24 2011
9
DUPLICITY: .          Incremental         Thu Jun  9 00:05:46 2011
12
DUPLICITY: .          Incremental         Thu Jun  9 15:11:40 2011
21
DUPLICITY: . -------------------------
DUPLICITY: . No orphaned or incomplete backup sets found.

** (deja-dup:6699): DEBUG: DuplicityInstance.vala:575: duplicity (6790)
exited with value 30

DUPLICITY: DEBUG 1
DUPLICITY: . Removing still remembered temporary file /tmp/duplicity-
lwxhdv-tempdir/mkstemp-5j_Bcz-1

DUPLICITY: ERROR 30 KeyError
DUPLICITY: . Traceback (most recent call last):
DUPLICITY: .   File "/usr/bin/duplicity", line 1262, in <module>
DUPLICITY: .     with_tempdir(main)
DUPLICITY: .   File "/usr/bin/duplicity", line 1255, in with_tempdir
DUPLICITY: .     fn()
DUPLICITY: .   File "/usr/bin/duplicity", line 1209, in main
DUPLICITY: .     restore(col_stats)
DUPLICITY: .   File "/usr/bin/duplicity", line 539, in restore
DUPLICITY: .     restore_get_patched_rop_iter(col_stats)):
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 521, in Write_ROPaths
DUPLICITY: .     for ropath in rop_iter:
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 493, in integrate_patch_iters
DUPLICITY: .     for patch_seq in collated:
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 378, in yield_tuples
DUPLICITY: .     setrorps( overflow, elems )
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 367, in setrorps
DUPLICITY: .     elems[i] = iter_list[i].next()
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 112, in difftar2path_iter
DUPLICITY: .     tarinfo_list = [tar_iter.next()]
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 328, in next
DUPLICITY: .     self.set_tarfile()
DUPLICITY: .   File "/usr/lib/python2.7/dist-
packages/duplicity/patchdir.py", line 322, in set_tarfile
DUPLICITY: .     self.current_fp = self.fileobj_iter.next()
DUPLICITY: .   File "/usr/bin/duplicity", line 575, in get_fileobj_iter
DUPLICITY: .     backup_set.volume_name_dict[vol_num],
DUPLICITY: . KeyError: 1
DUPLICITY: .
________________________________________________________________________________

"dpkg-query -W deja-dup duplicity" gives me:
deja-dup        18.1.1-0ubuntu1.1
duplicity       0.6.13-0ubuntu1


"gconftool-2 --dump /apps/deja-dup > /tmp/deja-dup.settings" gives me:
<gconfentryfile>
  <entrylist base="/apps/deja-dup">
  </entrylist>
</gconfentryfile>

And I'm running Ubuntu 11.04.
```

Story points: 4.0