-
Notifications
You must be signed in to change notification settings - Fork 178
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
Code failing with Julia dev #1167
Comments
I am seeing a similar issue when processing the body of a POST request, see issue above on the Oxygen.jl repo for details. |
Same thing is happening on Julia 1.11.0-beta1: ERROR: HTTP.RequestError:
HTTP.Request:
HTTP.Messages.Request:
"""
GET /uaa/oauth/token?grant_type=client_credentials HTTP/1.1
Authorization: ******
Content-Type: application/x-www-form-urlencoded
Host: ###############
Accept: */*
User-Agent: HTTP.jl/1.11.0-beta1
Content-Length: 0
Accept-Encoding: gzip
"""Underlying error:
BoundsError: attempt to access 0-element Memory{UInt8} at index [1164:3216]
Stacktrace:
[1] NavAPI.Client(creds::Dict{String, String}; environment::Symbol)
@ NavAPI ~/code/NavAPI.jl/src/NavAPI.jl:110
[2] Client
@ ~/code/NavAPI.jl/src/NavAPI.jl:78 [inlined]
[3] init_client(creds::Dict{String, String})
@ NavAPI ~/code/NavAPI.jl/src/NavAPI.jl:173
[4] top-level scope
@ REPL[10]:1
caused by: HTTP.RequestError:
HTTP.Request:
HTTP.Messages.Request:
"""
GET /uaa/oauth/token?grant_type=client_credentials HTTP/1.1
Authorization: ******
Content-Type: application/x-www-form-urlencoded
Host: #############
Accept: */*
User-Agent: HTTP.jl/1.11.0-beta1
Content-Length: 0
Accept-Encoding: gzip
"""Underlying error:
BoundsError: attempt to access 0-element Memory{UInt8} at index [1164:3216]
Stacktrace:
[1] (::HTTP.ConnectionRequest.var"#connections#4"{…})(req::HTTP.Messages.Request; proxy::Nothing, socket_type::Type, socket_type_tls::Type, readtimeout::Int64, connect_timeout::Int64, logerrors::Bool, logtag::Nothing, kw::@Kwargs{…})
@ HTTP.ConnectionRequest ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/ConnectionRequest.jl:140
[2] (::Base.var"#104#106"{Base.var"#104#105#107"{…}})(args::HTTP.Messages.Request; kwargs::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::Int64})
@ Base ./error.jl:298
[3] (::HTTP.RetryRequest.var"#manageretries#3"{…})(req::HTTP.Messages.Request; retry::Bool, retries::Int64, retry_delays::ExponentialBackOff, retry_check::Function, retry_non_idempotent::Bool, kw::@Kwargs{…})
@ HTTP.RetryRequest ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/RetryRequest.jl:75
[4] manageretries
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/RetryRequest.jl:30 [inlined]
[5] (::HTTP.CookieRequest.var"#managecookies#4"{HTTP.CookieRequest.var"#managecookies#1#5"{…}})(req::HTTP.Messages.Request; cookies::Bool, cookiejar::HTTP.Cookies.CookieJar, kw::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::I
nt64})
@ HTTP.CookieRequest ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/CookieRequest.jl:42
[6] managecookies
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/CookieRequest.jl:19 [inlined]
[7] (::HTTP.HeadersRequest.var"#defaultheaders#2"{…})(req::HTTP.Messages.Request; iofunction::Nothing, decompress::Nothing, basicauth::Bool, detect_content_type::Bool, canonicalize_headers::Bool, kw::@Kwargs{…})
@ HTTP.HeadersRequest ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/HeadersRequest.jl:71
[8] defaultheaders
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/HeadersRequest.jl:14 [inlined]
[9] (::HTTP.RedirectRequest.var"#redirects#3"{…})(req::HTTP.Messages.Request; redirect::Bool, redirect_limit::Int64, redirect_method::Nothing, forwardheaders::Bool, response_stream::Nothing, kw::@Kwargs{…})
@ HTTP.RedirectRequest ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/RedirectRequest.jl:25
[10] redirects
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/RedirectRequest.jl:14 [inlined]
[11] (::HTTP.MessageRequest.var"#makerequest#3"{…})(method::String, url::URIs.URI, headers::Vector{…}, body::Vector{…}; copyheaders::Bool, response_stream::Nothing, http_version::HTTP.Strings.HTTPVersion, verbose::Int64, kw::@Kwargs{})
@ HTTP.MessageRequest ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/MessageRequest.jl:35
[12] makerequest
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/clientlayers/MessageRequest.jl:24 [inlined]
[13] request(stack::HTTP.MessageRequest.var"#makerequest#3"{…}, method::String, url::String, h::Vector{…}, b::Vector{…}, q::Nothing; headers::Vector{…}, body::Vector{…}, query::Nothing, kw::@Kwargs{})
@ HTTP ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/HTTP.jl:457
[14] request(stack::Function, method::String, url::String, h::Vector{Pair{String, String}}, b::Vector{UInt8}, q::Nothing)
@ HTTP ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/HTTP.jl:455
[15] #request#20
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/HTTP.jl:315 [inlined]
[16] request (repeats 2 times)
@ ~/.local/share/julia-1.11.0-beta1/.julia/packages/HTTP/vnQzp/src/HTTP.jl:313 [inlined]
[17] NavAPI.Client(creds::Dict{String, String}; environment::Symbol)
@ NavAPI ~/code/NavAPI.jl/src/NavAPI.jl:96
[18] Client
@ ~/code/NavAPI.jl/src/NavAPI.jl:78 [inlined]
[19] init_client(creds::Dict{String, String})
@ NavAPI ~/code/NavAPI.jl/src/NavAPI.jl:173
[20] top-level scope
@ REPL[10]:1
[...] |
I see the same error when I place a server test in the precompilation step in Stipple (slightly shortened) @compile_workload begin
ui() = [cell("hello"), row("world"), htmldiv("Hello World")]
@app PrecompileApp begin
@in demo_i = 1
end
route("/") do
model = Stipple.ReactiveTools.@init PrecompileApp
page(model, ui) |> html
end
port = rand(8081:8999)
up(port)
HTTP.get("http://localhost:$port")
down()
end If I execute the the same code at the REPL, all is fine. |
We've been seeing the same error in the weekly Mux CI runs. Example here: https://github.com/JuliaWeb/Mux.jl/actions/runs/8769196489/job/24064434203#step:5:136 |
I rerun my test (this one) with the new package version (old: HTTP v1.10.5 - new: HTTP v1.10.6) and it worked. There was no error, no interruption, the query was successfull. |
With HTTP v1.10.6 it is actually worst because now both Julia dev and 1.10.2 are failing. Here is the error: MethodError: no method matching sslupgrade(::Nothing, ::HTTP.Connections.Connection{Sockets.TCPSocket}, ::SubString{String}; readtimeout::Int64, iofunction::Nothing, decompress::Nothing, verbose::Int64, require_ssl_verification::Bool, status_exception::Bool)
Closest candidates are:
sslupgrade(::Type{IOType}, ::HTTP.Connections.Connection{T}, ::AbstractString; pool, require_ssl_verification, keepalive, readtimeout, kw...) where {T, IOType}
@ HTTP C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\Connections.jl:613
Stacktrace:
[1] (::HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}})(req::HTTP.Messages.Request; proxy::String, socket_type::Type, socket_type_tls::Nothing, readtimeout::Int64, connect_timeout::Int64, logerrors::Bool, logtag::Nothing, kw::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP.ConnectionRequest C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\ConnectionRequest.jl:140
[2] connections
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\ConnectionRequest.jl:58 [inlined]
[3] (::Base.var"#96#98"{Base.var"#96#97#99"{ExponentialBackOff, HTTP.RetryRequest.var"#2#5"{Int64, typeof(HTTP.RetryRequest.FALSE), HTTP.Messages.Request, Base.RefValue{Int64}}, HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}})(args::HTTP.Messages.Request; kwargs::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ Base .\error.jl:296
[4] (::HTTP.RetryRequest.var"#manageretries#3"{HTTP.RetryRequest.var"#manageretries#1#4"{HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}})(req::HTTP.Messages.Request; retry::Bool, retries::Int64, retry_delays::ExponentialBackOff, retry_check::Function, retry_non_idempotent::Bool, kw::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP.RetryRequest C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\RetryRequest.jl:75
[5] manageretries
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\RetryRequest.jl:30 [inlined]
[6] (::HTTP.CookieRequest.var"#managecookies#4"{HTTP.CookieRequest.var"#managecookies#1#5"{HTTP.RetryRequest.var"#manageretries#3"{HTTP.RetryRequest.var"#manageretries#1#4"{HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}}}})(req::HTTP.Messages.Request; cookies::Bool, cookiejar::HTTP.Cookies.CookieJar, kw::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::Int64, retries::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP.CookieRequest C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\CookieRequest.jl:42
[7] managecookies
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\CookieRequest.jl:19 [inlined]
[8] (::HTTP.HeadersRequest.var"#defaultheaders#2"{HTTP.HeadersRequest.var"#defaultheaders#1#3"{HTTP.CookieRequest.var"#managecookies#4"{HTTP.CookieRequest.var"#managecookies#1#5"{HTTP.RetryRequest.var"#manageretries#3"{HTTP.RetryRequest.var"#manageretries#1#4"{HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}}}}}})(req::HTTP.Messages.Request; iofunction::Nothing, decompress::Nothing, basicauth::Bool, detect_content_type::Bool, canonicalize_headers::Bool, kw::@Kwargs{verbose::Int64, retries::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP.HeadersRequest C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\HeadersRequest.jl:71
[9] defaultheaders
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\HeadersRequest.jl:14 [inlined]
[10] (::HTTP.RedirectRequest.var"#redirects#3"{HTTP.RedirectRequest.var"#redirects#1#4"{HTTP.HeadersRequest.var"#defaultheaders#2"{HTTP.HeadersRequest.var"#defaultheaders#1#3"{HTTP.CookieRequest.var"#managecookies#4"{HTTP.CookieRequest.var"#managecookies#1#5"{HTTP.RetryRequest.var"#manageretries#3"{HTTP.RetryRequest.var"#manageretries#1#4"{HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}}}}}}}})(req::HTTP.Messages.Request; redirect::Bool, redirect_limit::Int64, redirect_method::Nothing, forwardheaders::Bool, response_stream::Nothing, kw::@Kwargs{verbose::Int64, retries::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP.RedirectRequest C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\RedirectRequest.jl:25
[11] redirects
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\RedirectRequest.jl:14 [inlined]
[12] (::HTTP.MessageRequest.var"#makerequest#3"{HTTP.MessageRequest.var"#makerequest#1#4"{HTTP.RedirectRequest.var"#redirects#3"{HTTP.RedirectRequest.var"#redirects#1#4"{HTTP.HeadersRequest.var"#defaultheaders#2"{HTTP.HeadersRequest.var"#defaultheaders#1#3"{HTTP.CookieRequest.var"#managecookies#4"{HTTP.CookieRequest.var"#managecookies#1#5"{HTTP.RetryRequest.var"#manageretries#3"{HTTP.RetryRequest.var"#manageretries#1#4"{HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}}}}}}}}}})(method::String, url::URIs.URI, headers::Vector{Pair{String, String}}, body::String; copyheaders::Bool, response_stream::Nothing, http_version::HTTP.Strings.HTTPVersion, verbose::Int64, kw::@Kwargs{retries::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP.MessageRequest C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\MessageRequest.jl:35
[13] makerequest
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\clientlayers\MessageRequest.jl:24 [inlined]
[14] request(stack::HTTP.MessageRequest.var"#makerequest#3"{HTTP.MessageRequest.var"#makerequest#1#4"{HTTP.RedirectRequest.var"#redirects#3"{HTTP.RedirectRequest.var"#redirects#1#4"{HTTP.HeadersRequest.var"#defaultheaders#2"{HTTP.HeadersRequest.var"#defaultheaders#1#3"{HTTP.CookieRequest.var"#managecookies#4"{HTTP.CookieRequest.var"#managecookies#1#5"{HTTP.RetryRequest.var"#manageretries#3"{HTTP.RetryRequest.var"#manageretries#1#4"{HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}}}}}}}}}}}}, method::String, url::String, h::Vector{Pair{String, String}}, b::String, q::Nothing; headers::Vector{Pair{String, String}}, body::String, query::Nothing, kw::@Kwargs{retries::Int64, verbose::Int64, require_ssl_verification::Bool, status_exception::Bool})
@ HTTP C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\HTTP.jl:457
[15] #request#20
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\HTTP.jl:315 [inlined]
[16] request
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\HTTP.jl:313 [inlined]
[17] post
@ C:\home\usr\JULIA_DEPOT\packages\HTTP\PnoHb\src\HTTP.jl:532 [inlined] |
The above seems to be the same issue as #1172 |
I can confirm the same issue with HTTP 1.10.8 with Julia 1.11 beta2 for any GET calls. |
This should be fixed now |
The below code is failing with Julia dev version. I am using HTTP.jl v1.10.5.
Note that I hidded some part in the http message response.
It seems to be related to the introduction of "Memory" in yhe development version of Julia.
The text was updated successfully, but these errors were encountered: