12

Often when I run Duplicity I see an error message like this at the end of the run:

Cleanup of temporary file /home/user/.cache/duplicity/9a169830d41477b2dbc3c5b32edd4e8a/duplicity-MEXhMY-tempdir/mktemp-StAkzj-1 failed

The mentioned directory will contain ten or so files that are deleted the next time I run Duplicity.

Any idea why this sometimes fails when running incremental backups? I have not seen any pattern to it myself, and have had little luck in finding others mentioning the same issue. Some guy on some emailing list once mentioned that his locale caused problems for Duplicity. I tried changing from my normal Norwegian bokmål locale to en-US, but still see the issue.

Is this just normal operation for Duplicity?

Seeing it on three different systems: two Ubuntu 13.04 64-bit desktops and one Ubuntu Server 13.04 64-bit.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Daniel
  • 1,207
  • 3
  • 14
  • 30
  • I'm having this issue too since moving my duplicity cron job to be performed by root instead of a sudo user. I wonder if somehow duplicity doesn't have the ability to delete the temp files it creates while running a script croned from the root user? – Lonnie Best Nov 01 '13 at 20:27
  • I'm still hoping for an answer here. – Lonnie Best Jan 30 '14 at 21:31
  • Did you install GunPG ? I had the same issue (on OS X) until I've installed GPG tools. – Cédric Oct 14 '14 at 19:31
  • Properly configured Duplicity should not do that. You might find these steps useful: [Duplicity](https://wiki.debian.org/Duplicity) I know you are on Ubuntu, but I cannot find any suitable source for you. It *should* be universal. – Vlastimil Burián Aug 09 '15 at 11:29

2 Answers2

1

This may happen if you've previously run duplicity as root. The files will belong to the root user and therefore can't be removed by a non-privileged user. Simply changing the owner of the files will fix this, if this is the case:

$ sudo chown -R user /home/user/.cache/duplicity/
NeilenMarais
  • 141
  • 5
Kusalananda
  • 320,670
  • 36
  • 633
  • 936
0

Maybe try modifying /usr/lib/python2.7/dist-packages/duplicity/tempdir.py (or wherever that file is at your system) to add a more specific exception handler, it seems to do just this:

except Exception:
    log.Info(_("Cleanup of temporary file %s failed") % util.ufn(file))
pass

A more specific error handler added in front of that could try and show the more specific error number:

except OSError as ex:
    log.Info(_("Cleanup of temporary file %s failed with errno %d") % (util.ufn(file), ex.errno))
pass

Running it under strace would show the errno of the unlink call, but would likely be slower and waste a lot of disk space for the log, esp. given the nature of what duplicity does.

Josip Rodin
  • 1,119
  • 8
  • 14