Duplicity can't find its own tempdir

Bug #1177381 reported by Steve Magoun
84
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned
duplicity (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

My backups have been working normally for months, but today they failed with this error:

Failed with an unknown error:
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1411, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1404, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1386, in main
    incremental_backup(sig_chain)
  File "/usr/bin/duplicity", line 581, in incremental_backup
    globals.backend)
  File "/usr/bin/duplicity", line 394, in write_multivol
    vi.set_hash("SHA1", gpg.get_hash("SHA1", tdp))
  File "/usr/lib/python2.7/dist-packages/duplicity/gpg.py", line 401, in get_hash
    fp = path.open("rb")
  File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 542, in open
    result = open(self.name, mode)
IOError: [Errno 2] No such file or directory: '/tmp/duplicity-rWgqMw-tempdir/mktemp-fvN6e5-5'

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: deja-dup 26.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.8.0-19.29-generic 3.8.8
Uname: Linux 3.8.0-19-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.9.2-0ubuntu8
Architecture: amd64
Date: Tue May 7 09:12:25 2013
InstallationDate: Installed on 2010-09-17 (962 days ago)
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
MarkForUpload: True
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: deja-dup
UpgradeStatus: Upgraded to raring on 2013-01-25 (101 days ago)

Revision history for this message
Steve Magoun (smagoun) wrote :
Revision history for this message
gpagnon (gpagnoni) wrote :

I am exactly in the same situation after the upgrade to 13.04 (amd64). Is there any news on how to fix this? I feel it is a quite serious issue as it is compromising the backup system many users rely on.

thanks for any help

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in deja-dup (Ubuntu):
status: New → Confirmed
Revision history for this message
Steve Magoun (smagoun) wrote :

Deja dup occasionally runs a full backup (looks like once every 3 months on my system). Today it chose to do a full backup for me, which seems to have cleared this error - the full backup completed successfully with no reported errors.

I'm not sure how to trigger a full backup manually; I waited for deja dup to do it.

Revision history for this message
Eric (eric-woodruff) wrote :

I got the same failure IOError: [Errno 2] No such file or directory. It failed again after in about 24 hours after restarting the full backup. It looks to have left 2.5G of duplicity files around.

~/.cache/deja-dup
$ du -sh .
2.5G

Revision history for this message
Christopher Townsend (townsend) wrote :

I've seen this too and I believe it's a problem in Duplicity.

affects: deja-dup (Ubuntu) → duplicity (Ubuntu)
Michael Terry (mterry)
summary: - Backup failed with unknown error
+ Duplicity can't find its own tempdir
Revision history for this message
Michael Terry (mterry) wrote :

Bug 922101 might be related.

Revision history for this message
Michael Terry (mterry) wrote :

I'm having a hard time figuring out why this would happen just from examining the code. If someone knows a way to reproduce this, that would be a huge help.

Revision history for this message
Karl (nj94uku09zlo) wrote :

I'm using a laptop with my power settings set to "Do nothing" when the lid is closed. However, I can replicate this by starting duplicity, waiting for it to get going, then closing my laptop lid.
I think Ubuntu is cleaning the temp files out from under Duplicity?

I'm using Ubuntu 16.10 (so gpg has been replaced with gpg2), gpg2 version 2.1.15, and duplicity version 0.7.07.1.
It sounds like Ubuntu has changed /tmp cleanup; see this post: http://askubuntu.com/a/857154

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 1177381] Re: Duplicity can't find its own tempdir

@Michael, I'm looking as well. My gut says that something got threaded and
we're not joining at the end of the run, but I cannot find any indication
of that at all.

On Wed, Dec 14, 2016 at 5:48 PM, Karl <email address hidden> wrote:

> I'm using a laptop with my power settings set to "Do nothing" when the lid
> is closed. However, I can replicate this by starting duplicity, waiting
> for it to get going, then closing my laptop lid.
> I think Ubuntu is cleaning the temp files out from under Duplicity?
>
> I'm using Ubuntu 16.10 (so gpg has been replaced with gpg2), gpg2 version
> 2.1.15, and duplicity version 0.7.07.1.
> It sounds like Ubuntu has changed /tmp cleanup; see this post:
> http://askubuntu.com/a/857154
>
> --
> You received this bug notification because you are subscribed to
> duplicity in Ubuntu.
> https://bugs.launchpad.net/bugs/1177381
>
> Title:
> Duplicity can't find its own tempdir
>
> Status in Duplicity:
> New
> Status in duplicity package in Ubuntu:
> Confirmed
>
> Bug description:
> My backups have been working normally for months, but today they
> failed with this error:
>
> Failed with an unknown error:
> Traceback (most recent call last):
> File "/usr/bin/duplicity", line 1411, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1404, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1386, in main
> incremental_backup(sig_chain)
> File "/usr/bin/duplicity", line 581, in incremental_backup
> globals.backend)
> File "/usr/bin/duplicity", line 394, in write_multivol
> vi.set_hash("SHA1", gpg.get_hash("SHA1", tdp))
> File "/usr/lib/python2.7/dist-packages/duplicity/gpg.py", line 401,
> in get_hash
> fp = path.open("rb")
> File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 542,
> in open
> result = open(self.name, mode)
> IOError: [Errno 2] No such file or directory: '/tmp/duplicity-rWgqMw-
> tempdir/mktemp-fvN6e5-5'
>
> ProblemType: Bug
> DistroRelease: Ubuntu 13.04
> Package: deja-dup 26.0-0ubuntu1
> ProcVersionSignature: Ubuntu 3.8.0-19.29-generic 3.8.8
> Uname: Linux 3.8.0-19-generic x86_64
> NonfreeKernelModules: nvidia
> ApportVersion: 2.9.2-0ubuntu8
> Architecture: amd64
> Date: Tue May 7 09:12:25 2013
> InstallationDate: Installed on 2010-09-17 (962 days ago)
> InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64
> (20100901.1)
> MarkForUpload: True
> ProcEnviron:
> TERM=xterm
> PATH=(custom, no user)
> XDG_RUNTIME_DIR=<set>
> LANG=en_US.UTF-8
> SHELL=/bin/bash
> SourcePackage: deja-dup
> UpgradeStatus: Upgraded to raring on 2013-01-25 (101 days ago)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1177381/+subscriptions
>

Changed in duplicity:
milestone: none → 0.7.11
milestone: 0.7.11 → 0.8.00
assignee: nobody → Kenneth Loafman (kenneth-loafman)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Frode Nordahl (fnordahl) wrote :

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1532, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1526, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1380, in main
    do_backup(action)
  File "/usr/bin/duplicity", line 1501, in do_backup
    full_backup(col_stats)
  File "/usr/bin/duplicity", line 567, in full_backup
    globals.backend)
  File "/usr/bin/duplicity", line 435, in write_multivol
    vi.set_hash("SHA1", gpg.get_hash("SHA1", tdp))
  File "/usr/lib/python2.7/dist-packages/duplicity/gpg.py", line 434, in get_hash
    fp = path.open("rb")
  File "/usr/lib/python2.7/dist-packages/duplicity/path.py", line 560, in open
    result = open(self.name, mode)
IOError: [Errno 2] No such file or directory: '/tmp/duplicity-CGgEx3-tempdir/mktemp-PKzuQG-6225'

$ ls -ld /tmp/duplicity-CGgEx3-tempdir/mktemp-PKzuQG-6225
ls: cannot access '/tmp/duplicity-CGgEx3-tempdir/mktemp-PKzuQG-6225': No such file or directory

Revision history for this message
Frode Nordahl (fnordahl) wrote :

If I restart the backup it has not completed:
$ duplicity --no-encryption /home/<REDACTED> file:///<REDACTED>
Local and Remote metadata are synchronized, no sync needed.
Last full backup left a partial set, restarting.
Last full backup date: Thu Mar 30 13:08:19 2017
RESTART: Volumes 6223 to 6223 failed to upload before termination.
         Restarting backup at volume 6223.
Restarting after volume 6222, file <REDACTED>, block 909

Revision history for this message
Romain (giot-romain) wrote :

I guess I have a related error.
Initially I used deja-dup for the backup on ubuntu 17.10, but it fails silently since weeks.
So I manually launched duplicity to find what is the error and it is quite cryptic :

PASSPHRASE=<REDACTED> duplicity incremental --progress --full-if-older-than 90D --exclude <REDACTED> --exclude <REDACTED> --exclude -v 5 --allow-source-mismatch <REDACTED> scp://<REDACTED>

[... lots of messages that add or remove files ...]

Suppression de /tmp/duplicity-CPdG9t-tempdir/mktemp-V8VeTq-16
AsyncScheduler: tâche achevée avec succès
Volume 14 traité
Le nettoyage du dossier temporaire /tmp/duplicity-CPdG9t-tempdir a échoué - ceci est probablement un bogue.
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1546, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1540, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1391, in main
    do_backup(action)
  File "/usr/bin/duplicity", line 1522, in do_backup
    incremental_backup(sig_chain)
  File "/usr/bin/duplicity", line 671, in incremental_backup
    globals.backend)
  File "/usr/bin/duplicity", line 432, in write_multivol
    globals.volsize)
  File "/usr/lib/python2.7/dist-packages/duplicity/gpg.py", line 352, in GPGWriteFile
    file = GPGFile(True, path.Path(filename), profile)
  File "/usr/lib/python2.7/dist-packages/duplicity/gpg.py", line 125, in __init__
    self.logger_fp = tempfile.TemporaryFile(dir=tempdir.default().dir())
  File "/usr/lib/python2.7/tempfile.py", line 511, in TemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib/python2.7/tempfile.py", line 244, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
OSError: [Errno 2] No such file or directory: '/tmp/duplicity-CPdG9t-tempdir/tmpRtxeME'

Changed in duplicity:
milestone: 0.8.00 → 0.8.01
Changed in duplicity:
milestone: 0.8.01 → none
Changed in duplicity:
status: In Progress → Fix Released
assignee: Kenneth Loafman (kenneth-loafman) → nobody
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.