Duplicity fails to back up to directories with spaces in B2

Bug #1717935 reported by Andrew Berry
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Fix Released
Medium
Unassigned

Bug Description

If I try to back up to a B2 key that contains a space (b2://user@bucket/Purchased Apps), only the initial backup is successful. Subsequent backups fail with a HTTP 505. If I remove the space, I can run an incremental backup. Since B2 doesn't support server-side renames, I used rclone to copy the backup repository into a new directory, and a backup worked fine after that.

I'm using duplicity 0.7.14 on Ubuntu 16.04 from the PPA.

/usr/bin/duplicity --name duply_purchased-apps --encrypt-key XXX --encrypt-key XXX --sign-key XXX --verbosity 9 --exclude-filelist /etc/duply/purchased-apps/exclude '/main/media/Purchased Apps' 'b2://XXX@XXXX/Purchased Apps'

<snip>

Registering (mktemp) temporary file /tmp/duplicity-x6csjM-tempdir/mktemp-2jFn1G-2
Getting file duplicity-full.20170913T000217Z.manifest.gpg
Getting https://f001.backblazeb2.com/file/XXX/Purchased Apps/duplicity-full.2
0170913T000217Z.manifest.gpg
Backtrace of previous error: Traceback (innermost last):
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 369, in inner_retry
    return fn(self, *args)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 545, in get
    self.backend._get(remote_filename, local_path)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/b2backend.py", line 105, in _get
    resp = self.get_or_post(url, None)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/b2backend.py", line 296, in get_or_post
    raise e
 HTTPError: HTTP Error 505: HTTP Version Not Supported

Attempt 1 failed. HTTPError: HTTP Error 505: HTTP Version Not Supported

Revision history for this message
strainu (strainu) wrote :

IMHO this bug is important, because we're not in the 8+3 names' era anymore.

I've been playing around a bit with the code and it would seem this is an encoding issue. The Backblaze instructions on the subject [1] do not seem correct, as experimentally, at least the X-Bz-File-Name header should *not* be encoded (probably others as well). That leaves mainly the _get function to be encoded. A poor man's encoding (replacing spaces with "%20" or "+") seems to work, but a full solution should properly encode all URLs sent to B2.

[1] https://www.backblaze.com/b2/docs/string_encoding.html

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.7.18
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.

Other bug subscribers

Remote bug watches

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