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 sdk session init latency #2989

Closed
omriykl opened this issue Dec 4, 2019 · 4 comments
Closed

AWS sdk session init latency #2989

omriykl opened this issue Dec 4, 2019 · 4 comments
Labels
duplicate This issue is a duplicate.

Comments

@omriykl
Copy link

omriykl commented Dec 4, 2019

Please fill out the sections below to help us address your issue.

Version of AWS SDK for Go?

1.25.41

Version of Go (go version)?

1.13.3

What issue did you see?

After upgrading aws-sdk-go from version 1.25.36 to 1.25.41 we experienced high latency (~ 10 minutes) with initialization of the aws session by our app.

After ~10 minutes since starting the app we have seen in the log the following error:
“request expired, resigning”.
We found that the source of this error is: https://github.com/aws/aws-sdk-go/blob/master/aws/corehandlers/handlers.go#L81

Using back version 1.25.36 worked as expected.

We have checked and approved that the issue started in version 1.25.38.

Steps to reproduce

If you have an runnable example, please include it.

@diehlaws diehlaws self-assigned this Dec 6, 2019
@diehlaws
Copy link
Contributor

diehlaws commented Dec 6, 2019

Hi @omriykl, thanks for reaching out to us. Is your code running in a Kubernetes pod, Docker container, or on a host using any IP forwarding/proxy? If so, you can use EC2's ModifyInstanceMetadataOptions call to update the hop limit needed for your application's use case. If reducing the hop limit does not reduce the time taken to retrieve instance profile credentials, please enable debug logging and CredentialsChainVerboseErrors in your session config and provide the resultant output for further review on our end.

Version 1.25.38 of the AWS SDK for Go introduced some changes to support new secure data flow for calls to the Instance Metadata Service. You can read more about EC2's IMDS update here. This should not affect sessions initialized using credentials retrieved from environment variables, the shared credentials file (~/.aws/credentials), or hard-coded into the session's config - if you are using one of these methods to initialize your session please do let us know so we can further investigate this behavior - enabling debug logging and verbose credential chain errors as mentioned above would help in this case as well.

@diehlaws diehlaws added guidance Question that needs advice or information. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Dec 6, 2019
@aaron42net
Copy link

This is in Docker on k8s using IMDS-provided roles via kiam, yes.

Wow this isn't the response I was expecting. AWS is intentionally breaking all IMDS usage in Docker containers in a minor update to the Go SDK? Really? The release notes for 1.25.38 only mention "Adds support for EC2Metadata client to use secure tokens provided by the IMDS", not any warning about breaking existing usage.

How do I disable the use of secure tokens on the Go SDK side? I'd like to upgrade the Go SDK independently of making changes to our entire fleet of EC2 instances.

@aaron42net
Copy link

This issue can be closed as a duplicate of #2972. #2980 or similar is what we're asking for.

@lifeofguenter
Copy link

terraform is also affected since provider version 2.39 - seems like a breaking change to me. I am surprised it has not affected many yet...

@diehlaws diehlaws removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jan 27, 2020
@diehlaws diehlaws added duplicate This issue is a duplicate. and removed guidance Question that needs advice or information. labels Feb 11, 2020
@diehlaws diehlaws removed their assignment Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue is a duplicate.
Projects
None yet
Development

No branches or pull requests

4 participants