httpoison
httpoison copied to clipboard
{:error, %HTTPoison.Error{id: nil, reason: "closed"}}
I’m getting a strange error in HTTPoison. When I do two request to a server “A” in the second I get connection close.
HTTPoison.get("http:/urla.com", [], [ ssl: [{:versions, [:'tlsv1.2']}] , hackney: [pool: :mypool], max_connections: 1000])
When I do this with other server it works.
HTTPoison.get("http:/google.com", [], [ ssl: [{:versions, [:'tlsv1.2']}] , hackney: [pool: :mypool], max_connections: 1000])
So I think it was a error on the server “A” , so a did a manual call with curl 20 times and all work perfect in the server “A” and “B”.
curl http://urla.com\?\[1-20\]
I tried with another lib and the server respond with no error.
HTTPotion.get("http:/urla.com")
I also tried with the default options and with the options above [ ssl: [{:versions, [:'tlsv1.2']}] , hackney: [pool: :mypool], max_connections: 1000]
. But I get the same error.
Any tip what could be the error?
I had a similar error, looks like is this hackney issue: #475
Updating hackney with mix deps.update hackney
worked for me.
I'm having the same issue and deps.update hackney didn't help. It isn't https url.
@lypborges have you found a solution?
I have the same issue elixir 1.7.1 OTP 21 erts 10.0. None of the workarounds are working for me.
@kaminooni no. Not yet. I had to change the lib. ;(
Having the same issues with non-tls URLs (locally over to couchdb), elixir 1.6.5 with OTP 20 and elixir 1.7.3 with OTP 21.
HTTPoison v1.3.0
& hackney v1.14.0
Does anyone have any new information on this?
Tried the README suggestion to update HTTPoison calls with:
HTTPoison.get!(url, headers, [ ssl: [{:versions, [:'tlsv1.2']}] ])
No luck. Throwing a parsing error in production.
^FYI I added that line and updated :httpoison mix deps.update httpoison
. Worked perfectly in production afterward.
Similar issue for me, that's easy to recreate on:
- Erlang/OTP 21 [erts-10.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
- Elixir 1.7.4 (compiled with Erlang/OTP 20)
- {:httpoison, "1.5.0"}
The first request to
{:ok, %HTTPoison.Response{body: body}} = HTTPoison.get("https://www.mundartpodcast.at/feed/mp3/")
always ends up with an empty body, the second one with a truncated (incomplete) body, interestingly enough at's always truncated at the same character.
Setting tlsv to 1.2 does not change anything. requests via wget on the same machine are always successful.
Any update on this issue? I am facing the same?
still facing the same issue.
even with the update of hackney, the issue is the same.
I had the same issue, what happened is that there was an \r\n
in the middle of the URL, removing it resolved my problem.