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

Bug #1672540 reported by Benoit Nadeau on 2017-03-13
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Undecided
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

Benoit Nadeau (benad) wrote :
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
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