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

Cannot successfully get AWS config #649

Closed
a-cakir opened this issue Jul 27, 2023 · 2 comments · Fixed by #650
Closed

Cannot successfully get AWS config #649

a-cakir opened this issue Jul 27, 2023 · 2 comments · Fixed by #650

Comments

@a-cakir
Copy link

a-cakir commented Jul 27, 2023

When running from within a docker image using AWS 1.90, the following leads to time out error

docker run -it julia:1.8.5-buster julia -e 'using Pkg; Pkg.add(PackageSpec(name="AWS", version=v"1.90.0")); using AWS; AWS.global_aws_config()'

HTTP.Request:
HTTP.Messages.Request:
"""
PUT /latest/api/token HTTP/1.1
X-aws-ec2-metadata-token-ttl-seconds: 600
Host: 169.254.169.254
Accept: */*
User-Agent: HTTP.jl/1.8.5
Content-Length: 0
Accept-Encoding: gzip

"""Underlying error:
IOError: read: connection timed out (ETIMEDOUT)
Stacktrace:
@omus
Copy link
Member

omus commented Jul 27, 2023

The error seems to only appear when running this MWE on an EC2 instance

@omus
Copy link
Member

omus commented Jul 27, 2023

We may want to make a follow up issue against HTTP.jl as the connection failure here takes far longer than 1 second to timeout:

julia> e = @time try; HTTP.request("PUT", "http://169.254.169.254/latest/api/token"; connect_timeout=1, retry=false, status_exception=true); catch e; e; end
 11.267654 seconds (206 allocations: 75.328 KiB)
HTTP.Exceptions.RequestError(HTTP.Messages.Request:
"""
PUT /latest/api/token HTTP/1.1
Host: 169.254.169.254
Accept: */*
User-Agent: HTTP.jl/1.8.5
Content-Length: 0
Accept-Encoding: gzip

""", Base.IOError("read: connection timed out (ETIMEDOUT)", -110))

It also appears that this is most of the time spend when getting the credentials:

julia> @time try AWS.global_aws_config(); catch e; e; end
 11.243566 seconds (272 allocations: 82.812 KiB)
Can't find AWS credentials!

I'll make another issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants