2

When trying to run this on terminal,

eksctl create cluster \
--name dev \
--version 1.14 \
--region us-west-2 \
--nodegroup-name demo \
--node-type t3.medium \
--nodes 3 \
--nodes-min 1 \
--nodes-max 4 \
--ssh-access \
--ssh-public-key my-public-key.pub \
--managed

Getting this error:

panic: SharedConfigLoadError: failed to load config file, /home/thira/.aws/credentials caused by: INIParseError: invalid state with ASTKind {completed_stmt {0 NONE 0 []} false [{section_stmt {1 STRING 0 [78 111 110 101]} true []}]} and TokenType op

Thira
  • 81
  • 1
  • 9
  • It looks quite similar to the error reported [here](https://github.com/aws/aws-sdk-go/issues/2239). What is your `aws-sdk` version ? – mario Feb 12 '20 at 11:45
  • @mario : how to check that? – Thira Feb 17 '20 at 09:11
  • Does `--version` flag added to `eksctl` or any other `aws-cli` related command show the version ? Is there anything else in the error message you get ? The one you posted looks like it has been truncated and doesn't cantain full information. – mario Feb 17 '20 at 14:22
  • For me this error came up in Windows when I was trying to use saml2aws, because I needed to delete my old "credentials" file. – influent May 07 '20 at 22:54

1 Answers1

0

I have met similar problem, I am using powershell as a cicd agent. I need to use s3 backend as a terraform state store. So I just echo aws access id and secret in to ~/.aws/credentials, but this error happened. Then I found the root cause is windows file format, we need to transfer the file to linux file format. I lookuped how to transfer windows file to linux file in powershell on internet, so the finall solution for my problem is :

[string]::Join( "`n", (gc ~/.aws/cred)) | sc ~/.aws/credentials

Below is my whole codes:

if (Test-Path ~/.aws) {
  Remove-Item ~/.aws -Recurse -Force -EA SilentlyContinue
}
mkdir ~/.aws
echo "[services]" > ~/.aws/cred
echo "aws_access_key_id = ${bamboo.S3_BACK_ACCESS}" >> ~/.aws/cred
echo "aws_secret_access_key = ${bamboo.S3_BACK_SECRET}" >> ~/.aws/cred
[string]::Join( "`n", (gc  ~/.aws/cred)) | sc  ~/.aws/credentials
cat ~/.aws/credentials

About how to convert window file to linux file in PowerShell, I referred the link: UNIX format files with Powershell

Hope it can help others!

kain
  • 214
  • 2
  • 4