Comment 11 for bug 1734144

Revision history for this message
Joris van Eijden (joris-vaneijden) wrote :

A size of -1 indicates that the backend server responded with a 404 "file not found" to a HEAD request to get the uploaded file's size.

You might be able to "fix" that by patching the _put method in duplicity/backends/swiftbackend.py to:
1. Check the local file size before uploading.
2. Put the 'self.conn.put_object' in a try/catch block.
3. Check the remote file size after uploading by calling the _query method inside another try/catch block.
4. Retry the upload if either an exception occurs or the file size doesn't match.