I've rolled out aws-vault to all our team and after upgrading to 4.1.0 one of them got the following error:
Error adding profile: &errors.errorString{s:"No iniFile to add to"}
Which presumably comes from the fact he has neither .aws/config or .aws/credentials. I got him to manually create there files (just empty text files) and that got past the problem. It seems like aws-vault doesn't handle these files not being there? But if we are to use aws-vault exclusively instead of aws configure then they probably won't be there.
Also, it is possible this is only a problem due to upgrading. And a fresh install wouldn't have a problem.
Yup, that sounds like a 4.1.0 bug. We introduced some code that adds profiles to ~/.aws/config when you add credentials. Apologies!
@lox speaking of that new feature, i tried to add a new profile that didnt still exist in .aws/config (several others there already) and the config file was not changed to include the new one.
what is the expected behaviour?
Was that with 4.1.0 @FernandoMiguel?
@lox i just realized it was 4.0 while discussing #132
i'll retest soon on 4.1
I ran into this with 4.1. Just running touch ~/.aws/config was all it needed, but it's definitely still there.
Yeah, it was introduced in 4.1.0. In the meantime I recommend everyone touch like @snikch.
You probably shouldn't recommend anyone touch like me @lox
anyone tested 4.2 on windows to see if this ini issue is fixed?
still having issues with latest version on windows
PS C:\Users\user> aws-vault-windows-386.exe --debug exec account-role --
2018/01/12 10:15:48 [keyring] Considering backends: [file]
2018/01/12 10:15:48 Loading config file C:\Users\user\.aws\config
2018/01/12 10:15:48 Parsing config file C:\Users\user\.aws\config
2018/01/12 10:15:48 Looking for sessions for account-role
2018/01/12 10:15:48 Looking up all keys in keyring
2018/01/12 10:15:48 [keyring] Expanded file dir to C:\Users\user/.awsvault/keys/
2018/01/12 10:15:48 Session "account-role session (123456789)" expires in 3h43m53.6722034s
2018/01/12 10:15:48 [keyring] Expanded file dir to C:\Users\user/.awsvault/keys/
2018/01/12 10:15:48 [keyring] Expanded file dir to C:\Users\user/.awsvault/keys/
Enter passphrase to unlock C:\Users\user/.awsvault/keys/:
2018/01/12 10:15:52 Using session ****************XPTO, expires in 3h43m49.0085936s
2018/01/12 10:15:52 Using region "eu-west-1" from profile
2018/01/12 10:15:52 Assuming role arn:aws:iam::123456789:role/account-role from session token
2018/01/12 10:15:53 Using role ****************XPTO (from session token), expires in 14m59.5423921s
2018/01/12 10:15:53 Setting subprocess env: AWS_DEFAULT_REGION=eu-west-1, AWS_REGION=eu-west-1
2018/01/12 10:15:53 Setting subprocess env: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
2018/01/12 10:15:53 Setting subprocess env: AWS_SESSION_TOKEN, AWS_SECURITY_TOKEN
aws-vault: error: exec: "": executable file not found in %PATH%
tried to compile master from source, run in docker and saw similar issues.
wonder if something in Go compiler is broken
This just happened to me on 4.2.0 on ubuntu 17.10
$ aws-vault add foo
Enter Access Key ID: a
Enter Secret Access Key: b
Added credentials to profile "foo" in vault
aws-vault: error: Error adding profile: &errors.errorString{s:"No iniFile to add to"}
$ mkdir ~/.aws
$ touch ~/.aws/config
$ aws-vault add foo
Enter Access Key ID: a
Enter Secret Access Key: b
Added credentials to profile "foo" in vault
Yup, open bug is still open unfortunately!
Im also stuck here...
$ aws-vault add foo
Enter Access Key ID: a
Enter Secret Access Key: b
Added credentials to profile "foo" in vault
$ aws-vault list
aws-vault: error: The collection "aws-vault" does not exist. Please add a key first
Sounds like https://github.com/99designs/aws-vault/issues/213 @myoung34.
Ill move further questions there, it definitely is related.
Not related I don't believe @myoung34.
Could you repost with --debug enabled?
$ rm -rf ~/.aws
$ aws-vault add foo --debug
2018/01/21 22:52:57 [keyring] Considering backends: [secret-service]
2018/01/21 22:52:57 Loading config file /home/marc/.aws/config
2018/01/21 22:52:57 Config file /home/marc/.aws/config doesn't exist
Enter Access Key ID: a
Enter Secret Access Key: b
Added credentials to profile "foo" in vault
2018/01/21 22:53:01 Looking for sessions for foo
2018/01/21 22:53:01 Looking up all keys in keyring
2018/01/21 22:53:01 Adding profile foo to config at /home/marc/.aws/config
aws-vault: error: Error adding profile: &errors.errorString{s:"No iniFile to add to"}
$ mkdir ~/.aws; touch ~/.aws/config
$ aws-vault add foo --debug
2018/01/21 22:53:15 [keyring] Considering backends: [secret-service]
2018/01/21 22:53:15 Loading config file /home/marc/.aws/config
2018/01/21 22:53:15 Parsing config file /home/marc/.aws/config
Enter Access Key ID: a
Enter Secret Access Key: b
Added credentials to profile "foo" in vault
2018/01/21 22:53:18 Looking for sessions for foo
2018/01/21 22:53:18 Looking up all keys in keyring
2018/01/21 22:53:18 Adding profile foo to config at /home/marc/.aws/config
$ cat ~/.aws/config
[profile foo]
$ aws-vault list --debug
2018/01/21 22:55:48 [keyring] Considering backends: [secret-service]
2018/01/21 22:55:48 Loading config file /home/marc/.aws/config
2018/01/21 22:55:48 Parsing config file /home/marc/.aws/config
aws-vault: error: The collection "aws-vault" does not exist. Please add a key first
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I ran into this with 4.1. Just running
touch ~/.aws/configwas all it needed, but it's definitely still there.