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

Terraform fails to init itself if cli_pager= has set no pager in .aws/config #3756

Open
dimisjim opened this issue Jan 27, 2021 · 12 comments
Open
Assignees
Labels
3rd-party bug This issue is a bug. p3 This is a minor priority issue

Comments

@dimisjim
Copy link

Basically explained here: hashicorp/terraform-provider-aws#14450

@dimisjim dimisjim added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 27, 2021
@KaibaLopez
Copy link
Contributor

Hi @dimisjim ,
This problem was addressed on this PR , so as of version 1.35 of the Go SDK you shouldn't be seeing this problem.
It might just be an issue of terraform not having updated its dependencies.

@KaibaLopez KaibaLopez added 3rd-party closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. labels Jan 27, 2021
@KaibaLopez KaibaLopez self-assigned this Jan 27, 2021
@dimisjim
Copy link
Author

dimisjim commented Jan 28, 2021

@KaibaLopez I am using terraform-provider-aws v3.22 which from here it seems it's using 1.36.x of the go sdk, but I am still getting this:

Error: error configuring S3 Backend: Error creating AWS session: SharedConfigLoadError: failed to load config file, /home/jim/.aws/config
caused by: INIParseError: invalid state with ASTKind { {4 NONE 0 [61]} true [{expr {1 STRING 0 [99 108 105 95 112 97 103 101 114]} true []}]} and TokenType none

issue also persists with latest terraform-provider-aws v3.25

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jan 29, 2021
@KaibaLopez
Copy link
Contributor

@dimisjim ,
Can you show me your config file? (remove private info if there's any)
I just want to make sure I am trying the correct things to reproduce the error.

@dimisjim
Copy link
Author

@KaibaLopez sure here you go:

[default]
cli_pager=

@KaibaLopez
Copy link
Contributor

right, so I tried that and it works just fine with the SDK (assuming of course you have a [default] profile in your credentials on the .aws/credentials file).
Is that your full config file?

@dimisjim
Copy link
Author

dimisjim commented Feb 4, 2021

@KaibaLopez

Apparently this issue manifests only when there is no newline at the end of the config file.

So this does not work:

[default]
cli_pager=

but this does work fine:

[default]
cli_pager=

@KaibaLopez
Copy link
Contributor

ahhh that would actually make sense with how I tested... I think it's only if

[default]
cli_pager=

is the last line that causes the fail, the sdk may be looking for a end of line indicator for it to know that cli_pager is empty, in my test I had other profiles after the one I tested so cli_pager= was not the last line.
But yea will take a look at that thanks!

@thezephyrus
Copy link

I faced the same issue while executing terraform commands.
My aws-config file had credentials with some profiles set for using AWS CLI.
I commented all the lines in the credentials file and was able to run the terraform commands.

@github-actions
Copy link

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 15, 2022
@dimisjim
Copy link
Author

bump

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Feb 16, 2022
@Anups155
Copy link

I faced the same issue while executing terraform commands. My aws-config file had credentials with some profiles set for using AWS CLI. I commented all the lines in the credentials file and was able to run the terraform commands.

@Anups155
Copy link

Thanks .. it worked!

@RanVaknin RanVaknin added the p3 This is a minor priority issue label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd-party bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

5 participants