edasque / DynamoDBtoCSV

Dump DynamoDB data into a CSV file
Apache License 2.0
471 stars 152 forks source link

UnrecognizedClientException: The security token included in the request is invalid. #36

Open semionenko opened 6 years ago

semionenko commented 6 years ago

I use your application as in the description, but I see the error: { UnrecognizedClientException: The security token included in the request is invalid. at Request.extractError (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/protocol/json.js:48:27) at Request.callListeners (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/sequential_executor.js:105:20) at Request.emit (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/sequential_executor.js:77:10) at Request.emit (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/request.js:683:14) at Request.transition (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/state_machine.js:14:12) at /Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request. (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/request.js:38:9) at Request. (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/request.js:685:12) at Request.callListeners (/Users//Documents/DynamoDBtoCSV/node_modules/aws-sdk/lib/sequential_executor.js:115:18) message: 'The security token included in the request is invalid.', code: 'UnrecognizedClientException', time: 2018-04-20T04:38:47.883Z, requestId: '6M8VSR0LJ87E9VFCRT8FTHAQ0FVV4KQNSO5AEMVJF66Q9ASUAAJG', statusCode: 400, retryable: false, retryDelay: 15.516383183565807 }

Could you explain why it happens? The configuration file contains the same settings as my mobile application.

MrZMN commented 6 years ago

I think it's the problem about your 'region'. You may find your right region of your relevant service in this website: http://docs.amazonaws.cn/en_us/general/latest/gr/rande.html#cnnorth_region

Aditya27 commented 6 years ago

Try specifying the region explicitly node dynamoDBtoCSV.js -t 'tableName' --region 'us-west-2' > output.csv

EavesofIT commented 4 years ago

In case anyone is trying this with STS, you'll need to include the sessionToken provided by STS. You can update your config.json with the "sessionToken": "REPLACEWITIHSESSIONTOKEN" value.

{
    "accessKeyId": "REPLACE",
    "secretAccessKey": "REPLACE",
    "sessionToken": "REPLACEWITIHSESSIONTOKEN",
    "region": "REPLACE"
}