Could not load credentials from SharedIniFileCredentials
version: [email protected], reproduced once with latest or close to latest 2.392.0 platform: docker(regardless os)
Issue: I've assume role to connect to a dynamodb. I have setup it up and the awscli works, but cannot get the nodejs application to work. I have read the differences between cli and sdk and frankly tried all of the solutions or workarounds in the threads, but still cannot get my head around the error below.
Error:
Unable to create table. Error JSON: {
"message": "Missing credentials in config",
"code": "CredentialsError",
"time": "2019-01-24T14:31:13.924Z",
"requestId": "REMOVED",
"statusCode": 404,
"retryable": false,
"retryDelay": 65.28812722576298,
"originalError": {
"message": "Could not load credentials from SharedIniFileCredentials",
"code": "CredentialsError",
"time": "2019-01-24T14:31:13.924Z",
"requestId": "REMOVED",
"statusCode": 404,
"retryable": false,
"retryDelay": 65.28812722576298
}
}
The setup:
export AWS_PROFILE=my_profile
export AWS_SDK_LOAD_CONFIG=1
tried also with AWS_SHARED_CREDENTIALS_FILE=$HOME/.aws/credentials, but the same error.
.aws/config
[profile my_profile]
region = us-west-2
output = json
role_arn = arn:aws:iam::my_profile:role/Operator
source_profile = master_profile
.aws/credentials
[master_profile]
aws_access_key_id = DEDACTED
aws_secret_access_key = DEDACTED
SharedIniFileCredentials {
expired: false,
expireTime: null,
accessKeyId: undefined,
sessionToken: undefined,
filename: undefined,
profile: 'my_profile',
disableAssumeRole: false,
preferStaticCredentials: false,
roleArn: 'arn:aws:iam::my_profile:role/Operator' }
and the cred part of the code:
var cred = AWS.config.credentials = new AWS.SharedIniFileCredentials( {
expired: false,
disableAssumeRole: false })
Any help appreciated. Thanks.
@mblag
How are you setting up the DynamoDB client?
thanks for the reply, the issue turned out to be pre-deployed older version of aws-sdk along the docker image that somehow messed up the setup. making sure the modules are the current version solves the issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.