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

Credentials profile is invalid while trying to Connect to AWS #720

Closed
hilalhmuhammed opened this issue Aug 2, 2019 · 12 comments
Closed

Comments

@hilalhmuhammed
Copy link

Describe the bug
Installed AWS toolkit for VS Code, I have my config and credentials file with the following key and their values
config

[default]
region = us-west-2

credentials

[default]
AWS_ACCESS_KEY_ID=<key>
AWS_SECRET_ACCESS_KEY=<secret>
AWS_SESSION_TOKEN=<token>

Clicking on Connect to AWS using default profile will pop an error dialogue that says Credential profile default is invalid
To Reproduce

Expected behavior
Connection successful to AWS

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise, Build 1803 (x64)
  • Visual Studio Code Version: 1.36.1
  • AWS Toolkit for Visual Studio Code Version: 1.0.0

Additional context
Have tried using a named profile instead of default, the error persist

@awschristou
Copy link
Contributor

Hi @hilalhmuhammed thank you for reaching out. Can you please try setting the keys in your credentials file to lowercase, then restart VS Code, and let us know if you have the same result?

[default]
aws_access_key_id=<key>
aws_secret_access_key=<secret>
aws_session_token=<token>

@jmery
Copy link

jmery commented Aug 8, 2019

@awschristou Trying this toolkit for the first time and am having the same error. Both my config and credentials files are lowercase:

config

[profile personal]
region = us-west-2

[profile sa]
region = us-west-2

credentials

[personal]
aws_access_key_id = <key>
aws_secret_access_key = <secret>

[sa]
aws_access_key_id = <key>
aws_secret_access_key = <secret>
aws_session_token = <token>

@jmery
Copy link

jmery commented Aug 8, 2019

@awschristou Figures ... seconds after posting, VS Code updated to 1.37.0. It appears that there was something cached between VS Code restarts which was resolved when it updated. Issue #705 seems to support this.

@awschristou
Copy link
Contributor

Thank you for the confirmation @jmery

I will close this issue, as the work will be tracked in these separate issues.

@eugenevd
Copy link

eugenevd commented Nov 18, 2020

For what it's worth, I've just had the same error as the OP

$ code --version
1.51.1
e5a624b788d92b8d34d1392e4c4d9789406efe8f
x64
$ aws --version
aws-cli/1.18.180 Python/3.6.9 Linux/5.4.0-53-generic botocore/1.19.20

AWS Toolkit 1.15.0

What solved the problem for me was to change the profile entries in ~/.aws/config from
[profileX]
to
[profile profileX]

@VINAYREDDY26
Copy link

Screen Shot 2021-10-21 at 10 37 07 PM

I am not sure about command error. Can you guys help me out.

@Tsdjimmy
Copy link

Screen Shot 2021-10-21 at 10 37 07 PM

I am not sure about command error. Can you guys help me out.

Do this instead If you have homebrew you can install awscli like this:

brew update
brew install awscli

And then use the following to configure your aws with you access id and token:

aws configure

@KurtWAndrews
Copy link

KurtWAndrews commented Apr 13, 2022

I'm getting the following error which seems to be covered by this thread, but I can't see anything wrong with my aws config or credentials and aws cli is working fine.

  • log file
2022-04-13 15:34:35 [ERROR]: log level: info<br>
2022-04-13 15:34:36 [INFO]: Retrieving AWS endpoint data
2022-04-13 15:34:36 [INFO]: OS:  Darwin x64 20.6.0
2022-04-13 15:34:36 [INFO]: Visual Studio Code Extension Host Version:  1.60.0
2022-04-13 15:34:36 [INFO]: AWS Toolkit Version:  1.37.0
2022-04-13 15:34:40 [ERROR]: login: failed to connect with "profile:default": Profile default could not be found or parsed in shared credentials file.
2022-04-13 15:39:37 [INFO]: telemetry: sent batch (size=9)
2022-04-13 15:39:44 [ERROR]: Profile default is not a valid Credential Profile: Profile default is not supported by the Toolkit.
2022-04-13 15:39:44 [WARN]: Shared Credentials Profile default is not valid. It will not be used by the toolkit.
2022-04-13 15:39:46 [ERROR]: login: failed to connect with "profile:profile default": Profile profile default could not be found or parsed in shared credentials file.
2022-04-13 15:41:30 [ERROR]: login: failed to connect with "profile:default": Profile default could not be found or parsed in shared credentials file.
2022-04-13 15:43:58 [ERROR]: login: failed to connect with "profile:default": Profile default could not be found or parsed in shared credentials file.
2022-04-13 15:44:37 [INFO]: telemetry: sent batch (size=9)
  • .aws/config
[default]
region = us-east-1
output = json
ca_bundle = /Users/cn174265/ZscalerRootCerts/ZscalerRootCertificate-2048-SHA256.crt
  • .aws/credentials
[default]
AWS_ACCESS_KEY_ID=<key>
AWS_SECRET_ACCESS_KEY=<secret>
AWS_SESSION_TOKEN=<session>

@justinmk3
Copy link
Contributor

  • .aws/credentials
[default]
AWS_ACCESS_KEY_ID=<key>
AWS_SECRET_ACCESS_KEY=<secret>
AWS_SESSION_TOKEN=<session>

Try lowercase key names (though this should have been fixed by #2396 ) :

[default]
aws_access_key_id=<key>
aws_secret_access_key=<secret>
aws_session_token=<session>

@KurtWAndrews
Copy link

KurtWAndrews commented Apr 14, 2022 via email

@INValentin
Copy link

INValentin commented Aug 12, 2022

Had the same issue removing spaces made it work!
FROM
[default] aws_access_key_id = <key> ....
TO
[default] aws_access_key_id=<key> ....

@justinmk3
Copy link
Contributor

justinmk3 commented Aug 12, 2022

FROM
[default] aws_access_key_id = <key> ....
TO
[default] aws_access_key_id=<key> ....

@INValentin I can't reproduce this issue, I tried:

[test-spaces]
aws_access_key_id = ...
aws_secret_access_key = ...

and was able to connect using the test-spaces profile in AWS Toolkit for VSCode, version 1.47.

What version of AWS Toolkit for VSCode are you using? Does the issue occur with AWS Toolkit if you add spaces again?

Note that [default] must be on its own line, like this:

[default]
aws_access_key_id = <key>

JadenSimon pushed a commit that referenced this issue Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants