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

Another ERROR: Aws::Errors::MissingCredentialsError: unable to sign request without credentials set #632

Closed
breisig opened this issue Jan 8, 2020 · 0 comments · Fixed by #634
Assignees
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@breisig
Copy link

breisig commented Jan 8, 2020

Version:

Knife Version: Chef Infra Client: 15.6.10
knife-ec2 (1.0.26)
CentOS-8

Scenario:

I am still having issues when trying to create a simple server with with the knife-ec2. This was supposed to be fixed in issue #617 but it still hasn't been fixed. We have multiple AWS accounts so we use the aws-profile to switch between accounts. The weird part is that I can view all my servers but when trying to create a server, it says it can't find the credentials.

If I query to show all my servers, it runs without issue.

knife ec2 server list --aws-profile mycompany
knife ec2 server list --aws-profile mycompany2

But when I try to create a server, the following error message shows

knife ec2 server create 10.50.14.140 -N server1.mycompany.com --image ami-gafdcera4a5444842 -f m5.large --region ca-central-1 --ssh-key myssh-awskey --subnet subnet-d528fac2 -g sg-8144b258 -E production -r 'recipe[baseinstall]' --ebs-size 100 -A --server-connect-attribute private_ip_address --private-ip-address 10.50.14.140 --json-attributes='{"tags": ["app:myapp"]}' --node-ssl-verify-mode none --ssh-verify-host-key never -U root --aws-profile mycompany

ERROR: Aws::Errors::MissingCredentialsError: unable to sign request without credentials set

It's like the EC2 server creation is not seeing the AWS profile credentials.

Expected Result:

I should be able to just bootstrap without any issues.

Actual Result:

Getting an error ERROR: Aws::Errors::MissingCredentialsError: unable to sign request without credentials set

Steps to Reproduce:

cat ~/.chef/config.rb

knife[:aws_credential_file] = File.join(ENV['HOME'], "/.aws/credentials")
knife[:aws_config_file] = File.join(ENV['HOME'], "/.aws/config")

cat ~/.aws/credentials

[mycompany]
aws_access_key_id = 12345
aws_secret_access_key = 67890

[profile  mycompany]
aws_access_key_id = 12345
aws_secret_access_key = 67890

[mycompany2]
aws_access_key_id = 52341
aws_secret_access_key = 27891

[profile  mycompany]
aws_access_key_id = 52341
aws_secret_access_key = 27891

cat ~/.aws/config

[mycompany]
region = ca-central-1

[profile mycompany]
region = ca-central-1

[mycompany2]
region = ca-central-1

[profile mycompany2]
region = ca-central-1

It seems the only temporary 'workaround' is to hard code the credentials in the knife configuration file. This doesn't work well when juggling a few AWS accounts.

cat ~/.chef/config.rb
knife[:aws_access_key_id] = "12345"
knife[:aws_secret_access_key] = "67890"
@breisig breisig added the Status: Untriaged An issue that has yet to be triaged. label Jan 8, 2020
@kapilchouhan99 kapilchouhan99 self-assigned this Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants