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

Document the AWS_EC2_METADATA_DISABLED environment variable #5623

Closed
kdaily opened this issue Oct 9, 2020 · 3 comments · Fixed by awsdocs/aws-cli-user-guide#56
Closed

Document the AWS_EC2_METADATA_DISABLED environment variable #5623

kdaily opened this issue Oct 9, 2020 · 3 comments · Fixed by awsdocs/aws-cli-user-guide#56
Labels
configuration documentation This is a problem with documentation.

Comments

@kdaily
Copy link
Member

kdaily commented Oct 9, 2020

Is your feature request related to a problem? Please describe.

If no region is set, the AWS CLI tries to use the IMDS service to determine it. In some cases, like when running the AWS CLI on an Azure instance, another service can be running at the same non-routable IP address used by IMDS. One way to get around this is to explicitly set a region. However, there is an undocumented environment variable that can prevent the request to IMDS:

AWS_EC2_METADATA_DISABLED=true

Related issues:

Describe the solution you'd like

Document the environment variable in the user guide:

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

Describe alternatives you've considered

Setting the region can prevent this behavior, but using the environment variable is more explicit in controlling it.

Additional context

None

@kdaily kdaily added the documentation This is a problem with documentation. label Oct 9, 2020
kdaily added a commit to kdaily/aws-cli-user-guide that referenced this issue Nov 24, 2020
kdaily added a commit to kdaily/aws-cli-user-guide that referenced this issue Nov 24, 2020
kdaily added a commit to kdaily/aws-cli-user-guide that referenced this issue Nov 24, 2020
kdaily added a commit to kdaily/aws-cli-user-guide that referenced this issue Nov 24, 2020
@esamattis
Copy link

esamattis commented Mar 17, 2021

Today our CI deploys in Github Actions started fail on AWS CLI commands (aws sts get-caller-identity, aws s3 sync). They print lines like

<botocore.awsrequest.AWSRequest object at 0x7f83d900af70>

and exit with 255 code. No other error messages.

Setting AWS_EC2_METADATA_DISABLED=true fixed the issue for us. Probably a networking issue with github vs. aws.

Posting this here since googling this brought me here and it might help others too.

@kdaily
Copy link
Member Author

kdaily commented Apr 5, 2021

Hi all, this is now in the documentation of environment variables for the CLI:

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

@kdaily kdaily closed this as completed Apr 5, 2021
@github-actions
Copy link

github-actions bot commented Apr 5, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

pst added a commit to kbst/terraform-kubestack that referenced this issue Apr 17, 2021
The v2 AWS cli throws an exception if run on Azure, e.g.
via Github Actions due to presumeabley due to the metadata
service using the same IP address.

Apparently handling exceptions is too difficult for AWS.

aws/aws-cli#5262
aws/aws-cli#5623
pst added a commit to kbst/terraform-kubestack that referenced this issue Apr 17, 2021
The v2 AWS cli throws an exception if run on Azure, e.g.
via Github Actions due to presumeabley due to the metadata
service using the same IP address.

Apparently handling exceptions is too difficult for AWS.

aws/aws-cli#5262
aws/aws-cli#5623
djbender added a commit to get-bridge/translation-sync that referenced this issue May 5, 2021
djbender added a commit to get-bridge/translation-sync that referenced this issue May 5, 2021
3TUSK added a commit to teaconmc/Longjing that referenced this issue Jun 25, 2022
This should solve the recent mysterious publication failure.
3TUSK added a commit to teaconmc/Longjing that referenced this issue Jun 26, 2022
3TUSK added a commit to teaconmc/Puer that referenced this issue Jun 30, 2022
vvarg229 added a commit to vvarg229/neofs-node that referenced this issue Jul 18, 2023
Fixed bug nspcc-dev/neofs-s3-gw#798
This bug is only reproducible on ubuntu-latest in github actions.
This is a bug specifically of github acions, not the neofs-s3-gw:
actions/runner-images#2791
aws/aws-cli#5623

Signed-off-by: Oleg Kulachenko <[email protected]>
vvarg229 added a commit to vvarg229/neofs-node that referenced this issue Jul 18, 2023
Fixed bug nspcc-dev/neofs-s3-gw#798
This bug is only reproducible on ubuntu-latest in github actions.
This is a bug specifically of github acions, not the neofs-s3-gw:
actions/runner-images#2791
aws/aws-cli#5623

Signed-off-by: Oleg Kulachenko <[email protected]>
vvarg229 added a commit to vvarg229/neofs-testcases that referenced this issue Jul 19, 2023
Fixed bug nspcc-dev/neofs-s3-gw#798
This is a test environment error, not neofs-s3-gw:
actions/runner-images#2791
aws/aws-cli#5623

Signed-off-by: Oleg Kulachenko <[email protected]>
vvarg229 added a commit to vvarg229/neofs-testcases that referenced this issue Jul 31, 2023
Fixed bug nspcc-dev/neofs-s3-gw#798
This is a test environment error, not neofs-s3-gw:
actions/runner-images#2791
aws/aws-cli#5623

Signed-off-by: Oleg Kulachenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration documentation This is a problem with documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants