Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoCredentialProviders: no valid providers in chain. Deprecated. #426

Open
sbenthall opened this issue May 23, 2016 · 19 comments
Labels
UX
Milestone

Comments

@sbenthall
Copy link

@sbenthall sbenthall commented May 23, 2016

Ubuntu 14.04, Apex version 0.9.0

Running apex metrics gets me the following error, looping in the terminal.

NoCredentialProviders: no valid providers in chain. Deprecated. 
    For verbose messaging see aws.Config.CredentialsChainVerboseErrors

I am not a Go developer and so am not sure how to interpret or fix this kind of error. A more informative message would be helpful.

I have my AWS credential in ~/.aws/config

@tj tj added this to the v0.10.0 milestone May 25, 2016
@tj

This comment has been minimized.

Copy link
Member

@tj tj commented May 25, 2016

hmm I haven't seen that one yet, sounds like a dev-error as if we misconfigured something, but it works fine for me. I'll look into it, could just be strange wording on their part.

note that you'll need creds in ~/.aws/credentials, only the region is stored in ~/.aws/config (not sure why AWS likes to have two but that seems to be the convention)

@sbenthall

This comment has been minimized.

Copy link
Author

@sbenthall sbenthall commented May 25, 2016

thanks moving the creds to ~/.aws/credentials fixed the issue for me.

@tj

This comment has been minimized.

Copy link
Member

@tj tj commented May 25, 2016

cool good to hear, I'll make sure to get better error reporting for this in the next release, I had left the AWS errors as-is thinking they would be better (they're fine for some cases) but this is definitely awful haha

@tj tj modified the milestones: v0.10.0, 0.11.0 Jun 19, 2016
@louisremi

This comment has been minimized.

Copy link

@louisremi louisremi commented Jul 21, 2016

I also got this error because of a syntax error in my .envrc file (a space just after AWS_SECRET_KEY=)

@rowanu

This comment has been minimized.

Copy link

@rowanu rowanu commented Sep 30, 2016

Another data point for this error: I'm using an assumed role, so there's (intentionally) no credentials in ~/.aws/credentials file - it all goes in the ~/.aws/config file.

Is this Apex error just caused by an SDK error? I know the SDK support can be a bit spotty...

Update: Just found #524, which describes it better.

@DavidTPate

This comment has been minimized.

Copy link
Collaborator

@DavidTPate DavidTPate commented Sep 30, 2016

Yeah, this is just an SDK error where upon initialization it attempts to determine your credentials (using EC2 role, assumed role, credentials, environment variables, etc.) and when it can't determine them then it throws the error.

@grauwoelfchen

This comment has been minimized.

Copy link

@grauwoelfchen grauwoelfchen commented Mar 30, 2017

Hi, I also got this error in a situation that I had both files ~/.aws/config for region and ~/.aws/credentials for credentials, but didn't have AWS_SDK_LOAD_CONFIG environment variable as truthy, yet.

All of you might already know well about this... so, I would like to just report my situation.
If you have both of these files, you need to also set AWS_SDK_LOAD_CONFIG as truthy such as described at here.

I also think that it would be better aws-sdk-go reports this problem effectively ;)

@davidcpell

This comment has been minimized.

Copy link

@davidcpell davidcpell commented May 4, 2017

Just landed here and @grauwoelfchen's point is what got me moving again. Thanks!

@odg0318

This comment has been minimized.

Copy link

@odg0318 odg0318 commented May 8, 2017

@grauwoelfchen Thanks a lot.

@xuru

This comment has been minimized.

Copy link

@xuru xuru commented May 25, 2017

@grauwoelfchen's suggestion worked for me as well. This should probably be documented somewhere, especially for people coming over from using something like the aws cli.

@VolkerBohne

This comment has been minimized.

Copy link

@VolkerBohne VolkerBohne commented Aug 11, 2017

@grauwoelfchen : thx a lot. helped me to get rid of that error when beginnnig with apex and cross account access. cool.

@Pczek

This comment has been minimized.

Copy link

@Pczek Pczek commented Nov 16, 2017

I still encounter this issue. I followed the instruction on http://apex.run about the credentials and created a credentials and a config file. No additional whitespaces at the end as mentioned. I even set AWS_SDK_LOAD_CONFIG to 1 as described in the readme in the aws-sdk-go project.
Might there be something I need to install additionally?

Update:
I was able to make it work by setting the credentials as environment variables but this is definitely not a practical solution
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_REGION

@cynipe

This comment has been minimized.

Copy link

@cynipe cynipe commented Nov 20, 2017

me too.
0.16.0 does not work as expected.
However, 0.15.0 works fine.

@amantur

This comment has been minimized.

Copy link

@amantur amantur commented Dec 19, 2017

Folks, I got bitten by * provider.aws: NoCredentialProviders: no valid providers in chain. bug while running a terraform script. In the end it turned out to be a typo in configured profile name and what I had set in the configuration file.

@azarboon

This comment has been minimized.

Copy link

@azarboon azarboon commented Mar 6, 2018

@Pczek thank you. only your solution (adding env) worked for me.

@DrHashi

This comment has been minimized.

Copy link

@DrHashi DrHashi commented Jul 5, 2018

I was only able to get it working using environment variables as of aws.provider 1.26

@michele-amati

This comment has been minimized.

Copy link

@michele-amati michele-amati commented Nov 30, 2018

Folks, I got bitten by * provider.aws: NoCredentialProviders: no valid providers in chain. bug while running a terraform script. In the end it turned out to be a typo in configured profile name and what I had set in the configuration file.

  1. look for solutions on the internet
  2. the internet tells me i typed it wrong
  3. check the names for the third time
  4. ...i typed it wrong
  5. thank you internet
@adknownadmin

This comment has been minimized.

Copy link

@adknownadmin adknownadmin commented Jan 24, 2019

Leaving this here in the likely event I don't remember the fix next time I need to install apex on another dev's machine, but I pretty consistently got the NoCredentialProviders: no valid providers in chain. bug whenever someone installed using the provided installer.

If it was installed by:

  1. clone from github so the .git folder is located in go/src/github.com/apex/apex
  2. run go get ./... in go/src/github.com/apex/apex
  3. run go install ./... in go/src/github.com/apex/apex
  4. set the appropriate env var to make the go sdk use the aws configs with export AWS_SDK_LOAD_CONFIG=1

Then it worked fine and properly picked up the config file

The main difference I could see between using the installer and installing using go install was that the binary ended up in /usr/local/bin/ vs go/bin.

This was consistent behavior on Ubuntu versions 17.10 and 18.04

@stephanebruckert

This comment has been minimized.

Copy link

@stephanebruckert stephanebruckert commented Feb 23, 2019

Just the wrong -p profile AWS profile for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.