Duplicity crashes in Ubuntu 15.04

Bug #1507109 reported by WMH on 2015-10-17
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Duplicity
Medium
Kenneth Loafman
Arch Linux
New
Undecided
Unassigned

Bug Description

Duplicity: 0.7.05
Ubuntu: 15.04

While running a backup, receive the following error. Worked fine in Ubuntu 14.10 but started to fail after upgrade to 15.04.

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/dist-packages/duplicity/commandline.py", line 1103, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 994, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 161, in __init__
    self.resetConnection()
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 187, in resetConnection
    if "NoSuchBucket" in e.error_code:
AttributeError: 'CertificateError' object has no attribute 'error_code'

Download full text (3.4 KiB)

Please check the version of boto. Run 'pip freeze' and make sure boto is
2.30.0 or later.

On Sat, Oct 17, 2015 at 3:24 AM, WMH <email address hidden> wrote:

> Public bug reported:
>
> Duplicity: 0.7.05
> Ubuntu: 15.04
>
> While running a backup, receive the following error. Worked fine in
> Ubuntu 14.10 but started to fail after upgrade to 15.04.
>
> 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/dist-packages/duplicity/commandline.py", line
> 1103, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line
> 994, in set_backend
> globals.backend = backend.get_backend(bend)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 223,
> in get_backend
> obj = get_backend_object(url_string)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line 209,
> in get_backend_object
> return factory(pu)
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line
> 161, in __init__
> self.resetConnection()
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line
> 187, in resetConnection
> if "NoSuchBucket" in e.error_code:
> AttributeError: 'CertificateError' object has no attribute 'error_code'
>
> ** Affects: duplicity
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1507109
>
> Title:
> Duplicity crashes in Ubuntu 15.04
>
> Status in Duplicity:
> New
>
> Bug description:
> Duplicity: 0.7.05
> Ubuntu: 15.04
>
> While running a backup, receive the following error. Worked fine in
> Ubuntu 14.10 but started to fail after upgrade to 15.04.
>
> 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/dist-packages/duplicity/commandline.py", line
> 1103, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line
> 994, in set_backend
> globals.backend = backend.get_backend(bend)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 223, in get_backend
> obj = get_backend_object(url_string)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 209, in get_backend_object
> return factory(pu)
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line
> 161, in __init__
> self.resetConnection()
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", l...

Read more...

Jonas H (jonash) wrote :

This happens for me too:

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: 'gaierror' object has no attribute 'error_code'

$ duplicity --version
duplicity 0.7.05

>>> import boto
>>> boto.__version__
'2.38.0'

This is the only installation of boto I have.

$ find / -type d -iname "boto"
/usr/lib/python2.7/site-packages/boto

OS: Arch Linux

Download full text (3.5 KiB)

Please try backing off to boto 2.30.0 and seeing if that works. The boto
project may be dorking with the code yet again.

On Thu, Dec 31, 2015 at 5:19 AM, Jonas H <email address hidden> wrote:

> This happens for me too:
>
> 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: 'gaierror' object has no attribute 'error_code'
>
> $ duplicity --version
> duplicity 0.7.05
>
> >>> import boto
> >>> boto.__version__
> '2.38.0'
>
> This is the only installation of boto I have.
>
> $ find / -type d -iname "boto"
> /usr/lib/python2.7/site-packages/boto
>
> OS: Arch Linux
>
> ** Also affects: archlinux
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1507109
>
> Title:
> Duplicity crashes in Ubuntu 15.04
>
> Status in Duplicity:
> New
> Status in Arch Linux:
> New
>
> Bug description:
> Duplicity: 0.7.05
> Ubuntu: 15.04
>
> While running a backup, receive the following error. Worked fine in
> Ubuntu 14.10 but started to fail after upgrade to 15.04.
>
> 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/dist-packages/duplicity/commandline.py", line
> 1103, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line
> 994, in set_backend
> globals.backend = backend.get_backend(bend)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 223, in get_backend
> obj = get_backend_object(url_string)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 209, in get_backend_object
> return factory(pu)
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py"...

Read more...

Jonas H (jonash) wrote :

This has nothing to do with the boto version. It's simply a bug in duplicity; namely that an "error_code" attribute is expected to exist in the catched exception, which obviously doesn't hold true for all possible exceptions raised (example: gaierror).

But just to be sure I just tested boto 2.30.0 and I've got identical behavior.

OK, try this, please.

in duplicity/backends/_boto_single.py line 187 change:

            if "NoSuchBucket" in e.error_code:

to this (forces string of e):

            if "NoSuchBucket" in e:

Note, this is just a workaround suggestion. From comments on the web:

"Your question about Boto is a good one, not not easy to answer. The Boto exception hierarchy is poorly designed, and ultimately the only way to determine what the exception you want to trap is requires looking at the boto source code."

Jonas H (jonash) wrote :

Yes, that would work, but it's a hack and doesn't work with Python 3. Looking at the boto source code, the "error_code" only appears on BotoServerError instances, so why not

if isinstance(e, BotoServerError) and "NoSuchBucket" in e.error_code

Changed in duplicity:
assignee: nobody → Kenneth Loafman (kenneth-loafman)
importance: Undecided → Medium
milestone: none → 0.7.07
status: New → In Progress
Chip Rosenthal (chip+launchpad) wrote :

The fix proposed by jonash doesn't work for me:

Traceback (most recent call last):
  File "/usr/local/bin/duplicity", line 1532, in <module>
    with_tempdir(main)
  File "/usr/local/bin/duplicity", line 1526, in with_tempdir
    fn()
  File "/usr/local/bin/duplicity", line 1364, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/local/lib/python2.7/site-packages/duplicity/commandline.py", line 1116, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/local/lib/python2.7/site-packages/duplicity/commandline.py", line 1005, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/usr/local/lib/python2.7/site-packages/duplicity/backend.py", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "/usr/local/lib/python2.7/site-packages/duplicity/backend.py", line 209, in get_backend_object
    return factory(pu)
  File "/usr/local/lib/python2.7/site-packages/duplicity/backends/_boto_single.py", line 161, in __init__
    self.resetConnection()
  File "/usr/local/lib/python2.7/site-packages/duplicity/backends/_boto_single.py", line 187, in resetConnection
    if isinstance(e, BotoServerError) and "NoSuchBucket" in e.error_code:
NameError: global name 'BotoServerError' is not defined

Versions:
duplicity 7.06
python 2.7.9
boto 2.34

Jonas H (jonash) wrote :

Well you gotta import it of course.

from boto.exception import BotoServerError

@Jonas, does your fix work in older Boto versions? Not worried about Py3
at the moment.

On Thu, Jan 21, 2016 at 11:37 AM, Jonas H <email address hidden>
wrote:

> Well you gotta import it of course.
>
> from boto.exception import BotoServerError
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1507109
>
> Title:
> Duplicity crashes in Ubuntu 15.04
>
> Status in Duplicity:
> In Progress
> Status in Arch Linux:
> New
>
> Bug description:
> Duplicity: 0.7.05
> Ubuntu: 15.04
>
> While running a backup, receive the following error. Worked fine in
> Ubuntu 14.10 but started to fail after upgrade to 15.04.
>
> 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/dist-packages/duplicity/commandline.py", line
> 1103, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line
> 994, in set_backend
> globals.backend = backend.get_backend(bend)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 223, in get_backend
> obj = get_backend_object(url_string)
> File "/usr/lib/python2.7/dist-packages/duplicity/backend.py", line
> 209, in get_backend_object
> return factory(pu)
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line
> 161, in __init__
> self.resetConnection()
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line
> 187, in resetConnection
> if "NoSuchBucket" in e.error_code:
> AttributeError: 'CertificateError' object has no attribute 'error_code'
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1507109/+subscriptions
>

Jonas H (jonash) wrote :

I don't know but I think this should be easy to look up from the boto documentation or source code

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

Other bug subscribers