0

I get this error when try to restore a backup:

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 1377, in main
    globals.lockfile.acquire(timeout=0)
  File "/usr/lib/python2.7/dist-packages/lockfile/linklockfile.py", line 21, in acquire
    raise LockFailed("failed to create %s" % self.unique_name)
LockFailed: failed to create /home/zoroaster/.cache/deja-dup/d33a3d20343d288863d8447c1af54f02/Avestan.4889-8464751143147245462

It's just a test backup that I do with this setting:

Folders to save:

/etc
/lib
/root
/srv
/var
/usr/local
/home/zoroaster

And folder to exclude:

/var/run
/var/cache
/var/tmp

And from home I exclude Downloads, Videos and a few others.

The storage location is an external usbdrive.

For run backup I use command line with sudo since I am doing backup also of other folder not only home.

However, for test I use GUI, so maybe problem is that I am not restoring using "root"?

In this case, how to test via terminal if backup is successfully and can be restored.

I can also delete the backup and make new one as this is just a test for backup most important data and system in case of need.

As suggested I have install python-lockfile and then there was a button in Restore to install something in deja dup app. After the installation, this is the issue:

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 1377, in main
    globals.lockfile.acquire(timeout=0)
  File "/usr/lib/python2.7/dist-packages/lockfile/linklockfile.py", line 21, in acquire
    raise LockFailed("failed to create %s" % self.unique_name)
LockFailed: failed to create /home/zoroaster/.cache/deja-dup/d33a3d20343d288863d8447c1af54f02/Avestan.7691-8464751143147245462

After doing new backup using GUI, appear now similar error when trying to make new backup:

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 1377, in main
    globals.lockfile.acquire(timeout=0)
  File "/usr/lib/python2.7/dist-packages/lockfile/linklockfile.py", line 21, in acquire
    raise LockFailed("failed to create %s" % self.unique_name)
LockFailed: failed to create /home/zoroaster/.cache/deja-dup/d33a3d20343d288863d8447c1af54f02/Avestan.9581-8464751143147245462

If I do backup on local disc then work fine. the error only appear when trying to backup on usbdrive.

$ ls -dl /home/zoroaster/.cache/deja-dup/d33a3d20343d288863d8447c1af54f02
drwxr-xr-x 2 root root 4096 Jun 11 12:02 /home/zoroaster/.cache/deja-dup/d33a3d20343d288863d8447c1af54f02

After fixing issue, this new happen starting new backup:

Permission denied when trying to create ‘/duplicity-full.20180611T112448Z.vol1.difftar.gpg’
dessert
  • 39,982
Zoroaster
  • 103
  • Awesome.. backup restarted successfully.. I have to wait that finish, and then will try restore. Many thanks for your help. Maybe make a response to not use sudo via terminal for open deja dup GUI, and I will mark as correct. – Zoroaster Jun 11 '18 at 11:24
  • Added... maybe this is because I don't run as sudo.. I read somewhere to use "sudo" ... but can't find. – Zoroaster Jun 11 '18 at 11:33
  • I delete comment. I got your point about "/" and not "/tmp/"... not sure why.. This morning backup worked fine, then restore failed and you know the rest of story.. I will try to re-install deja dup and restart all from scratch (new clean usbdrive, etc). I will try also using sudo -H. thanks for your support. – Zoroaster Jun 11 '18 at 12:02
  • Perhaps you version of python-lockfile is out of date. Try apt-get install python3-lockfile – Brian Jun 11 '18 at 10:33
  • The error is about python2.7 whose lockfile package is python-lockfile, not python3-lockfile. – dessert Jun 11 '18 at 10:49
  • @dessert should I remove the phyton3-lockfile just installed before install phyton-locfile? – Zoroaster Jun 11 '18 at 10:51
  • Make sense.. I remove phyton3-lockfile and installed python-lockfile. After installation I have open backups app and I found instead of button "Restore", there was button "Install" with message "Something important to install". – Zoroaster Jun 11 '18 at 10:55
  • @dessert I open new issue for this second issue, if you wish to reply is here: https://askubuntu.com/questions/1045686/deja-dup-backup-permission-issue thanks! – Zoroaster Jun 11 '18 at 18:03
  • @dessert any idea? – Zoroaster Jun 12 '18 at 19:40
  • Seem duplicate but without solution: https://askubuntu.com/questions/865303/deja-dup-permission-denied-when-trying-to-read-manifest-on-davfs#870613 – Zoroaster Jun 12 '18 at 19:43
  • Sorry, I’m clueless. – dessert Jun 12 '18 at 20:06
  • No problem, I found a workaround. Not really ideal since you need to delete old backup. – Zoroaster Jun 13 '18 at 05:36

1 Answers1

1

GUI applications should never be started with sudo as you did because they’ll save files with wrong permissions and ownership then. This is explained in full here:

Why should users never use normal sudo to start graphical applications?

Your issue seems to be the cache directory mentioned in the error message. As it’s just a cache directory, you can safely remove it with

sudo rm -rf /home/zoroaster/.cache/deja-dup/d33a3d20343d288863d8447c1af54f02

and test the backup again.

dessert
  • 39,982
  • Yes I confirm that this fixed issue. Something new appear, but I think is not in relation with this issue. Thanks – Zoroaster Jun 11 '18 at 11:30