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

AWS prepare without credentials present fails due to no EC2 IMDS role found #297

Open
mkolesnik opened this issue Jun 8, 2022 · 6 comments
Labels
backport Mark an issue/pull request for backporting bug Something isn't working confirmed priority:medium

Comments

@mkolesnik
Copy link
Contributor

mkolesnik commented Jun 8, 2022

What happened:
Running cloud prepare for AWS via subctl, when no ~/.aws/credentials file is found, fails with:

 ✓ Preparing AWS cloud for Submariner deployment
 ✓ Obtained infra ID "mkolesni-subm-deb2-42pgb" and region "us-east-1" from OCP metadata file "mkolesni-subm-deb2/metadata.json"
 ✓ Initializing AWS connectivity
 ✗ Retrieving VPC ID 
 ✗ Unable to retrieve the VPC ID: error describing AWS VPCs: operation error EC2: DescribeVpcs, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded
 ✗ Failed to prepare AWS cloud: unable to retrieve the VPC ID: error describing AWS VPCs: operation error EC2: DescribeVpcs, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded

subctl version: devel

What you expected to happen:
It should present a clear error message
On 0.11.2 it used to present this message:

 ✗ Retrieving AWS credentials from your AWS configuration
 ✗ failed to read AWS credentials from /root/.aws/credentials: open /root/.aws/credentials: no such file or directory

How to reproduce it (as minimally and precisely as possible):
Install openshift on AWS using openshift-installer: ./openshift-install create cluster
Run cloud prepare: subctl cloud prepare aws

Anything else we need to know?:

Environment:

  • Diagnose information (use subctl diagnose all):
  • Gather information (use subctl gather):
  • Cloud provider or hardware configuration: AWS
  • Install tools: openshift-install 4.10.16
  • Others: Happens on devel and on 0.12.1
@mkolesnik mkolesnik added bug Something isn't working priority:high backport Mark an issue/pull request for backporting priority:low and removed priority:high labels Jun 8, 2022
@mkolesnik mkolesnik changed the title AWS prepare fails due to no EC2 IMDS role found AWS prepare without credentials present fails due to no EC2 IMDS role found Jun 8, 2022
@skitt
Copy link
Member

skitt commented Jun 8, 2022

This is caused by submariner-io/submariner-operator#1783 which delegates the configuration handling to the AWS SDK.

@stale
Copy link

stale bot commented Oct 14, 2022

This issue has been automatically marked as stale because it has not had activity for 60 days. It will be closed if no further activity occurs. Please make a comment if this issue/pr is still valid. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 14, 2022
@dfarrell07 dfarrell07 removed the wontfix This will not be worked on label Oct 18, 2022
@sp98
Copy link

sp98 commented Nov 9, 2022

faced the same issue while trying with aws today.

subctl cloud prepare aws --ocp-metadata sapillai-c/metadata.json
 ✓ Preparing AWS cloud for Submariner deployment
 ✓ Obtained infra ID "sapillai-c-tq6pd" and region "us-east-1" from OCP metadata file "sapillai-c/metadata.json"
 ✓ Initializing AWS connectivity
 ✗ Retrieving VPC ID
 ✗ Unable to retrieve the VPC ID: error describing AWS VPCs: operation error EC2: DescribeVpcs, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded
 ✗ Failed to prepare AWS cloud: unable to retrieve the VPC ID: error describing AWS VPCs: operation error EC2: DescribeVpcs, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled, context deadline exceeded

subctl version: v0.14.0-rc2

It worked after using the correct profile(using the --profile tag) from the ~/.aws/credentials file. In my case it was

subctl cloud prepare aws --ocp-metadata sapillai-c/metadata.json --profile openshift-dev

@stale
Copy link

stale bot commented Mar 18, 2023

This issue has been automatically marked as stale because it has not had activity for 60 days. It will be closed if no further activity occurs. Please make a comment if this issue/pr is still valid. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 18, 2023
@dfarrell07
Copy link
Member

Seems like this would still be an issue. Not a big failure likely, just bad UX around the message. Still, it seems users are hitting it.

@dfarrell07 dfarrell07 added priority:medium and removed priority:low wontfix This will not be worked on labels Mar 21, 2023
@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had activity for 60 days. It will be closed if no further activity occurs. Please make a comment if this issue/pr is still valid. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 12, 2023
@stale stale bot removed the wontfix This will not be worked on label Sep 19, 2023
@maayanf24 maayanf24 added this to Backlog Jul 2, 2024
@maayanf24 maayanf24 moved this to Backlog in Backlog Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Mark an issue/pull request for backporting bug Something isn't working confirmed priority:medium
Projects
Status: Backlog
Development

No branches or pull requests

4 participants