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

EOFError() during request #245

Closed
Alexander-Barth opened this issue May 30, 2018 · 9 comments
Closed

EOFError() during request #245

Alexander-Barth opened this issue May 30, 2018 · 9 comments

Comments

@Alexander-Barth
Copy link

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 by read(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:

curl -T mytest_curl --user 'username:password' 'https://b2drop.eudat.eu/remote.php/webdav/mytest_curl'

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:

userinfo = "username:password"
f = open("mytest","r"); r = HTTP.request("PUT", "https://b2drop.eudat.eu/remote.php/webdav/mytest_julia5", [("Authorization", "Basic $(base64encode(userinfo))")], f; timeout = 120, verbose = 3);
DEBUG: 2018-05-30T16:32:18.828 1967 ➡️  "PUT /remote.php/webdav/mytest_julia5 HTTP/1.1\r\n"
DEBUG: 2018-05-30T16:32:18.828 1967 ➡️  "Authorization: Basic XXXXXXXX=\r\n"
DEBUG: 2018-05-30T16:32:18.828 1967 ➡️  "Host: b2drop.eudat.eu\r\n"
DEBUG: 2018-05-30T16:32:18.829 1967 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-05-30T16:32:18.829 1967 ➡️  "\r\n"
DEBUG: 2018-05-30T16:32:18.829 4f72 ➡️  "a\r\n"ERROR: 
IOError(EOFError() during request(https://b2drop.eudat.eu/remote.php/webdav/mytest_julia5))

Stacktrace:
 [1] readuntil(::HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Parsers.#find_end_of_header) at /home/abarth/.julia/v0.6/HTTP/src/IOExtras.jl:171
 [2] readheaders(::HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Response) at /home/abarth/.julia/v0.6/HTTP/src/Messages.jl:468
 [3] startread(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}}) at /home/abarth/.julia/v0.6/HTTP/src/Streams.jl:146
 [4] macro expansion at /home/abarth/.julia/v0.6/HTTP/src/StreamRequest.jl:58 [inlined]
 [5] macro expansion at ./task.jl:302 [inlined]
 [6] #request#1(::Void, ::Void, ::Int64, ::Array{Any,1}, ::Function, ::Type{HTTP.StreamRequest.StreamLayer}, ::HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Request, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/StreamRequest.jl:53
 [7] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.StreamRequest.StreamLayer}, ::HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Request, ::IOStream) at ./<missing>:0
 [8] #request#1(::Array{Any,1}, ::Function, ::Type{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}, ::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, ::HTTP.Messages.Request, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/DebugRequest.jl:22
 [9] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}, ::HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}, ::HTTP.Messages.Request, ::IOStream) at ./<missing>:0
 [10] #request#1(::Void, ::Type{T} where T, ::Array{Any,1}, ::Function, ::Type{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/ConnectionRequest.jl:45
 [11] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::IOStream) at ./<missing>:0
 [12] #request#1(::Array{Any,1}, ::Function, ::Type{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}, ::HTTP.URIs.URI, ::Vararg{Any,N} where N) at /home/abarth/.julia/v0.6/HTTP/src/ExceptionRequest.jl:19
 [13] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::IOStream) at ./<missing>:0
 [14] (::Base.###49#50#52{ExponentialBackOff,HTTP.RetryRequest.##2#3{Bool,HTTP.Messages.Request},HTTP.#request})(::Array{Any,1}, ::Function, ::Type{T} where T, ::Vararg{Any,N} where N) at ./error.jl:139
 [15] (::Base.#kw###49#51)(::Array{Any,1}, ::Base.##49#51, ::Type{T} where T, ::Vararg{Any,N} where N) at ./<missing>:0
 [16] #request#1(::Int64, ::Bool, ::Array{Any,1}, ::Function, ::Type{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/RetryRequest.jl:44
 [17] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}}, ::HTTP.URIs.URI, ::HTTP.Messages.Request, ::IOStream) at ./<missing>:0
 [18] #request#1(::VersionNumber, ::String, ::Void, ::Void, ::Array{Any,1}, ::Function, ::Type{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/MessageRequest.jl:44
 [19] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::IOStream) at ./<missing>:0
 [20] #request#1(::Int64, ::Bool, ::Array{Any,1}, ::Function, ::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/RedirectRequest.jl:24
 [21] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::Type{HTTP.RedirectRequest.RedirectLayer{HTTP.MessageRequest.MessageLayer{HTTP.RetryRequest.RetryLayer{HTTP.ExceptionRequest.ExceptionLayer{HTTP.ConnectionRequest.ConnectionPoolLayer{HTTP.DebugRequest.DebugLayer{HTTP.StreamRequest.StreamLayer}}}}}}}, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::IOStream) at ./<missing>:0
 [22] #request#7(::Array{Any,1}, ::Function, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/HTTP.jl:289
 [23] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::String, ::HTTP.URIs.URI, ::Array{Pair{SubString{String},SubString{String}},1}, ::IOStream) at ./<missing>:0
 [24] #request#8(::Array{Tuple{String,String},1}, ::IOStream, ::Void, ::Array{Any,1}, ::Function, ::String, ::String, ::Array{Tuple{String,String},1}, ::IOStream) at /home/abarth/.julia/v0.6/HTTP/src/HTTP.jl:303
 [25] (::HTTP.#kw##request)(::Array{Any,1}, ::HTTP.#request, ::String, ::String, ::Array{Tuple{String,String},1}, ::IOStream) at ./<missing>:0
@samoconnor
Copy link
Contributor

Can you post the results with DEBUG_LEVEL = 2 ?
i.e. show an initial successful request, then a ~minute of idle, then a failed request.

Also:

@Alexander-Barth
Copy link
Author

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

@kindlychung
Copy link

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:

(v0.7) pkg> status
    Status `~/.julia/environments/v0.7/Project.toml`
  [cd3eb016] HTTP v0.6.14
  [682c06a0] JSON v0.19.0
  [739be429] MbedTLS v0.6.0
  [91a5bcdd] Plots v0.19.3
  [0ae4a718] VegaDatasets v0.4.0
  [112f6efa] VegaLite v0.3.4

@samoconnor
Copy link
Contributor

What do you get with verbose=3 ?

@samoconnor
Copy link
Contributor

The original issue was:

I am getting this error always after a some time (~ minute) of inactivity, but if I repeat the upload right-away it always succeeds.

Is that what you’re seeing?

If not, EOFError in redaheaders probably means that the server disconnected before sending response headers.

@kindlychung
Copy link

Doing the same request with curl returns the expected result in json, so it shouldn't be a server side disconnection problem.

@kindlychung
Copy link

kindlychung commented Aug 21, 2018

Setting verbose=3, I got this:

DEBUG: 2018-08-21T17:21:26.561 e255 🗑  Deleted:        💀    1↑     1↓  219s api.heroku.com:443:57052 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:21:26.562 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:21:26.562 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:21:27.006 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:35238 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:21:27.006 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:35238 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:21:27.006 e255 ➡️  "POST /apps/app4314312/addons HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:21:27.007 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:21:27.008 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:21:27.009 e255 ➡️  "Authorization: Bearer 43781478321478320147830\r\n"
DEBUG: 2018-08-21T17:21:27.01  e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:21:27.011 e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:21:27.012 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:21:27.013 e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:21:27.014 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:21:27.014 e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:35238 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:21:27.015 e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:35238 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:22:27.168 e255 ❗️  ConnectionLayer EOFError(). Closing: T0  💀    0↑🔒    0↓🔒  60s api.heroku.com:443:35238 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:22:27.169 e255 🗣  Write done: T0  💀    1↑     0↓🔒  60s api.heroku.com:443:35238 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:22:27.169 e255 ✉️  Read done:  T0  💀    1↑     1↓   60s api.heroku.com:443:35238 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:22:27.169 e255 🔄  Retry IOError(EOFError() during request(https://api.heroku.com/apps/app4314312/addons))
: POST /apps/app4314312/addons HTTP/1.1
DEBUG: 2018-08-21T17:22:27.22  e255 🗑  Deleted:        💀    1↑     1↓   60s api.heroku.com:443:35238 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:22:27.221 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:22:27.221 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:22:27.644 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:59544 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:22:27.645 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:59544 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:22:27.645 e255 ➡️  "POST /apps/app4314312/addons HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:22:27.645 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:22:27.646 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:22:27.646 e255 ➡️  "Authorization: Bearer 43781478321478320147830\r\n"
DEBUG: 2018-08-21T17:22:27.647 e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:22:27.648 e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:22:27.649 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:22:27.65  e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:22:27.651 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:22:27.651 e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:59544 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:22:27.652 e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:59544 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:23:27.489 e255 ❗️  ConnectionLayer EOFError(). Closing: T0  💀    0↑🔒    0↓🔒  60s api.heroku.com:443:59544 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:23:27.49  e255 🗣  Write done: T0  💀    1↑     0↓🔒  60s api.heroku.com:443:59544 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:23:27.49  e255 ✉️  Read done:  T0  💀    1↑     1↓   60s api.heroku.com:443:59544 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:23:27.49  e255 🔄  Retry IOError(EOFError() during request(https://api.heroku.com/apps/app4314312/addons))
: POST /apps/app4314312/addons HTTP/1.1
DEBUG: 2018-08-21T17:23:27.731 e255 🗑  Deleted:        💀    1↑     1↓   60s api.heroku.com:443:59544 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:23:27.731 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:23:27.732 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:23:28.202 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:60100 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:23:28.202 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:60100 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:23:28.203 e255 ➡️  "POST /apps/app4314312/addons HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:23:28.204 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:23:28.204 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:23:28.205 e255 ➡️  "Authorization: Bearer 43781478321478320147830\r\n"
DEBUG: 2018-08-21T17:23:28.205 e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:23:28.206 e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:23:28.206 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:23:28.207 e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:23:28.208 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:23:28.208 e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:60100 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:23:28.209 e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:60100 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:24:27.498 e255 ❗️  ConnectionLayer EOFError(). Closing: T0  💀    0↑🔒    0↓🔒  59s api.heroku.com:443:60100 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:24:27.498 e255 🗣  Write done: T0  💀    1↑     0↓🔒  59s api.heroku.com:443:60100 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:24:27.498 e255 ✉️  Read done:  T0  💀    1↑     1↓   59s api.heroku.com:443:60100 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:24:27.498 e255 🔄  Retry IOError(EOFError() during request(https://api.heroku.com/apps/app4314312/addons))
: POST /apps/app4314312/addons HTTP/1.1
DEBUG: 2018-08-21T17:24:28.82  e255 🗑  Deleted:        💀    1↑     1↓   61s api.heroku.com:443:60100 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:24:28.821 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:24:28.821 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:24:29.289 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:60648 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:24:29.289 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:60648 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:24:29.29  e255 ➡️  "POST /apps/app4314312/addons HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:24:29.291 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:24:29.292 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:24:29.293 e255 ➡️  "Authorization: Bearer 43781478321478320147830\r\n"
DEBUG: 2018-08-21T17:24:29.293 e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:24:29.294 e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:24:29.295 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:24:29.296 e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:24:29.296 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:24:29.297 e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:60648 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:24:29.297 e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:60648 ≣16 RawFD(0x00000025)

@kindlychung
Copy link

I also got a similar situation when sending a patch request:

DEBUG: 2018-08-21T17:15:46.011 e255 🗑  Deleted:        💀    1↑     1↓   18s api.heroku.com:443:55784 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:15:46.012 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:15:46.012 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:15:46.454 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:55972 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:15:46.454 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:55972 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:15:46.455 e255 ➡️  "PATCH /apps/appr31rfda/config-vars HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:15:46.455 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:15:46.456 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:15:46.457 e255 ➡️  "Authorization: Bearer 4370fuhdaiyf7u0agaf8dog\r\n"
DEBUG: 2018-08-21T17:15:46.457 e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:15:46.458 e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:15:46.458 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:15:46.459 e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:15:46.459 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:15:46.46  e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:55972 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:15:46.46  e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:55972 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:16:46.504 e255 ❗️  ConnectionLayer EOFError(). Closing: T0  💀    0↑🔒    0↓🔒  60s api.heroku.com:443:55972 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:16:46.548 e255 🗣  Write done: T0  💀    1↑     0↓🔒  60s api.heroku.com:443:55972 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:16:46.548 e255 ✉️  Read done:  T0  💀    1↑     1↓   60s api.heroku.com:443:55972 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:16:46.581 e255 🔄  Retry IOError(EOFError() during request(https://api.heroku.com/apps/appr31rfda/config-vars))
: PATCH /apps/appr31rfda/config-vars HTTP/1.1
DEBUG: 2018-08-21T17:16:46.67  e255 🗑  Deleted:        💀    1↑     1↓   60s api.heroku.com:443:55972 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:16:46.671 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:16:46.671 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:16:47.106 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:32780 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:16:47.106 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:32780 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:16:47.107 e255 ➡️  "PATCH /apps/appr31rfda/config-vars HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:16:47.108 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:16:47.108 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:16:47.109 e255 ➡️  "Authorization: Bearer 4370fuhdaiyf7u0agaf8dog\r\n"
DEBUG: 2018-08-21T17:16:47.11  e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:16:47.111 e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:16:47.112 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:16:47.113 e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:16:47.114 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:16:47.115 e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:32780 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:16:47.115 e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:32780 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:17:47.167 e255 ❗️  ConnectionLayer EOFError(). Closing: T0  💀    0↑🔒    0↓🔒  60s api.heroku.com:443:32780 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:17:47.168 e255 🗣  Write done: T0  💀    1↑     0↓🔒  60s api.heroku.com:443:32780 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:17:47.168 e255 ✉️  Read done:  T0  💀    1↑     1↓   60s api.heroku.com:443:32780 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:17:47.168 e255 🔄  Retry IOError(EOFError() during request(https://api.heroku.com/apps/appr31rfda/config-vars))
: PATCH /apps/appr31rfda/config-vars HTTP/1.1
DEBUG: 2018-08-21T17:17:47.406 e255 🗑  Deleted:        💀    1↑     1↓   60s api.heroku.com:443:32780 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:17:47.406 e255 SSL connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:17:47.406 e255 TCP connect: api.heroku.com:443...
DEBUG: 2018-08-21T17:17:47.846 e255 🔗  New:            ⏸    0↑     0↓    0s api.heroku.com:443:57052 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:17:47.846 e255 👁  Start write:T0  🔁    0↑     0↓    0s api.heroku.com:443:57052 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:17:47.846 e255 ➡️  "PATCH /apps/appr31rfda/config-vars HTTP/1.1\r\n"
DEBUG: 2018-08-21T17:17:47.847 e255 ➡️  "Content-Type: application/json\r\n"
DEBUG: 2018-08-21T17:17:47.848 e255 ➡️  "Accept: application/vnd.heroku+json; version=3\r\n"
DEBUG: 2018-08-21T17:17:47.849 e255 ➡️  "Authorization: Bearer 4370fuhdaiyf7u0agaf8dog\r\n"
DEBUG: 2018-08-21T17:17:47.849 e255 ➡️  "Cache-Control: no-cache\r\n"
DEBUG: 2018-08-21T17:17:47.85  e255 ➡️  "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3521.2 Safari/537.36\r\n"
DEBUG: 2018-08-21T17:17:47.851 e255 ➡️  "Host: api.heroku.com\r\n"
DEBUG: 2018-08-21T17:17:47.851 e255 ➡️  "Transfer-Encoding: chunked\r\n"
DEBUG: 2018-08-21T17:17:47.852 e255 ➡️  "\r\n"
DEBUG: 2018-08-21T17:17:47.853 e255 👁  Start read: T0  🔁    0↑🔒    0↓    0s api.heroku.com:443:57052 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:17:47.853 e255 eof(::Transaction) -> eof(MbedTLS.SSLContext): T0  🔁    0↑🔒    0↓🔒   0s api.heroku.com:443:57052 ≣16 RawFD(0x00000025)
^CDEBUG: 2018-08-21T17:18:17.118 e255 ❗️  ConnectionLayer InterruptException(). Closing: T0  🔁    0↑🔒    0↓🔒  29s api.heroku.com:443:57052 ≣16 RawFD(0x00000025)
DEBUG: 2018-08-21T17:18:17.119 e255 🗣  Write done: T0  💀    1↑     0↓🔒  29s api.heroku.com:443:57052 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:18:17.119 e255 ✉️  Read done:  T0  💀    1↑     1↓   29s api.heroku.com:443:57052 ≣16 RawFD(0xffffffff)
DEBUG: 2018-08-21T17:18:17.119 e255 🚷  No Retry: PATCH /apps/appr31rfda/config-vars HTTP/1.1, InterruptException() not recoverable, PATCH non-idempotent

@samoconnor
Copy link
Contributor

The problem is that you're passing ["plan" => "mongolab"] to the body parameter.

The doc says:

body can take a number of forms:

  • a String, a Vector{UInt8} or any T accepted by write(::IO, ::T)
  • a collection of String or AbstractVector{UInt8} or IO streams or items of any type T accepted by write(::IO, ::T...)
  • a readable IO stream or any IO-like type T for which eof(T) and readavailable(T) are defined.

A vector of pairs is not a supported body type.
Passing """{"plan": "mongolab"}""" or JSON.json("plan" => "mongolab") will probably work.

@quinnj, a MethodError is being thrown in writebody, but it happens on a task and is lost. I'll look improving the exception handling around ... https://github.com/JuliaWeb/HTTP.jl/blob/master/src/StreamRequest.jl#L56

ERROR: MethodError: no method matching write(::HTTP.Streams.Stream, ::Pair{String,String})
Stacktrace:
 [1] write(::HTTP.Streams.Stream, ::Pair{String,String}) at ./io.jl:501
 [2] writechunk(::HTTP.Streams.Stream, ::HTTP.Messages.Request, ::Pair{String,String}) at /Users/sam/.julia/dev/HTTP/src/StreamRequest.jl:125

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

3 participants