[boto] 'SSLError' object has no attribute 'error_code'

Bug #1537185 reported by Wernight on 2016-01-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Undecided
Unassigned

Bug Description

Steps:

Run duplicity with boto for example:

$ docker run --rm -v $PWD:/data:ro -e PASSPHRASE=test -e GS_ACCESS_KEY_ID=GOOGXXXXXXX -e GS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXX wernight/duplicity duplicity /data/test gs://bucket/test

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1525, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1519, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1357, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1103, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 994, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python2.7/site-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python2.7/site-packages/duplicity/backends/_boto_single.py", line 161, in __init__
    self.resetConnection()
  File "/usr/lib/python2.7/site-packages/duplicity/backends/_boto_single.py", line 187, in resetConnection
    if "NoSuchBucket" in e.error_code:
AttributeError: 'SSLError' object has no attribute 'error_code'

(here it's using Docker image it's just the same of course without)

Looks like _boto_single.py:187 is trying to access "error_code" property on SSLError object which probably should instead be accessing the "reason" property (see https://docs.python.org/2/library/ssl.html).

Wernight (werner-beroux) wrote :

OS: Alpine
Versions:

duplicity==0.7.5
pycrypto==2.6.1
PyDrive==1.0.1
pyOpenSSL==0.15.1

Wernight (werner-beroux) wrote :

Outside of fixing the reported error, it's possibly not setting "x-goog-project-id" as is done in the boto example on https://cloud.google.com/storage/docs/gspythonlibrary?hl=en

Wernight (werner-beroux) wrote :

Just tried and the ~/.boto file (which contains the project ID) does work, while environment variables don't.

Gymnae (z-admin-f) wrote :

Dear Wernight,
could you please elaborate what you put into your ~/.boto file, because I'm just running into the same problems - and I'm using your docker image :)

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

Other bug subscribers