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

intermittent "No valid credential sources found for AWS Provider" error #590

Closed
hashibot opened this issue Jun 13, 2017 · 9 comments
Closed
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS.

Comments

@hashibot
Copy link

This issue was originally opened by @FlorinAndrei as hashicorp/terraform#12508. It was migrated here as part of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.8.8

Affected Resource(s)

everything

Terraform Configuration Files

I'll provide these if necessary.

Actual Behavior

https://gist.github.com/FlorinAndrei/aa4cb6a677da1f8b0ffa92b10e5d06c8

Important Factoids

Happens intermittently. The number of errors occurred varies from one run to the next. Typically about half a dozen. Once in a blue moon there are no errors and the plan command actually works.

@rfletcher
Copy link
Contributor

As our Terraform graph has grown I've been seeing this more and more. It's still present in Terraform 0.10.7 with AWS provider 0.1.4.

Adding -parallelism=4 does seem to help, as suggested in the old hashicorp/terraform#12508 comments.

@bflad bflad added the provider Pertains to the provider itself, rather than any interaction with AWS. label Jan 29, 2018
@thomasdane
Copy link

Is the number 4 special, or would -parallelism=5 work equally well? We can do some testing on our end.

@FlorinAndrei
Copy link

It's been a while, but from what I remember the number was determined via trial and error, and did not seem to be a hard limit. But YMMV.

@rfletcher
Copy link
Contributor

A few months ago I wondered if the -parallelism option was still necessary and stopped using it. I haven't seen this bug since. It looks like I was using 1.1.0 of the AWS plugin at that point, and I'm on 1.15.0 now.

Just one data point though. Maybe someone else is still seeing it?

@bennettp123
Copy link

bennettp123 commented Mar 27, 2019

I'm still seeing this issue, though my version of the AWS plugin (1.36) is getting pretty ancient.

As posted elsewhere, -parallelism=4 did the trick!

Edit: the project in question has about 30 modules, and each module has one submodule, and each submodule has two providers. It's an odd setup, and not one that I use often!

@ulrichsg
Copy link

ulrichsg commented Apr 5, 2019

EDIT: A colleague remembered the solution. Apparently there is an obscure bug with whitespace in .aws/credentials. It started working again after I deleted all sections from the file except the one for our main account and then started a new session.

I have also started seeing this, only it happens every time for me when I run terraform plan, in established setups that used to work for me and still work for my colleagues.

I am using ~/.aws/credentials, which I checked contains valid credentials (the AWS CLI client works fine for me) and also seems to be found correctly by Terraform, as I get a different message when I run it while the stored session token is expired.

Unlike for others, adding -parallelism=4 changed nothing. Having tried multiple Terraform versions (0.11.7, 0.11.13) and several different provider versions, I am at my wit's end.

@eporomaa
Copy link

Getting: Error: No valid credential sources found for AWS Provider. when using ~/.aws/credentials or setting env variables. Workaround is setting:
provider "aws" { version = "2.20.0" secret_key = "XXX" access_key = "XXX" region = var.region } in the .tffile.

Running terraform --version Terraform v0.12.5

I tried running with TF_LOG=trace but I can't see how it tries to access the credentials.
Curious about any updates on this.

@bflad
Copy link
Contributor

bflad commented Jul 7, 2020

Hi folks 👋 It looks like the original bug report no longer has the information to make troubleshooting it possible for the maintainers, so given that I'm going to close this. There have been a lot of changes in the Terraform CLI and Terraform AWS Provider regarding authentication handling since this was originally filed, so if you are still having lingering issues on recent versions (Terraform 0.12.28 and Terraform AWS Provider 2.69.0 are the latest as of this writing), we would suggest filing a new bug report following the issue template and we will take a fresh look. Thanks.

@bflad bflad closed this as completed Jul 7, 2020
@ghost
Copy link

ghost commented Aug 6, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. provider Pertains to the provider itself, rather than any interaction with AWS.
Projects
None yet
Development

No branches or pull requests

8 participants