IOError: GnuPG exited non-zero, with code 2

Bug #379648 reported by Chris Vanden Berghe
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Undecided
Unassigned
duplicity (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: duplicity

Since the upgrade to Jaunty, I get the following error when running Duplicity:

/usr/bin/duplicity --num-retries=20 --timeout=100 --include-globbing-filelist /root/Backup/backup.list--exclude '**' / ftp://12345@12.34.56.78/bobo_backup/

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 582, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 576, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 568, in main
    incremental_backup(sig_chain)
  File "/usr/bin/duplicity", line 272, in incremental_backup
    bytes_written = write_multivol("inc", tarblock_iter, globals.backend)
  File "/usr/bin/duplicity", line 149, in write_multivol
    globals.gpg_profile, globals.volsize)
  File "/usr/lib/python2.6/dist-packages/duplicity/gpg.py", line 241, in GPGWriteFile
    data = block_iter.next(bytes_to_go).data
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 466, in next
    result = self.process(self.input_iter.next(), size)
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 176, in get_delta_iter
    for new_path, sig_path in collated:
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 261, in collate2iters
    relem2 = riter2.next()
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 326, in combine_path_iters
    refresh_triple_list(triple_list)
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 312, in refresh_triple_list
    new_triple = get_triple(old_triple[1])
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 300, in get_triple
    path = path_iter_list[iter_index].next()
  File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 235, in sigtar2path_iter
    sigtarobj.close()
  File "/usr/lib/python2.6/dist-packages/duplicity/dup_temp.py", line 118, in close
    assert not self.fileobj.close()
  File "/usr/lib/python2.6/dist-packages/duplicity/gpg.py", line 162, in close
    self.gpg_process.wait()
  File "/var/lib/python-support/python2.6/GnuPGInterface.py", line 639, in wait
    raise IOError, "GnuPG exited non-zero, with code %d" % (e >> 8)
IOError: GnuPG exited non-zero, with code 2

Duplicity: 0.5.09-0ubuntu2
python-gnupginterface: 0.3.2-9ubuntu2

Related branches

Revision history for this message
Jens Wilke (jw-launchpad) wrote :

Same problem here after trying an incremental backup after a full backup.

In my environment, it seems the PASSPHRASE variable is not recognized.

Debugging:
strace -s 128 -f duplicity .... > xy
grep GNUPG < xy

gives:
[pid 15476] write(4, "[GNUPG:] ENC_TO 37105F933226F 16 0\n"..., 38) = 38
[pid 15476] write(4, "[GNUPG:] USERID_HINT 37105F9C3216F backup key <email address hidden>\n"..., 99) = 99
[pid 15476] write(4, "[GNUPG:] NEED_PASSPHRASE 37105F9C3216F 62E7B190B96DE 16 0\n"..., 64) = 64
[pid 15476] write(4, "[GNUPG:] MISSING_PASSPHRASE\n"..., 28) = 28
[pid 15476] write(4, "[GNUPG:] BAD_PASSPHRASE 37105F9C3216F\n"..., 41) = 41
[pid 15476] write(4, "[GNUPG:] BEGIN_DECRYPTION\n"..., 26) = 26
[pid 15476] write(4, "[GNUPG:] DECRYPTION_FAILED\n"..., 27) = 27
[pid 15476] write(4, "[GNUPG:] END_DECRYPTION\n"..., 24) = 24
[pid 15469] read(4, "[GNUPG:] ENC_TO 37105F9C3216F 16 0\n[GNUPG:] USERID_HINT 37105F9C3216F backup key <dustbin@headiss"..., 4096) = 347

Hope that hint helps.

It's not clear to me where actually the PASSPHRASE variable gets evaluated.
In the sources of duplicity (/usr/share/pyshared/duplicity) I cant find a hint on it.

Revision history for this message
Jens Wilke (jw-launchpad) wrote :

Okay I got some resolution.

It works for me if I pass on the passphrase in a file, e.g.
by adding the parameter " --gpg-options --passphrase-file=/tmp/passphrase"

Best,

Jens

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 379648] [NEW] IOError: GnuPG exited non-zero, with code 2

Jaunty is using an older version of duplicity, 0.5.09-0ubuntu2, and
duplicity is at 0.5.18. Please go to http://duplicity.nongnu.org/ and
download the most recent version.

I'll see what I can do to get the baseline updated.

Chris Vanden Berghe wrote:
> Public bug reported:
>
> Binary package hint: duplicity
>
> Since the upgrade to Jaunty, I get the following error when running
> Duplicity:
>
> /usr/bin/duplicity --num-retries=20 --timeout=100 --include-globbing-
> filelist /root/Backup/backup.list--exclude '**' /
> ftp://12345@12.34.56.78/bobo_backup/
>
> Traceback (most recent call last):
> File "/usr/bin/duplicity", line 582, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 576, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 568, in main
> incremental_backup(sig_chain)
> File "/usr/bin/duplicity", line 272, in incremental_backup
> bytes_written = write_multivol("inc", tarblock_iter, globals.backend)
> File "/usr/bin/duplicity", line 149, in write_multivol
> globals.gpg_profile, globals.volsize)
> File "/usr/lib/python2.6/dist-packages/duplicity/gpg.py", line 241, in GPGWriteFile
> data = block_iter.next(bytes_to_go).data
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 466, in next
> result = self.process(self.input_iter.next(), size)
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 176, in get_delta_iter
> for new_path, sig_path in collated:
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 261, in collate2iters
> relem2 = riter2.next()
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 326, in combine_path_iters
> refresh_triple_list(triple_list)
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 312, in refresh_triple_list
> new_triple = get_triple(old_triple[1])
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 300, in get_triple
> path = path_iter_list[iter_index].next()
> File "/usr/lib/python2.6/dist-packages/duplicity/diffdir.py", line 235, in sigtar2path_iter
> sigtarobj.close()
> File "/usr/lib/python2.6/dist-packages/duplicity/dup_temp.py", line 118, in close
> assert not self.fileobj.close()
> File "/usr/lib/python2.6/dist-packages/duplicity/gpg.py", line 162, in close
> self.gpg_process.wait()
> File "/var/lib/python-support/python2.6/GnuPGInterface.py", line 639, in wait
> raise IOError, "GnuPG exited non-zero, with code %d" % (e >> 8)
> IOError: GnuPG exited non-zero, with code 2
>
> Duplicity: 0.5.09-0ubuntu2
> python-gnupginterface: 0.3.2-9ubuntu2
>
> ** Affects: duplicity (Ubuntu)
> Importance: Undecided
> Status: New
>

Revision history for this message
Chris Vanden Berghe (chrisvdb) wrote :

Hi Jens,

Great, that seems to solve my problem... thanks a lot!

Kenneth: tried with the latest version but got error "unable to import gnupginterface".

Chris.

Revision history for this message
Chris Vanden Berghe (chrisvdb) wrote :

Grmbl, now consistently fails with another error... I'll raise separate bug report once I investigated a bit. Everything worked perfectly before Jaunty upgrade :-/

Running 'ncftp -u 12345 12.34.56.78' failed (attempt #1)
Running 'ncftp -u 12345 12.34.56.78' failed (attempt #2)
Running 'ncftp -u 12345 12.34.56.78' failed (attempt #3)
Running 'ncftp -u 12345 12.34.56.78' failed (attempt #4)
Running 'ncftp -u 12345 12.34.56.78' failed (attempt #5)
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 582, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 576, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 568, in main
    incremental_backup(sig_chain)
  File "/usr/bin/duplicity", line 271, in incremental_backup
    sig_chain.get_fileobjs(), new_sig_outfp)
  File "/usr/lib/python2.6/dist-packages/duplicity/collections.py", line 406, in get_fileobjs
    return map(filename_to_fileobj, [self.fullsig] + self.inclist)
  File "/usr/lib/python2.6/dist-packages/duplicity/backend.py", line 326, in get_fileobj_read
    return tdp.filtered_open_with_delete("rb")
  File "/usr/lib/python2.6/dist-packages/duplicity/dup_temp.py", line 86, in filtered_open_with_delete
    fh = FileobjHooked(path.DupPath.filtered_open(self, mode))
  File "/usr/lib/python2.6/dist-packages/duplicity/path.py", line 715, in filtered_open
    return gpg.GPGFile(None, self, gpg_profile)
  File "/usr/lib/python2.6/dist-packages/duplicity/gpg.py", line 120, in __init__
    attach_fhs={'stdin': encrypt_path.open("rb"),
  File "/usr/lib/python2.6/dist-packages/duplicity/path.py", line 507, in open
    result = open(self.name, mode)
IOError: [Errno 2] No such file or directory: '/tmp/duplicity-hTDr7g-tempdir/mktemp-bMnCG7-3'

Revision history for this message
Chris Vanden Berghe (chrisvdb) wrote :

Grabbed the latest version in Debian unstable and everything works again as expected. Please consider upgrading this package in Jaunty as people might not be aware that their backup is failing silently since they upgraded...

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package duplicity - 0.5.18-0ubuntu1

---------------
duplicity (0.5.18-0ubuntu1) karmic; urgency=low

  * New upstream release (LP: #390666)
  * Fixes LP: #368062 and LP: #379648

 -- Michael Terry <email address hidden> Mon, 22 Jun 2009 09:28:19 -0400

Changed in duplicity (Ubuntu):
status: New → Fix Released
Changed in duplicity:
status: New → Fix Released
Revision history for this message
everflux (tklaunchpad) wrote :

Could you release the fix for jaunty, too? duplicity is broken and unusable this way.

Revision history for this message
Peter Valdemar Mørch (pmorch) wrote :

Yes, please update for jaunty too!

In the meantime I installed the package from Karmic:
Go to http://packages.ubuntu.com/karmic/i386/duplicity/download and get duplicity*.deb
sudo dpkg -i ~/Desktop/duplicity*.deb

Seems to be working just fine here. This has the advantage over downloading and installing from source that in two years, when the version in ubuntu's mirrors move beyond the version in karmic, I'll pick that up too..

One can also use the latest and greatest with
https://launchpad.net/~duplicity-team/+archive/ppa
but then I was bitten by:
https://bugs.launchpad.net/duplicity/+bug/435975

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.