awslabs / amazon-ecr-credential-helper

Automatically gets credentials for Amazon ECR on docker push/docker pull
Apache License 2.0
2.49k stars 337 forks source link

AWS Credential Helper error : NoCredentialProviders with IAM role #65

Open bklau opened 7 years ago

bklau commented 7 years ago

I have an app inside a Docker container that calls AWS Credential Helper configured inside the SAME container. The EC2 instance that hosted the app Docker container have an IAM role that allows it to pull Docker images. I did not have any other AWS-related credential files configured inside the app container. But for some reason, when AWS Credential Helper is called internally inside the app container, I got the following error message:

2017-09-14T21:51:53Z [DEBUG] Could not fetch credentials for cache prefix: NoCredentialProviders: no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors 2017-09-14T21:51:53Z [DEBUG] Disabling cache 2017-09-14T21:51:53Z [DEBUG] Retrieving credentials for....

Q: Any reason why is this happening?

digitalfiz commented 6 years ago

Last bulletpoint on the readme where it talks about credentials:

If you are working with an assumed role please set the environment variable: AWS_SDK_LOAD_CONFIG=true also.

Constantin07 commented 3 years ago

I had to issue AWS_SDK_LOAD_CONFIG=false docker pull .... to make it work.