amazon-ecr-credential-helper icon indicating copy to clipboard operation
amazon-ecr-credential-helper copied to clipboard

AWS Credential Helper error : NoCredentialProviders with IAM role

Open bklau opened this issue 7 years ago • 2 comments

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?

bklau avatar Sep 15 '17 02:09 bklau

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.

digitalfiz avatar Mar 02 '18 19:03 digitalfiz

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

Constantin07 avatar Feb 22 '21 17:02 Constantin07