dynamodb-replicator icon indicating copy to clipboard operation
dynamodb-replicator copied to clipboard

Fix Authentication Mechanism error in eu-central-1

Open pietbrauer opened this issue 9 years ago • 1 comments

There was an authentication error when trying to run a backup using the eu-central-1 region. According to Stackoverflow the default mechanism (v2) was never available in eu-central-1. Setting the authentication mechanism fixed the issue for me.

Stacktrace

[Thu, 01 Dec 2016 12:28:02 GMT] [info] [backup-table] [ccca75f87cc5e117] [segment 0] Starting backup job ccca75f87cc5e117 of eu-central-1/my-table-backup
[Thu, 01 Dec 2016 12:28:02 GMT] [info] [backup-table] [ccca75f87cc5e117] [segment 0] Uploaded 888 bytes
[Thu, 01 Dec 2016 12:28:03 GMT] [info] [backup-table] [ccca75f87cc5e117] [segment 0] Uploaded 888 bytes
[Thu, 01 Dec 2016 12:28:03 GMT] [error] [backup-table] [ccca75f87cc5e117] InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
    at Request.extractError (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/services/s3.js:538:35)
    at Request.callListeners (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/request.js:668:14)
    at Request.transition (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/request.js:670:12)
    at Request.callListeners (/usr/local/lib/node_modules/dynamodb-replicator/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
    message: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
    code: InvalidRequest
    region: eu-central-1
    requestId: something
    extendedRequestId: somethingelse
    statusCode: 400
    retryDelay: 19.34938095510006

pietbrauer avatar Dec 01 '16 12:12 pietbrauer

As I use eu-central-1, but didn't notice this problem, I looked into aws-sdk-js and apparently that shouldn't be an issue anymore since aws-sdk-js 2.68.0:

feature: S3: Switches S3 to use signatureVersion "v4" by default. To continue using signatureVersion "v2", set the signatureVersion: "v2" option in the S3 service client configuration. Presigned URLs will continue using "v2" by default.

https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md#2680

Dunedan avatar Jul 04 '17 12:07 Dunedan