Duplicity throwing an exception on restore and on backup

I recently tried to restore a few files and duplicity threw an exception. From then on, it started throwing an exception when I’m trying to backup. So now I can’t restore, and can’t backup. Here’s the exception:

Traceback (innermost last):
  File "/usr/bin/duplicity", line 92, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 75, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1577, in main
    do_backup(action)
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1660, in do_backup
    restore(col_stats)
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 745, in restore
    restore_get_patched_rop_iter(col_stats)):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 797, in restore_get_patched_rop_iter
    file_names.append(backup_set.volume_name_dict[vol_num])
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
 KeyError: 1

It happens every time I’m trying to run my backup.

I’m using the distro version of Deja Dup, version 44.0. Here’s the debug information from the app:

System Details:
OS=Debian GNU/Linux 12 (bookworm)
Desktop=gnome
Locale=en_IE.UTF-8
Home=/home/halhfk
Version=44.0
Tool Name=duplicity
Tool Version=0.8.22

GSettings:
[org.gnome.DejaDup]
periodic=true
tool='duplicity'
window-width=836
periodic-period=1
prompt-check='2023-04-28T20:50:25.134757Z'
include-list=['$HOME', '/kwwqy/halhfk/qeplav/dccadqfu', '/kwwqy/halhfk/qeplav/ycy']
delete-after=182
backend='remote'
last-run='2023-09-30T09:14:13.081321Z'
window-maximized=false
last-backup='2023-09-30T09:19:33.825356Z'
nag-check='2023-08-17T09:31:30.826148Z'
window-height=948

[org.gnome.DejaDup.Remote]
folder='fenxborhe'
uri='sftp://wdtndut-goqn@iqiauvd.igyk-hnliucemnv.sd'

Latest Duplicity Log:
DEBUG 1 
. Found manifest volume 215

DEBUG 1 
. Found manifest volume 216

DEBUG 1 
. Found manifest volume 217

DEBUG 1 
. Found manifest volume 218

DEBUG 1 
. Found manifest volume 219

DEBUG 1 
. Found manifest volume 220

DEBUG 1 
. Found manifest volume 221

DEBUG 1 
. Found manifest volume 222

DEBUG 1 
. Found manifest volume 223

DEBUG 1 
. Found manifest volume 224

DEBUG 1 
. Found manifest volume 225

DEBUG 1 
. Found manifest volume 226

DEBUG 1 
. Found manifest volume 227

DEBUG 1 
. Found manifest volume 228

DEBUG 1 
. Found manifest volume 229

DEBUG 1 
. Found manifest volume 230

DEBUG 1 
. Found manifest volume 231

DEBUG 1 
. Found manifest volume 232

DEBUG 1 
. Found manifest volume 233

DEBUG 1 
. Found manifest volume 234

DEBUG 1 
. Found manifest volume 235

DEBUG 1 
. Found manifest volume 236

DEBUG 1 
. Found manifest volume 237

DEBUG 1 
. Found manifest volume 238

DEBUG 1 
. Found manifest volume 239

DEBUG 1 
. Found manifest volume 240

DEBUG 1 
. Found manifest volume 241

DEBUG 1 
. Found manifest volume 242

DEBUG 1 
. Found manifest volume 243

DEBUG 1 
. Found manifest volume 244

DEBUG 1 
. Found manifest volume 245

DEBUG 1 
. Found manifest volume 246

DEBUG 1 
. Found manifest volume 247

DEBUG 1 
. Found manifest volume 248

DEBUG 1 
. Found manifest volume 249

DEBUG 1 
. Found manifest volume 250

DEBUG 1 
. Found manifest volume 251

DEBUG 1 
. Found manifest volume 252

DEBUG 1 
. Found manifest volume 253

DEBUG 1 
. Found manifest volume 254

DEBUG 1 
. Found manifest volume 255

DEBUG 1 
. Found manifest volume 256

DEBUG 1 
. Found manifest volume 257

DEBUG 1 
. Found manifest volume 258

DEBUG 1 
. Found manifest volume 259

DEBUG 1 
. Found manifest volume 260

INFO 1 
. Found 260 volumes in manifest

DEBUG 1 
. Releasing lockfile b /home/halhfk/.cache/deja-dup/foiijvqxvsqilosdooqgiymtcdjitdqa/lockfile 

DEBUG 1 
. Removing still remembered temporary file /tmp/duplicity-964nt0ca-tempdir/ugrmuxj-fanwfwru-i

ERROR 30 KeyError 
. Traceback (innermost last):
.   File  /jjk/ggy/pqbdsnooc , line 92, in <module>
.     with_tempdir(main)
.   File  /jjk/ggy/pqbdsnooc , line 75, in with_tempdir
.     fn()
.   File  /jjk/byy/gxxpfam/uhcb-phylrsjd/pqbdsnooc/xkp_cfxu.jy , line 1577, in main
.     do_backup(action)
.   File  /jjk/byy/gxxpfam/uhcb-phylrsjd/pqbdsnooc/xkp_cfxu.jy , line 1660, in do_backup
.     restore(col_stats)
.   File  /jjk/byy/gxxpfam/uhcb-phylrsjd/pqbdsnooc/xkp_cfxu.jy , line 745, in restore
.     restore_get_patched_rop_iter(col_stats)):
.     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.   File  /jjk/byy/gxxpfam/uhcb-phylrsjd/pqbdsnooc/xkp_cfxu.jy , line 797, in restore_get_patched_rop_iter
.     fxvt_fpbyx.yubxoo(swqtll_gqo.qswpws_kbgf_ygpd[njy_nbv])
.                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
.  KeyError: 1

Trying to use duplicity directly, I’m getting:

$ duplicity /home/me file:///some/location 
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
GnuPG passphrase for decryption: 
Retype passphrase for decryption to confirm: 
First and second passphrases do not match!  Please try again.
GnuPG passphrase for decryption: 
Retype passphrase for decryption to confirm: 
No signatures found, switching to full backup.
Cleanup of temporary directory /tmp/duplicity-3p_at5py-tempdir failed - this is probably a bug.
Traceback (innermost last):
  File "/usr/bin/duplicity", line 92, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 75, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1577, in main
    do_backup(action)
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1711, in do_backup
    full_backup(col_stats)
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 585, in full_backup
    bytes_written = write_multivol(u"full", tarblock_iter,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 443, in write_multivol
    at_end = gpg.GPGWriteFile(tarblock_iter, tdp.name, config.gpg_profile,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/duplicity/gpg.py", line 382, in GPGWriteFile
    file = GPGFile(True, path.Path(filename), profile)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/duplicity/gpg.py", line 135, in __init__
    self.logger_fp = tempfile.TemporaryFile(dir=tempdir.default().dir())
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 796, in TemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 789, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 395, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 FileNotFoundError: [Errno 2] No such file or directory: '/tmp/duplicity-3p_at5py-tempdir/tmpkqg658l5'

For your second comment (FileNotFoundError: [Errno 2] No such file or directory: '/tmp/duplicity-3p_at5py-tempdir/tmpkqg658l5'), I’m not sure what’s happening there.

Looks like Duplicity couldn’t even make a temporary folder…?

For your first comment, I think I have a suggestion.

Check your target backup folder. You likely have two files in there with the same name but different file extensions (so like duplicity-*-vol1.tar and duplicity-*-vol1.tar.gz or similar).

That error suggests that Duplicity found two volumes with the same number… I would say move both volume files to a separate folder for now and retry, while we’re debugging this.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.