Aws-toolkit-jetbrains: Failed to load AWS profiles

Created on 18 Dec 2019  路  5Comments  路  Source: aws/aws-toolkit-jetbrains

Describe the bug
After I setup the the AWS credential file according to
https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/setup-credentials.html

I get the error:

AWS Credentials
Failed to load AWS profiles: Expected a profile or property definition on line 1
Edit AWS Credential file(s)

The content if the file looks like this (masked):

[default]
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

At the same time

C:>aws s3 ls

for instance, is working fine with the same credentials.

To reproduce

  1. Edit AWS credential file

Expected behavior
Use the given credentials to connect to AWS

Screenshots

Your Environment

  • OS: Windows 10
  • JetBrains' Product: IntelliJ Ultimate
  • JetBrains' Product Version:
  • Toolkit Version: 1.9-193
  • SAM CLI Version: SAM CLI, version 0.34.0
  • JVM/Python Version: OpenJDK 1.8
bug

Most helpful comment

Just to comment for visibility: I had the same error message.

After debugging for a while I found the error to be caused by indentation in my config file, which never caused problems with the CLI

[profile ..]
    role_arn = ..
    source_profile = default

So if you end up having the same issue make sure to remove all spaces and indentations in your config and credentials file

All 5 comments

Edit AWS credential file

How did you edit the file (what editor)? Could you attach the file (after replacing the keys) here?

Hi @justinmk3 ,

Thank you for your answer.
I use the IntelliJ editor via the "Edit AWS credential file(s)" from the plugin.
I attache an -for me- non working example. It's ASCII - LF.
The configured account has worked before.

credentials.zip

@larsschaps That file looks ok. Do you have a ~/.aws/config file?

  • Does the problem happen if you restart the IDE?
  • If you _delete_ the file ~/.aws/credentials, does the problem persist?

    • I am wondering if other credentials files are being discovered in locations other than ~/.aws/credentials.

"Edit AWS credential file" is not enough to reproduce the issue on my end, so we need to find the full steps that reproduce the issue.

Hi @justinmk3,
yes, I do. And thank you I found the error.
There was a space on the first line before the '#'
brgs
Lars

Just to comment for visibility: I had the same error message.

After debugging for a while I found the error to be caused by indentation in my config file, which never caused problems with the CLI

[profile ..]
    role_arn = ..
    source_profile = default

So if you end up having the same issue make sure to remove all spaces and indentations in your config and credentials file

Was this page helpful?
0 / 5 - 0 ratings