-
Notifications
You must be signed in to change notification settings - Fork 180
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
EOFError() during request #245
Comments
Can you post the results with Also:
|
I updated to MbedTLS 0.5.9 and julia 0.6.3 and the error does not show-up any-more even with increasingly long idle times (still using the master branch). This is great! That you very much for your quick help! import HTTP
username = "..."
password = "..."
userinfo = username * ":" * password;
for i = 1:20
sleep(5*i);
f = open("mytest","r");
r = HTTP.request("PUT", "https://b2drop.eudat.eu/remote.php/webdav/mytest_julia5", [("Authorization", "Basic $(base64encode(userinfo))")], f; verbose = 3, DEBUG_LEVEL = 2);
close(f);
end |
I got something similar: julia> using HTTP
julia> r = HTTP.request(
"POST",
"https://api.heroku.com/apps/myapp-xxxxxx/addons",
[
"Content-Type" => "application/json",
"Accept" => "application/vnd.heroku+json; version=3",
"Authorization" => "Bearer 4381064382107483210fdas",
"Cache-Control" => "no-cache"
],
["plan" => "mongolab"]
)
ERROR: IOError(EOFError() during request(https://api.heroku.com/apps/api-barrycallebaut/addons))
Stacktrace:
[1] readuntil(::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, ::typeof(HTTP.Parsers.find_end_of_header)) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/IOExtras.jl:175
[2] readheaders(::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, ::HTTP.Messages.Response) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/Messages.jl:469
[3] startread(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/Streams.jl:149
[4] macro expansion at ./task.jl:266 [inlined]
[5] macro expansion at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/StreamRequest.jl:56 [inlined]
[6] macro expansion at ./task.jl:247 [inlined]
[7] #request#1(::Nothing, ::Nothing, ::Int64, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Type{HTTP.StreamRequest.StreamLayer}, ::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, ::HTTP.Messages.Request, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/StreamRequest.jl:53
[8] (::getfield(HTTP, Symbol("#kw##request")))(::NamedTuple{(:iofunction,),Tuple{Nothing}}, ::typeof(HTTP.request), ::Type{HTTP.StreamRequest.StreamLayer}, ::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, ::HTTP.Messages.Request, ::Array{Pair{String,String},1}) at ./none:0
[9] #request#1(::Nothing, ::Type, ::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}, ::Function, ::Type{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/ConnectionRequest.jl:45
[10] #request at ./none:0 [inlined]
[11] #request#1 at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/ExceptionRequest.jl:19 [inlined]
[12] (::getfield(HTTP, Symbol("#kw##request")))(::NamedTuple{(:iofunction,),Tuple{Nothing}}, ::typeof(HTTP.request), ::Type{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::Array{Pair{String,String},1}) at ./none:0
[13] (::getfield(Base, Symbol("###44#45#46")){ExponentialBackOff,getfield(HTTP.RetryRequest, Symbol("##2#3")){Bool,HTTP.Messages.Request},typeof(HTTP.request)})(::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}, ::Function, ::Type, ::Vararg{Any,N} where N) at ./error.jl:216
[14] ##44#47 at ./none:0 [inlined]
[15] #request#1(::Int64, ::Bool, ::Base.Iterators.Pairs{Symbol,Nothing,Tuple{Symbol},NamedTuple{(:iofunction,),Tuple{Nothing}}}, ::Function, ::Type{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/RetryRequest.jl:44
[16] #request at ./none:0 [inlined]
[17] #request#1(::VersionNumber, ::String, ::Nothing, ::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Type{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/MessageRequest.jl:45
[18] request at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/MessageRequest.jl:28 [inlined]
[19] #request#1(::Int64, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/RedirectRequest.jl:24
[20] request(::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.StreamRequest.StreamLayer}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/RedirectRequest.jl:21
[21] #request#3(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/HTTP.jl:289
[22] request at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/HTTP.jl:289 [inlined]
[23] #request#4 at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/HTTP.jl:303 [inlined]
[24] request(::String, ::String, ::Array{Pair{String,String},1}, ::Array{Pair{String,String},1}) at /home/kaiyin/.julia/packages/HTTP/nUK4f/src/HTTP.jl:299
[25] top-level scope at none:0 Package versions:
|
What do you get with verbose=3 ? |
The original issue was:
Is that what you’re seeing? If not, EOFError in redaheaders probably means that the server disconnected before sending response headers. |
Doing the same request with curl returns the expected result in json, so it shouldn't be a server side disconnection problem. |
Setting verbose=3, I got this:
|
I also got a similar situation when sending a patch request:
|
The problem is that you're passing The doc says:
A vector of pairs is not a supported body type. @quinnj, a
|
I getting the error below when I want to upload a file to a webdav server.
I am getting this error always after a some time (~ minute) of inactivity, but if I repeat the upload right-away it always succeeds.
The error occurs when I read the stream. If I replace the stream
f
byread(f)
), then the request always succeeds (but I have to deal with large files, this is not a good option for me).The equivalent
curl
request works always:I use these versions:
Julia 0.6.2
HTTP.jl 0.6.9
MbedTLS.jl 0.5.8
I am getting also the same error with current master (794b320).
Unfortunately, I cannot share my credentials for you to reproduce the error :-).
The webdav server here is an NextCloud instance.
Here is the test code with the error message:
The text was updated successfully, but these errors were encountered: