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

{:error, %HTTPoison.Error{id: nil, reason: "closed"}} #326

Open
lypborges opened this issue Apr 22, 2018 · 14 comments
Open

{:error, %HTTPoison.Error{id: nil, reason: "closed"}} #326

lypborges opened this issue Apr 22, 2018 · 14 comments

Comments

@lypborges
Copy link

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?

@atelles
Copy link

atelles commented May 4, 2018

I had a similar error, looks like is this hackney issue: #475

Updating hackney with mix deps.update hackney worked for me.

@dlameri
Copy link

dlameri commented Jun 22, 2018

I'm having the same issue and deps.update hackney didn't help. It isn't https url.

@kaminooni
Copy link

@lypborges have you found a solution?

@willfore
Copy link

I have the same issue elixir 1.7.1 OTP 21 erts 10.0. None of the workarounds are working for me.

@lypborges
Copy link
Author

@kaminooni no. Not yet. I had to change the lib. ;(

@alappe
Copy link

alappe commented Sep 14, 2018

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

@jpiepkow
Copy link

Does anyone have any new information on this?

@jakecurreri
Copy link

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.

@jakecurreri
Copy link

^FYI I added that line and updated :httpoison mix deps.update httpoison. Worked perfectly in production afterward.

@haslinger
Copy link

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.

@utf4
Copy link

utf4 commented Jun 5, 2019

Any update on this issue? I am facing the same?

@ijunaid8989
Copy link

still facing the same issue.

@ijunaid8989
Copy link

even with the update of hackney, the issue is the same.

@thiagopromano
Copy link

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.

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