The authorization mechanism you have provided is not supported

Bug #1860405 reported by Johan on 2020-01-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Medium
Unassigned

Bug Description

Ubuntu 18.04
Duplicity 0.7.17
Python 2.7.17
Boto 2.49.0

$ duplicity --s3-european-buckets --s3-use-new-style -v 4 --archive-dir=/root/duptest --full-if-older-than 14D test "s3+http://mybucket/private/backups/test"

Traceback (innermost last):
  File "/usr/bin/duplicity", line 1555, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1541, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1380, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1135, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1010, 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 166, in __init__
    self.resetConnection()
  File "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line 191, in resetConnection
    location=self.my_location)
  File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py", line 628, in create_bucket
    response.status, response.reason, body)
 S3ResponseError: S3ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRequest</Code><Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message><RequestId>7F755XXXF5359CB9</RequestId><HostId>tlcPGQlt+E7xxxxN4Vsl/L6HVM57NaFnI/mwsgresi8wseMY+XUMT8LVyjGxxxxXDCFKMt/w=</HostId></Error>

Please upgrade to the current version of duplicity, 0.8.09. This will assure that any bugs fixed since your release are available and may fix your issue.

There are four options:

* Release tarball install - https://launchpad.net/duplicity/+download
* Daily duplicity builds - https://launchpad.net/~duplicity-team/+archive/ubuntu/daily-dev-trunk
* Stable snap builds - “sudo snap install duplicity —classic"
* Latest snap builds - “sudo snap install duplicity —classic —edge"

NOTE: UNinstall duplicity first if it was installed via the distribution repository. For Ubuntu, that would be "sudo apt-get purge duplicity".

Changed in duplicity:
status: New → Incomplete
Johan (ignesia) wrote :

Installed via snap:

-su: /usr/bin/duplicity: No such file or directory

Are you supposed to run the full path? /snap/duplicity/current/bin/duplicity

Traceback (most recent call last):
  File "/snap/duplicity/current/bin/duplicity", line 31, in <module>
    from future import standard_library
ModuleNotFoundError: No module named 'future'

No. Do this:

$ hash -r
this will clear the in-memory hash of previously run programs

then this will work

$ duplicity --version
duplicity 0.8.10dev

Johan (ignesia) wrote :

Still same AWS4-HMAC-SHA256 error.

$ duplicity -V
duplicity 0.8.09

Changed in duplicity:
status: Incomplete → In Progress
importance: Undecided → Medium
milestone: none → 0.8.11
assignee: nobody → Kenneth Loafman (kenneth-loafman)

Try using boto3+s3:// as the backend for the 0.8.09 that you have installed. It should work. Please let us know either way.

Changed in duplicity:
status: In Progress → Incomplete
Johan (ignesia) wrote :

Please elaborate.

$ pip install boto3

$ pip show boto3
Name: boto3
Version: 1.11.12

# duplicity --s3-european-buckets --s3-use-new-style -v 4 --archive-dir=/root/duptest --full-if-older-than 14D test "boto3+s3://mybucket/private/backups/database/test"

BackendException: Could not initialize backend: No module named 'boto3'

Use pip3 to install boto3. duplicity runs under Python 3.6 and up.

On Thu, Feb 6, 2020 at 8:55 PM Johan <email address hidden> wrote:

> Please elaborate.
>
> $ pip install boto3
>
> $ pip show boto3
> Name: boto3
> Version: 1.11.12
>
> # duplicity --s3-european-buckets --s3-use-new-style -v 4 --archive-
> dir=/root/duptest --full-if-older-than 14D test
> "boto3+s3://mybucket/private/backups/database/test"
>
> BackendException: Could not initialize backend: No module named 'boto3'
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1860405
>
> Title:
> The authorization mechanism you have provided is not supported
>
> Status in Duplicity:
> Incomplete
>
> Bug description:
> Ubuntu 18.04
> Duplicity 0.7.17
> Python 2.7.17
> Boto 2.49.0
>
> $ duplicity --s3-european-buckets --s3-use-new-style -v 4 --archive-
> dir=/root/duptest --full-if-older-than 14D test
> "s3+http://mybucket/private/backups/test"
>
> Traceback (innermost last):
> File "/usr/bin/duplicity", line 1555, in <module>
> with_tempdir(main)
> File "/usr/bin/duplicity", line 1541, in with_tempdir
> fn()
> File "/usr/bin/duplicity", line 1380, in main
> action = commandline.ProcessCommandLine(sys.argv[1:])
> File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line
> 1135, in ProcessCommandLine
> backup, local_pathname = set_backend(args[0], args[1])
> File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line
> 1010, 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
> 166, in __init__
> self.resetConnection()
> File
> "/usr/lib/python2.7/dist-packages/duplicity/backends/_boto_single.py", line
> 191, in resetConnection
> location=self.my_location)
> File "/usr/local/lib/python2.7/dist-packages/boto/s3/connection.py",
> line 628, in create_bucket
> response.status, response.reason, body)
> S3ResponseError: S3ResponseError: 400 Bad Request
> <?xml version="1.0" encoding="UTF-8"?>
> <Error><Code>InvalidRequest</Code><Message>The authorization mechanism
> you have provided is not supported. Please use
> AWS4-HMAC-SHA256.</Message><RequestId>7F755XXXF5359CB9</RequestId><HostId>tlcPGQlt+E7xxxxN4Vsl/L6HVM57NaFnI/mwsgresi8wseMY+XUMT8LVyjGxxxxXDCFKMt/w=</HostId></Error>
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1860405/+subscriptions
>

Johan (ignesia) wrote :

Same problem.

# pip3 show boto3
Name: boto3
Version: 1.11.7
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: UNKNOWN
License: Apache License 2.0
Location: /usr/local/lib/python3.6/dist-packages
Requires: jmespath, s3transfer, botocore

BackendException: Could not initialize backend: No module named 'boto3'

Please run with -v9, redirect it to a file, and attach to this bug report.

Johan (ignesia) wrote :

Using archive dir: /root/duptest/2d96b44859e09e747c4d4a43bcc18302
Using backup name: 2d96b44859e09e747c4d4a43bcc18302
GPG binary is gpg, version (2, 2, 4)
Import of duplicity.backends.adbackend 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 Succeeded
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.jottacloudbackend 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.pcabackend Succeeded
Import of duplicity.backends.pydrivebackend Succeeded
Import of duplicity.backends.rclonebackend Succeeded
Import of duplicity.backends.rsyncbackend Succeeded
Import of duplicity.backends.s3_boto3_backend 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-wag2qdtg-tempdir
Backend error detail: Traceback (innermost last):
  File "/snap/duplicity/62/bin/duplicity", line 100, in <module>
    with_tempdir(main)
  File "/snap/duplicity/62/bin/duplicity", line 86, in with_tempdir
    fn()
  File "/snap/duplicity/62/lib/python3.6/site-packages/duplicity/dup_main.py", line 1525, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/snap/duplicity/62/lib/python3.6/site-packages/duplicity/commandline.py", line 1187, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/snap/duplicity/62/lib/python3.6/site-packages/duplicity/commandline.py", line 1058, in set_backend
    globals.backend = backend.get_backend(bend)
  File "/snap/duplicity/62/lib/python3.6/site-packages/duplicity/backend.py", line 225, in get_backend
    obj = get_backend_object(url_string)
  File "/snap/duplicity/62/lib/python3.6/site-packages/duplicity/backend.py", line 213, in get_backend_object
    raise BackendException(_(u"Could not initialize backend: %s") % str(sys.exc_info()[1]))
 duplicity.errors.BackendException: Could not initialize backend: No module named 'boto3'

My bad. python3-boto3 was not in the snap build. It's been rebuilt and you need to refresh.

$ sudo snap refresh duplicity --classic --edge

Changed in duplicity:
assignee: Kenneth Loafman (kenneth-loafman) → nobody
status: Incomplete → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers