InvalidBackendURL for multi backend

Bug #1851727 reported by Tommy Nguyen on 2019-11-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Medium
Unassigned

Bug Description

This is a repost of https://lists.nongnu.org/archive/html/duplicity-talk/2019-11/msg00000.html since I did not get a response.

duplicity 0.8.05
Python 3.7.5
Fedora 31
Linux
$ duplicity collection-status
'multi:///home/tom/duplicity.json?mode=mirror'
InvalidBackendURL: Syntax error (path) in:
b'file:///home/tom/second_drive/backup/'

My duplicity.json contains the following contents:

[
    {
        "description": "second drive",
        "url": "file:///home/tom/second_drive/backup/"
    },
    {
        "description": "third drive",
        "url": "file:///home/tom/third_drive/backup/"
    }
]

Using 'file:///home/tom/second_drive/backup/' directly seems to work
fine, so the problem seems to be related to the multi backend. Here is
a full stack trace:

MultiBackend: use store b'file:///home/tom/second_drive/backup/'
Using temporary directory /tmp/duplicity-q8pkrkbc-tempdir
User error detail: Traceback (innermost last):
  File "/usr/bin/duplicity", line 101, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 87, in with_tempdir
    fn()
  File "/usr/lib64/python3.7/site-packages/duplicity/dup_main.py", line
1519, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib64/python3.7/site-packages/duplicity/commandline.py",
line 1203, in ProcessCommandLine
    globals.backend = backend.get_backend(args[0])
  File "/usr/lib64/python3.7/site-packages/duplicity/backend.py", line
225, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib64/python3.7/site-packages/duplicity/backend.py", line
211, in get_backend_object
    return factory(pu)
  File "/usr/lib64/python3.7/site-
packages/duplicity/backends/multibackend.py", line 197, in __init__
    store = duplicity.backend.get_backend(url)
  File "/usr/lib64/python3.7/site-packages/duplicity/backend.py", line
225, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib64/python3.7/site-packages/duplicity/backend.py", line
188, in get_backend_object
    if not is_backend_url(url_string):
  File "/usr/lib64/python3.7/site-packages/duplicity/backend.py", line
172, in is_backend_url
    pu = ParsedUrl(url_string)
  File "/usr/lib64/python3.7/site-packages/duplicity/backend.py", line
274, in __init__
    raise InvalidBackendURL(u"Syntax error (path) in: %s" % url_string)
 duplicity.errors.InvalidBackendURL: Syntax error (path) in:
b'file:///home/tom/second_drive/backup/'

Based on my debugging, the issue is that the type of pu.path is a bytes string when urllib.parse.unquote expects a str.

Vojtech Horky (vojtech-horky) wrote :

Confirming and adding one more observation. backend.py gets data from two sources: command line and the multibackend JSON so one of them comes as normal string, the other one as bytes. So any fix needs to unify this across the whole class.

Changed in duplicity:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Kenneth Loafman (kenneth-loafman)
milestone: none → 0.8.07
Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
status: In Progress → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
Tim Passingham (tim-8aw3u04umo) wrote :

I am on ubuntu 19.10, running duplicity 8.04-2-ubuntu1
I get a similar error, but I don't know if it's the same. I tried looking at ppas for a later version but didn't find one.

Traceback (innermost last):
  File "/usr/bin/duplicity", line 107, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 93, in with_tempdir
    fn()
  File "/usr/lib/python3/dist-packages/duplicity/dup_main.py", line 1522, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/duplicity/commandline.py", line 1200, in ProcessCommandLine
    globals.backend = backend.get_backend(args[0])
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 225, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python3/dist-packages/duplicity/backend.py", line 211, in get_backend_object
    return factory(pu)
  File "/usr/lib/python3/dist-packages/duplicity/backends/giobackend.py", line 81, in __init__
    ensure_dbus()
  File "/usr/lib/python3/dist-packages/duplicity/backends/giobackend.py", line 37, in ensure_dbus
    lines = output.split(u'\n')
 TypeError: a bytes-like object is required, not 'str'

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

Other bug subscribers