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

Bug #1672540 reported by Benoit Nadeau
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

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/par2backend.py, replace:

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

With:

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

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

Revision history for this message
Benoit Nadeau (benad) wrote :
Revision history for this message
Benoit Nadeau (benad) wrote :

I highly suspect the following bug is a duplicate of this: https://bugs.launchpad.net/duplicity/+bug/1609966 .

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

Another fix is to use shutil in path.py (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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.