par2 backend fails copying sigtar and manifest to cross-device local backend

Bug #1672540 reported by Benoit Nadeau on 2017-03-13
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

duplicity 0.7.11

When using par2+file as the backend, where the file destination is on a different file system than duplicity cache, the destination will be missing the manifest and sigtar files.

Here's the cause: When using the localbackend alone, duplicity will first attempt to use _move, which will fail ("[Errno 18] Invalid cross-device link"), causing it to fall back to _put. When par2backend is used with it, it will attempt to use the original method (self.wrapped_backend._move) on both the original and the new *.par2 files, but unlike BackendWrapper.move it won't attempt to fall back on _put if the _move operation fails. This happens because par2backend doesn't follow the expected behaviour of _move to always return False if there was any error.

The fix is simple: Make the move function behave the same as BackendWrapper.move: If the wrapped _move returns False, use _put and delete the source file.

In duplicity/backends/, replace:

    def move(self, local, remote):
        self.transfer(self.wrapped_backend._move, local, remote)


    def move_wrap(self, local, remote):
        res = self.wrapped_backend._move(local, remote)
        if not res:
            self.wrapped_backend._put(local, remote)

    def move(self, local, remote):
        self.transfer(self.move_wrap, local, remote)
        return True

Benoit Nadeau (benad) wrote :
Benoit Nadeau (benad) wrote :

I highly suspect the following bug is a duplicate of this: .

summary: - par2 backend fails copying signature and manifest to cross-device local
+ par2 backend fails copying sigtar and manifest to cross-device local
Ulrich Muster (ulmu) wrote :

Another fix is to use shutil in (similar to #1684312)

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.7.13
status: New → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers