Duplicity 和 S3 Frankfurt 存储桶错误:请使用 AWS4-HMAC-SHA256

Duplicity 和 S3 Frankfurt 存储桶错误:请使用 AWS4-HMAC-SHA256

我正在尝试通过以下方式备份我的文件表里不一到 Amazon S3 – 法兰克福地区 (eu-central-1) 的存储桶。

我的命令:

/usr/bin/duplicity \
    --exclude-if-present do-not-backup \
    --s3-use-new-style \
    --s3-use-ia \
    --sign-key 9CCF...585 \
    --encrypt-key 9CCF...585 \
    --encrypt-key 9D43...725 \
    --use-agent \
    / \
    s3+http://my-example-frankfurt-bucket/backups/

但 AWS 返回了400 Bad Request以下内容<Message>

您提供的授权机制不受支持。请使用 AWS4-HMAC-SHA256。

完整回溯:

Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1553, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1547, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1382, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1126, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "/usr/lib/python2.7/dist-packages/duplicity/commandline.py", line 1015, 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/lib/python2.7/dist-packages/boto/s3/connection.py", line 625, 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>3F4...7DF7</RequestId><HostId>9nXs0JD...UeaU2WyRiw=</HostId></Error>

使用的版本:Duplicity 0.7.11,boto 2.44.0

答案1

我已经通过直接指定 S3 主机名来修复这个问题 - 尽管我不确定具体如何正在修复:)

/usr/bin/duplicity \
    --exclude-if-present do-not-backup \
    --s3-use-new-style \
    --s3-use-ia \
    --sign-key 9CCF...585 \
    --encrypt-key 9CCF...585 \
    --encrypt-key 9D43...725 \
    --use-agent \
    / \
    s3://s3.eu-central-1.amazonaws.com/my-example-frankfurt-bucket/backups/

顺便说一下,AWS 端点列表如下:http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

相关内容