duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Python error in Webdav backend


From: Sven Hazejager
Subject: Re: [Duplicity-talk] Python error in Webdav backend
Date: Fri, 20 Sep 2019 19:04:24 +0200

Hi Edgar,

On Fri, 20 Sep 2019 at 15:12, edgar.soldin--- via Duplicity-talk <address@hidden> wrote:

probably this issue
  https://stackoverflow.com/questions/8908287/why-do-i-need-b-to-encode-a-string-with-base64

try patching /usr/local/lib/python3.7/dist-packages/duplicity/backends/webdavbackend.py", line 291
from
  return u'Basic %s' % base64.encodestring(auth_string).strip()
to
  return u'Basic %s' % base64.encodestring( bytes(auth_string, "utf-8") ).strip()

and see if that works. if so please tell us so we can patch this bug accordingly.


Thanks, not solved yet, but we're close. Below is the current output. The call actually goes through to the server. BUT, where the asterisks are is the Base64 encoded password... and it has a leading " b' ", which my working duplicity install does NOT have. I am not sure if that is a part of the newly created byte array, are that it gets added somewhere else when the byte array is printed.

WebDAV create connection on 'svenhz.stackstorage.com'
WebDAV PROPFIND /remote.php/webdav/backup/tmp/ request with headers: {'Connection': 'keep-alive', 'Depth': '1'}
WebDAV data length: 95
WebDAV response status 401 with reason 'Unauthorized'.
WebDAV retry request with authentification headers.
WebDAV PROPFIND /remote.php/webdav/backup/tmp/ request2 with headers: {'Connection': 'keep-alive', 'Depth': '1', 'Authorization': "Basic b'*****************'"}
WebDAV data length: 95
WebDAV response2 status 401 with reason 'Unauthorized'.
Backtrace of previous error: Traceback (innermost last):
  File "/usr/local/lib/python3.7/dist-packages/duplicity/backend.py", line 371, in inner_retry
    return fn(self, *args)
  File "/usr/local/lib/python3.7/dist-packages/duplicity/backend.py", line 580, in list
    return [tobytes(x) for x in self.backend._list()]
  File "/usr/local/lib/python3.7/dist-packages/duplicity/backends/webdavbackend.py", line 343, in _list
    raise e
  File "/usr/local/lib/python3.7/dist-packages/duplicity/backends/webdavbackend.py", line 332, in _list
    raise BackendException(u"Bad status code %s reason %s." % (status, reason))
 duplicity.errors.BackendException: Bad status code 401 reason Unauthorized.

Attempt 1 failed. BackendException: Bad status code 401 reason Unauthorized.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]