Backup to b2 fails on 0.7.15

Bug #1735825 reported by Dylan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Invalid
Undecided
Unassigned

Bug Description

Duplicity installed on Arch Linux: backup to b2 fails on duplicity 0.7.15.

Backup to b2 works on 0.7.14.

Error message copied below. It indicates need to install b2 utility with pip - doing this makes no difference to error. Note b2 CLI utility not installed with 0.7.14 but backups to b2 working nonetheless.

Backend error detail: Traceback (innermost last):
  File "/usr/bin/duplicity", line 1559, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1545, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1381, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1140, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1015, 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/b2backend.py", line 65, in __init__
    raise BackendException('B2 backend requires B2 Python APIs (pip install b2)')
 BackendException: B2 backend requires B2 Python APIs (pip install b2)

BackendException: B2 backend requires B2 Python APIs (pip install b2)

Duplicity version: 0.7.15
Python version: 3.6.3
OS Distro and version: Arch Linux
Type of target filesystem: Linux

Tags: b2
Revision history for this message
Dylan (dmrowe) wrote :

It looks like this started with the new b2 backend at revision 1329.

The backend now imports the b2 API - it looks like the old backend used its own code to manipulate buckets.

For some reason though when the backend attempts to import the API this fails - even with the b2 CLI tool installed.

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote : Re: [Bug 1735825] Re: Backup to b2 fails on 0.7.15

Try this:

$ sudo pip install -U b2

and paste the log to the bug report.

On Fri, Dec 1, 2017 at 6:06 PM, Dylan <email address hidden> wrote:

> It looks like this started with the new b2 backend at revision 1329.
>
> The backend now imports the b2 API - it looks like the old backend used
> its own code to manipulate buckets.
>
> For some reason though when the backend attempts to import the API this
> fails - even with the b2 CLI tool installed.
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1735825
>
> Title:
> Backup to b2 fails on 0.7.15
>
> Status in Duplicity:
> New
>
> Bug description:
> Duplicity installed on Arch Linux: backup to b2 fails on duplicity
> 0.7.15.
>
> Backup to b2 works on 0.7.14.
>
> Error message copied below. It indicates need to install b2 utility
> with pip - doing this makes no difference to error. Note b2 CLI
> utility not installed with 0.7.14 but backups to b2 working
> nonetheless.
>
> Backend error detail: Traceback (innermost last):
> File "/usr/bin/duplicity", line 1559, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1545, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1381, in main
> action = commandline.ProcessCommandLine(sys.argv[1:])
> File "/usr/lib/python2.7/site-packages/duplicity/commandline.py",
> line 1140, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/site-packages/duplicity/commandline.py",
> line 1015, 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/b2backend.py",
> line 65, in __init__
> raise BackendException('B2 backend requires B2 Python APIs (pip
> install b2)')
> BackendException: B2 backend requires B2 Python APIs (pip install b2)
>
> BackendException: B2 backend requires B2 Python APIs (pip install b2)
>
> Duplicity version: 0.7.15
> Python version: 3.6.3
> OS Distro and version: Arch Linux
> Type of target filesystem: Linux
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1735825/+subscriptions
>

Revision history for this message
Dylan (dmrowe) wrote :

Ran sudo pip install -U b2

Then ran duplicity at verbosity 9:

Using archive dir: /root/.cache/duplicity/0d2de25691c15b6f531581b30c8a3c04
Using backup name: 0d2de25691c15b6f531581b30c8a3c04
GPG binary is gpg, version 2.2.3
Import of duplicity.backends.acdclibackend Succeeded
Import of duplicity.backends.azurebackend Succeeded
Import of duplicity.backends.b2backend Succeeded
Import of duplicity.backends.botobackend Succeeded
Import of duplicity.backends.cfbackend Succeeded
Import of duplicity.backends.dpbxbackend Failed: No module named dropbox
Import of duplicity.backends.gdocsbackend Succeeded
Import of duplicity.backends.giobackend Succeeded
Import of duplicity.backends.hsibackend Succeeded
Import of duplicity.backends.hubicbackend Succeeded
Import of duplicity.backends.imapbackend Succeeded
Import of duplicity.backends.lftpbackend Succeeded
Import of duplicity.backends.localbackend Succeeded
Import of duplicity.backends.mediafirebackend Succeeded
Import of duplicity.backends.megabackend Succeeded
Import of duplicity.backends.multibackend Succeeded
Import of duplicity.backends.ncftpbackend Succeeded
Import of duplicity.backends.onedrivebackend Succeeded
Import of duplicity.backends.par2backend Succeeded
Import of duplicity.backends.pydrivebackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.ssh_paramiko_backend Succeeded
Import of duplicity.backends.ssh_pexpect_backend Succeeded
Import of duplicity.backends.swiftbackend Succeeded
Import of duplicity.backends.sxbackend Succeeded
Import of duplicity.backends.tahoebackend Succeeded
Import of duplicity.backends.webdavbackend Succeeded
Using temporary directory /tmp/duplicity-n4iwrz-tempdir
Backend error detail: Traceback (innermost last):
  File "/usr/bin/duplicity", line 1559, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1545, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1381, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1140, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line 1015, 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/b2backend.py", line 65, in __init__
    raise BackendException('B2 backend requires B2 Python APIs (pip install b2)')
 BackendException: B2 backend requires B2 Python APIs (pip install b2)

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :
Download full text (5.6 KiB)

First, did you have b2 installed via the repository, not pip? If so,
remove it and reinstall from pip. They will use different directories and
the repo folks like to screw up pip by putting theirs first. Pip is the
official Python repository.

Second, try this:

$ python
Python 2.7.14 (default, Sep 25 2017, 09:54:19)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import b2
>>> import b2.api
>>> import b2.account_info
>>> import b2.download_dest
>>> import b2.file_version
>>> ^D

You enter the items in red. You should see no errors.

Send the entire output if you get errors, from line one down.

On Sun, Dec 3, 2017 at 2:37 PM, Dylan <email address hidden> wrote:

> Ran sudo pip install -U b2
>
> Then ran duplicity at verbosity 9:
>
> Using archive dir: /root/.cache/duplicity/0d2de25691c15b6f531581b30c8a3c04
> Using backup name: 0d2de25691c15b6f531581b30c8a3c04
> GPG binary is gpg, version 2.2.3
> Import of duplicity.backends.acdclibackend Succeeded
> Import of duplicity.backends.azurebackend Succeeded
> Import of duplicity.backends.b2backend Succeeded
> Import of duplicity.backends.botobackend Succeeded
> Import of duplicity.backends.cfbackend Succeeded
> Import of duplicity.backends.dpbxbackend Failed: No module named dropbox
> Import of duplicity.backends.gdocsbackend Succeeded
> Import of duplicity.backends.giobackend Succeeded
> Import of duplicity.backends.hsibackend Succeeded
> Import of duplicity.backends.hubicbackend Succeeded
> Import of duplicity.backends.imapbackend Succeeded
> Import of duplicity.backends.lftpbackend Succeeded
> Import of duplicity.backends.localbackend Succeeded
> Import of duplicity.backends.mediafirebackend Succeeded
> Import of duplicity.backends.megabackend Succeeded
> Import of duplicity.backends.multibackend Succeeded
> Import of duplicity.backends.ncftpbackend Succeeded
> Import of duplicity.backends.onedrivebackend Succeeded
> Import of duplicity.backends.par2backend Succeeded
> Import of duplicity.backends.pydrivebackend Succeeded
> Import of duplicity.backends.rsyncbackend Succeeded
> Import of duplicity.backends.ssh_paramiko_backend Succeeded
> Import of duplicity.backends.ssh_pexpect_backend Succeeded
> Import of duplicity.backends.swiftbackend Succeeded
> Import of duplicity.backends.sxbackend Succeeded
> Import of duplicity.backends.tahoebackend Succeeded
> Import of duplicity.backends.webdavbackend Succeeded
> Using temporary directory /tmp/duplicity-n4iwrz-tempdir
> Backend error detail: Traceback (innermost last):
> File "/usr/bin/duplicity", line 1559, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1545, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1381, in main
> action = commandline.ProcessCommandLine(sys.argv[1:])
> File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line
> 1140, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/site-packages/duplicity/commandline.py", line
> 1015, in set_backend
> globals.backend = backend.get_backend(bend)
> File "/usr/lib/python2.7...

Read more...

Revision history for this message
Dylan (dmrowe) wrote :

Thanks for the suggestions - yep, b2 installed via pip (I don't think b2 is in the Arch repos - just unofficial versions in AUR).

No errors on any of the imports (in fact, they tab autocompleted, so they are 'there' as far as Python is concerned.

Python 3.6.3 (default, Oct 24 2017, 14:48:20)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import b2
>>> import b2.api
>>> import b2.account_info
>>> import b2.download_dest
>>> import b2.file_version

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

OK, there's the problem. Duplicity is still on Python 2.7.

Try "$ pip2 install b2". That should do it.

On Mon, Dec 4, 2017 at 3:40 AM, Dylan <email address hidden> wrote:

> Thanks for the suggestions - yep, b2 installed via pip (I don't think b2
> is in the Arch repos - just unofficial versions in AUR).
>
> No errors on any of the imports (in fact, they tab autocompleted, so
> they are 'there' as far as Python is concerned.
>
> Python 3.6.3 (default, Oct 24 2017, 14:48:20)
> [GCC 7.2.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import b2
> >>> import b2.api
> >>> import b2.account_info
> >>> import b2.download_dest
> >>> import b2.file_version
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1735825
>
> Title:
> Backup to b2 fails on 0.7.15
>
> Status in Duplicity:
> New
>
> Bug description:
> Duplicity installed on Arch Linux: backup to b2 fails on duplicity
> 0.7.15.
>
> Backup to b2 works on 0.7.14.
>
> Error message copied below. It indicates need to install b2 utility
> with pip - doing this makes no difference to error. Note b2 CLI
> utility not installed with 0.7.14 but backups to b2 working
> nonetheless.
>
> Backend error detail: Traceback (innermost last):
> File "/usr/bin/duplicity", line 1559, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1545, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1381, in main
> action = commandline.ProcessCommandLine(sys.argv[1:])
> File "/usr/lib/python2.7/site-packages/duplicity/commandline.py",
> line 1140, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/site-packages/duplicity/commandline.py",
> line 1015, 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/b2backend.py",
> line 65, in __init__
> raise BackendException('B2 backend requires B2 Python APIs (pip
> install b2)')
> BackendException: B2 backend requires B2 Python APIs (pip install b2)
>
> BackendException: B2 backend requires B2 Python APIs (pip install b2)
>
> Duplicity version: 0.7.15
> Python version: 3.6.3
> OS Distro and version: Arch Linux
> Type of target filesystem: Linux
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1735825/+subscriptions
>

Changed in duplicity:
status: New → Invalid
Revision history for this message
Dylan (dmrowe) wrote :

Thanks heaps - that got it.

For anyone Googling, you'll need a "sudo pacman -S python2-pip" to install pip2 on Arch.

Revision history for this message
Julian Robbins (joolsr) wrote :

Unfortunately I too am having the same issues as reported by original poster but I am using Python 2.7. This breaks using B2 for me unless I use Duplicity on the cmd line and not in a script.

Previous versions did work it appears ..
I'm using Ubuntu 16.04 server, not Arch

I can provide more details when I'm back at the install tomorrow

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

OK, read the comments above and check that b2 is indeed installed.

Revision history for this message
Frank (a-frank) wrote :

Use "pip2 install b2".

The regular pip probably uses python3, so it installs the b2 module in the python3 packages dir if you use pip install b2.

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.