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

Routing failure does not fall back to IPv4 from IPv6 #659

Closed
staticfloat opened this issue Jan 3, 2021 · 1 comment
Closed

Routing failure does not fall back to IPv4 from IPv6 #659

staticfloat opened this issue Jan 3, 2021 · 1 comment

Comments

@staticfloat
Copy link
Contributor

Julia 1.5.3
HTTP.jl 0.9.1
MbedTLS.jl 1.0.3

I have an IPv6 address that is incorrect, so when I attempt to connect to a dual-stack host such as google.com, curl does the right thing:

$ curl -L -v -o /dev/null https://google.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
*   Trying 2607:f8b0:400a:803::200e:443...
* TCP_NODELAY set
* connect to 2607:f8b0:400a:803::200e port 443 failed: No route to host
*   Trying 172.217.14.206:443...
* TCP_NODELAY set
* Connected to google.com (172.217.14.206) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
...

However, HTTP.jl gets stuck after the IPv6 route fails to work:

julia> using HTTP
       HTTP.DEBUG_LEVEL[] = 3
3

julia> HTTP.get("https://google.com"; verbose=3)
ERROR: IOError(Base.IOError("connect: host is unreachable (EHOSTUNREACH)", -113) during request(https://google.com))

Stacktrace:
 [1] wait_connected(::Sockets.TCPSocket) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Sockets/src/Sockets.jl:525
 [2] connect at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Sockets/src/Sockets.jl:560 [inlined]
 [3] connect(::Sockets.IPv6, ::UInt64) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Sockets/src/Sockets.jl:546
 [4] getconnection(::Type{Sockets.TCPSocket}, ::SubString{String}, ::String; keepalive::Bool, connect_timeout::Int64, readtimeout::Int64, kw::Base.Iterators.Pairs{Symbol,Any,NTuple{4,Symbol},NamedTuple{(:require_ssl_verification, :iofunction, :reached_redirect_limit, :verbose),Tuple{Bool,Nothing,Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/ConnectionPool.jl:653
 [5] #getconnection#29 at /home/sabae/.julia/packages/HTTP/1dCtY/src/ConnectionPool.jl:705 [inlined]
 [6] newconnection(::HTTP.ConnectionPool.Pod, ::Type{T} where T, ::SubString{String}, ::SubString{String}, ::Int64, ::Bool, ::Int64; kw::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:iofunction, :reached_redirect_limit, :verbose),Tuple{Nothing,Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/ConnectionPool.jl:618
 [7] getconnection(::Type{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::SubString{String}, ::SubString{String}; connection_limit::Int64, pipeline_limit::Int64, idle_timeout::Int64, reuse_limit::Int64, require_ssl_verification::Bool, kw::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:iofunction, :reached_redirect_limit, :verbose),Tuple{Nothing,Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/ConnectionPool.jl:562
 [8] request(::Type{ConnectionPoolLayer{DebugLayer{StreamLayer{Union{}}}}}, ::URIs.URI, ::HTTP.Messages.Request, ::Array{UInt8,1}; proxy::Nothing, socket_type::Type{T} where T, reuse_limit::Int64, kw::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:iofunction, :reached_redirect_limit, :verbose),Tuple{Nothing,Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/ConnectionRequest.jl:81
 [9] request(::Type{ExceptionLayer{ConnectionPoolLayer{DebugLayer{StreamLayer{Union{}}}}}}, ::URIs.URI, ::Vararg{Any,N} where N; kw::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:iofunction, :reached_redirect_limit, :verbose),Tuple{Nothing,Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/ExceptionRequest.jl:19
 [10] (::Base.var"#56#58"{Base.var"#56#57#59"{ExponentialBackOff,HTTP.RetryRequest.var"#2#3"{Bool,HTTP.Messages.Request},typeof(HTTP.request)}})(::Type{T} where T, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:iofunction, :reached_redirect_limit, :verbose),Tuple{Nothing,Bool,Int64}}}) at ./error.jl:301
 [11] #request#1 at /home/sabae/.julia/packages/HTTP/1dCtY/src/RetryRequest.jl:44 [inlined]
 [12] request(::Type{MessageLayer{RetryLayer{ExceptionLayer{ConnectionPoolLayer{DebugLayer{StreamLayer{Union{}}}}}}}}, ::String, ::URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; http_version::VersionNumber, target::String, parent::Nothing, iofunction::Nothing, kw::Base.Iterators.Pairs{Symbol,Integer,Tuple{Symbol,Symbol},NamedTuple{(:reached_redirect_limit, :verbose),Tuple{Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/MessageRequest.jl:58
 [13] request(::Type{BasicAuthLayer{MessageLayer{RetryLayer{ExceptionLayer{ConnectionPoolLayer{DebugLayer{StreamLayer{Union{}}}}}}}}}, ::String, ::URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; kw::Base.Iterators.Pairs{Symbol,Integer,Tuple{Symbol,Symbol},NamedTuple{(:reached_redirect_limit, :verbose),Tuple{Bool,Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/BasicAuthRequest.jl:28
 [14] request(::Type{RedirectLayer{BasicAuthLayer{MessageLayer{RetryLayer{ExceptionLayer{ConnectionPoolLayer{DebugLayer{StreamLayer{Union{}}}}}}}}}}, ::String, ::URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; redirect_limit::Int64, forwardheaders::Bool, kw::Base.Iterators.Pairs{Symbol,Int64,Tuple{Symbol},NamedTuple{(:verbose,),Tuple{Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/RedirectRequest.jl:24
 [15] request(::String, ::String, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{UInt8,1}; headers::Array{Pair{SubString{String},SubString{String}},1}, body::Array{UInt8,1}, query::
Nothing, kw::Base.Iterators.Pairs{Symbol,Int64,Tuple{Symbol},NamedTuple{(:verbose,),Tuple{Int64}}}) at /home/sabae/.julia/packages/HTTP/1dCtY/src/HTTP.jl:315
 [16] #get#13 at /home/sabae/.julia/packages/HTTP/1dCtY/src/HTTP.jl:392 [inlined]
 [17] top-level scope at REPL[3]:1
@fredrikekre
Copy link
Member

Fixed by #675 ?

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

No branches or pull requests

2 participants