Closed a-cakir closed 1 year ago
The error seems to only appear when running this MWE on an EC2 instance
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.
When running from within a docker image using
AWS 1.90
, the following leads to time out errordocker 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()'