Aws-cli: InvalidRequest: unsupported authorisation mechanism

Created on 8 Feb 2017  路  1Comment  路  Source: aws/aws-cli

In short

I just installed aws-cli in order to sync my local assets to my S3 bucket located in Frankfurt (eu-central-1).

The following command fails because of the authorisation mechanism.

$ aws s3 sync . s3://my.bucket --dryrun
A client error (InvalidRequest) occurred when calling the ListObjects operation: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
Completed 1 part(s) with ... file(s) remaining

Version

aws-cli version is aws-cli/1.4.2 Python/3.4.2 Linux/3.16.0-4-amd64

Full debug log

$ aws s3 sync . s3://my.bucket --dryrun --debug
2017-02-08 14:14:00,993 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.4.2 Python/3.4.2 Linux/3.16.0-4-amd64, botocore version: 0.62.0
2017-02-08 14:14:00,994 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.s3.anonymous: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.size-only: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-disposition: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.anonymous: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.expires: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-encoding: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.follow-symlinks: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.delete: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.quiet: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,996 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-language: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.cache-control: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.acl: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.anonymous: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.exact-timestamps: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.anonymous: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.dryrun: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.source-region: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.website-redirect: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.storage-class: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.grants: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.paths: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-type: calling handler <function uri_param at 0x7f13b8c6b730>
2017-02-08 14:14:00,997 - MainThread - botocore.service - DEBUG - Creating service object for: s3
2017-02-08 14:14:01,017 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.s3: calling handler <function signature_overrides at 0x7f13b937c488>
2017-02-08 14:14:01,017 - MainThread - botocore.hooks - DEBUG - Event service-created: calling handler <function register_retries_for_service at 0x7f13b937c268>
2017-02-08 14:14:01,017 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: Service(s3)
2017-02-08 14:14:01,018 - MainThread - botocore.hooks - DEBUG - Event creating-endpoint.s3: calling handler <function maybe_switch_to_s3sigv4 at 0x7f13b937c378>
2017-02-08 14:14:01,018 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: env
2017-02-08 14:14:01,019 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2017-02-08 14:14:01,019 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: config-file
2017-02-08 14:14:01,019 - MainThread - botocore.credentials - INFO - Credentials found in config file: ~/.aws/config
2017-02-08 14:14:01,020 - MainThread - botocore.service - DEBUG - Creating service object for: s3
2017-02-08 14:14:01,020 - MainThread - botocore.hooks - DEBUG - Event service-data-loaded.s3: calling handler <function signature_overrides at 0x7f13b937c488>
2017-02-08 14:14:01,020 - MainThread - botocore.hooks - DEBUG - Event service-created: calling handler <function register_retries_for_service at 0x7f13b937c268>
2017-02-08 14:14:01,020 - MainThread - botocore.handlers - DEBUG - Registering retry handlers for service: Service(s3)
2017-02-08 14:14:01,020 - MainThread - botocore.hooks - DEBUG - Event creating-endpoint.s3: calling handler <function maybe_switch_to_s3sigv4 at 0x7f13b937c378>
2017-02-08 14:14:01,022 - MainThread - botocore.service - DEBUG - Creating operation objects for: Service(s3)
2017-02-08 14:14:01,026 - MainThread - botocore.operation - DEBUG - Operation:ListObjects called with kwargs: {'encoding_type': 'url', 'prefix': '', 'bucket': 'my.bucket'}
2017-02-08 14:14:01,026 - MainThread - botocore.operation - DEBUG - Creating parameter objects for: Operation:ListObjects
2017-02-08 14:14:01,026 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.ListObjects: calling handler <function add_expect_header at 0x7f13b937c510>
2017-02-08 14:14:01,027 - MainThread - botocore.endpoint - DEBUG - Making request for Operation:ListObjects (verify_ssl=True) with params: {'headers': {}, 'uri_params': {'Bucket': 'my.bucket', 'Prefix': '', 'EncodingType': 'url'}, 'payload': <botocore.payload.XMLPayload object at 0x7f13b87fdf60>}
2017-02-08 14:14:01,027 - MainThread - botocore.endpoint - DEBUG - Building URI for rest endpoint.
2017-02-08 14:14:01,027 - MainThread - botocore.endpoint - DEBUG - Templated URI path: /{Bucket}
2017-02-08 14:14:01,027 - MainThread - botocore.endpoint - DEBUG - Templated URI query_params: delimiter={Delimiter}&marker={Marker}&max-keys={MaxKeys}&prefix={Prefix}&encoding-type={EncodingType}
2017-02-08 14:14:01,027 - MainThread - botocore.endpoint - DEBUG - Rendered path: /my.bucket
2017-02-08 14:14:01,027 - MainThread - botocore.endpoint - DEBUG - Rendered query_params: prefix=&encoding-type=url
2017-02-08 14:14:01,027 - MainThread - botocore.hooks - DEBUG - Event before-auth.s3: calling handler <function fix_s3_host at 0x7f13b937c158>
2017-02-08 14:14:01,027 - MainThread - botocore.handlers - DEBUG - Checking for DNS compatible bucket for: https://s3-eu-central-1.amazonaws.com/my.bucket?prefix=&encoding-type=url
2017-02-08 14:14:01,027 - MainThread - botocore.handlers - DEBUG - Not changing URI, bucket is not DNS compatible: my.bucket
2017-02-08 14:14:01,027 - MainThread - botocore.auth - DEBUG - Calculating signature using hmacv1 auth.
2017-02-08 14:14:01,027 - MainThread - botocore.auth - DEBUG - HTTP request method: GET
2017-02-08 14:14:01,027 - MainThread - botocore.auth - DEBUG - StringToSign:
GET


Wed, 08 Feb 2017 13:14:01 GMT
/my.bucket
2017-02-08 14:14:01,029 - MainThread - botocore.endpoint - DEBUG - Sending http request: <PreparedRequest [GET]>
2017-02-08 14:14:01,153 - MainThread - botocore.response - DEBUG - Response Headers:
Server: AmazonS3
Connection: close
x-amz-region: eu-central-1
Transfer-Encoding: chunked
x-amz-id-2: AAvOrmGY8A4WcN0ptjWQ0lGmBNnh9bHwTFLbwKtUp1mtx9OCY7CcwTARzqN4XdsxTcwK3Ctlyzg=
Date: Wed, 08 Feb 2017 13:14:00 GMT
x-amz-bucket-region: eu-central-1
x-amz-request-id: F6B4BFB94467B918
Content-Type: application/xml
2017-02-08 14:14:01,154 - MainThread - botocore.response - DEBUG - Response Body:
b'<?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>InvalidRequest</Code><Message>The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.</Message><RequestId>F6B4BFB94467B918</RequestId><HostId>AAvOrmGY8A4WcN0ptjWQ0lGmBNnh9bHwTFLbwKtUp1mtx9OCY7CcwTARzqN4XdsxTcwK3Ctlyzg=</HostId></Error>'
2017-02-08 14:14:01,156 - MainThread - botocore.hooks - DEBUG - Event needs-retry.s3.ListObjects: calling handler <botocore.retryhandler.RetryHandler object at 0x7f13b8846f28>
2017-02-08 14:14:01,156 - MainThread - botocore.retryhandler - DEBUG - No retry needed.
2017-02-08 14:14:01,156 - MainThread - botocore.hooks - DEBUG - Event after-call.s3.ListObjects: calling handler <awscli.errorhandler.ErrorHandler object at 0x7f13b8c72c50>
2017-02-08 14:14:01,156 - MainThread - awscli.errorhandler - DEBUG - HTTP Response Code: 400
2017-02-08 14:14:01,157 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Exception caught during task execution: A client error (InvalidRequest) occurred when calling the ListObjects operation: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
Traceback (most recent call last):
  File "/usr/share/awscli/awscli/customizations/s3/s3handler.py", line 76, in call
    total_files, total_parts = self._enqueue_tasks(files)
  File "/usr/share/awscli/awscli/customizations/s3/s3handler.py", line 154, in _enqueue_tasks
    for filename in files:
  File "/usr/share/awscli/awscli/customizations/s3/fileinfobuilder.py", line 31, in call
    for file_base in files:
  File "/usr/share/awscli/awscli/customizations/s3/comparator.py", line 98, in call
    dest_file = advance_iterator(dest_files)
  File "/usr/share/awscli/awscli/customizations/s3/filegenerator.py", line 91, in call
    for src_path, size, last_update in file_list:
  File "/usr/share/awscli/awscli/customizations/s3/filegenerator.py", line 207, in list_objects
    for key in lister.list_objects(bucket=bucket, prefix=prefix):
  File "/usr/share/awscli/awscli/customizations/s3/utils.py", line 342, in list_objects
    for response, page in pages:
  File "/usr/lib/python3/dist-packages/botocore/paginate.py", line 150, in __iter__
    **current_kwargs)
  File "/usr/lib/python3/dist-packages/botocore/operation.py", line 74, in call
    parsed=response[1])
  File "/usr/lib/python3/dist-packages/botocore/session.py", line 654, in emit
    return self._events.emit(event_name, **kwargs)
  File "/usr/lib/python3/dist-packages/botocore/hooks.py", line 148, in emit
    response = handler(**kwargs)
  File "/usr/share/awscli/awscli/errorhandler.py", line 75, in __call__
    http_status_code=http_response.status_code)
awscli.errorhandler.ClientError: A client error (InvalidRequest) occurred when calling the ListObjects operation: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
2017-02-08 14:14:01,160 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,160 - Thread-1 - awscli.customizations.s3.executor - DEBUG - Received print task: {'error': True, 'message': 'A client error (InvalidRequest) occurred when calling the ListObjects operation: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.'}
A client error (InvalidRequest) occurred when calling the ListObjects operation: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
2017-02-08 14:14:01,161 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,161 - Thread-3 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,161 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,161 - Thread-4 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,161 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,161 - Thread-5 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,161 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,162 - Thread-6 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,162 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,162 - Thread-7 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,162 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,162 - Thread-8 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,162 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,162 - Thread-9 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,162 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,163 - Thread-10 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,163 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for worker thread (priority: 1)
2017-02-08 14:14:01,163 - Thread-11 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,163 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-3, stopped daemon 139722659497728)>
2017-02-08 14:14:01,163 - Thread-12 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in worker thread, shutting down worker thread.
2017-02-08 14:14:01,163 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-3, stopped daemon 139722659497728)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-4, stopped daemon 139722651105024)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-4, stopped daemon 139722651105024)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-5, stopped daemon 139722642712320)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-5, stopped daemon 139722642712320)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-6, stopped daemon 139722634319616)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-6, stopped daemon 139722634319616)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-7, stopped daemon 139722625926912)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-7, stopped daemon 139722625926912)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-8, stopped daemon 139722617534208)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-8, stopped daemon 139722617534208)>
2017-02-08 14:14:01,164 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-9, stopped daemon 139722131240704)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-9, stopped daemon 139722131240704)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-10, stopped daemon 139722122848000)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-10, stopped daemon 139722122848000)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-11, stopped daemon 139722114455296)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-11, stopped daemon 139722114455296)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for thread to shutdown: <Worker(Thread-12, stopped daemon 139722106062592)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Thread has been shutdown: <Worker(Thread-12, stopped daemon 139722106062592)>
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for result thread.
2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Queueing end sentinel for IO thread.

2017-02-08 14:14:01,165 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for result thread to shutdown.
2017-02-08 14:14:01,165 - Thread-1 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in print thread, shutting down print thread.
2017-02-08 14:14:01,165 - Thread-2 - awscli.customizations.s3.executor - DEBUG - Shutdown request received in IO thread, shutting down.
2017-02-08 14:14:01,166 - MainThread - awscli.customizations.s3.executor - DEBUG - Waiting for IO thread to shutdown.
2017-02-08 14:14:01,166 - MainThread - awscli.customizations.s3.executor - DEBUG - All threads have been shutdown.

Most helpful comment

Nevermind, I installed aws-cli through apt-get and thought it was up-to-date. I was wrong.
In case someone encounters this issue, make sure you install aws-cli using pip as suggested in the README.rst.

>All comments

Nevermind, I installed aws-cli through apt-get and thought it was up-to-date. I was wrong.
In case someone encounters this issue, make sure you install aws-cli using pip as suggested in the README.rst.

Was this page helpful?
0 / 5 - 0 ratings