Try overwriting file with an 0-byte file on delete failure (workaround for Hetzner's backup backend)

Bug #700395 reported by Daniel Hahler
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Duplicity
Confirmed
Low
Unassigned

Bug Description

I've run into an issue with the backup backend provided by Hetzner (a German provider):
when the backup space is full, you cannot remove any files, but have to overwrite the file with a 0-byte file of the same name. Only then you can delete the original file.

In duplicity the failure looks like this:
Running 'sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 <email address hidden>' (attempt #1)
State = sftp, Before = 'Connected to u123.your-backup.de.'
sftp command: 'cd "moby/"'
State = sftp, Before = 'cd "moby/"'
sftp command: 'rm "duplicity-full.20110105T145659Z.vol1.difftar.gpg"'
State = sftp, Before = 'rm "duplicity-full.20110105T145659Z.vol1.difftar.gpg"
Removing /moby/duplicity-full.20110105T145659Z.vol1.difftar.gpg'
Could not delete file in command='sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 <email address hidden>'
Running 'sftp -oServerAliveInterval=15 -oServerAliveCountMax=2 <email address hidden>' failed (attempt #1)

Replaying this via "sftp" looks like this:
sftp> rm "duplicity-full.20110105T145659Z.vol1.difftar.gpg"
Removing /moby/duplicity-full.20110105T145659Z.vol1.difftar.gpg
Couldn't delete file: Failure

There are two issues here:
1. The error "Couldn't delete file: Failure" should get logged. At least with verbosity=9, but also with something like 4 (default?!).
2. At least in case of this exact error ("Couldn't delete file: Failure") it should try the following procedure:
upload a 0-byte file, overwriting the file that should get deleted. If this works, try the "rm" again.

Daniel Hahler (blueyed)
Changed in duplicity:
status: New → In Progress
assignee: nobody → Daniel Hahler (blueyed)
Changed in duplicity:
importance: Undecided → Medium
Changed in duplicity:
importance: Medium → Low
Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Have you tried this yet? Did it work?

Revision history for this message
Daniel Hahler (blueyed) wrote :

Yes, it did work.
I have this patch laying around in my source tree at the server, but ran into some merge conflicts and gave up the last time I've tried to extract it.

I plan to get back to this during the next year, and will provide a branch to merge here.

Changed in duplicity:
status: In Progress → Confirmed
assignee: Daniel Hahler (blueyed) → nobody
Revision history for this message
Röbke Geenen (rgeenen-lp-oops) wrote :

On a related note, the Stack platform of the Dutch TransIP also takes the size of deleted files into account when determining space usage, unless the files are permanently deleted via the web interface. A workaround is to overwrite the files with zero-byte files before deleting them.

It would be great to have an option in duplicity to overwrite all files to be deleted by zero-byte files first.

Should I make a separate feature request, or is it related closely enough to this bug?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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