Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hackney Fails to Make Request to Server

I am using the Phoenix Framework to run the following to connect to https://api.twitch.tv/kraken/videos/top. It has worked in the past, and not sure what caused this case to happen. Stopping and restarting iex doesn't seem to fix it. Running Elixir 1.0.5, Phoenix 0.14.0, Erlang OTP 18

iex(2)> "https://api.twitch.tv/kraken/videos/top" |> 
...(2)> HTTPoison.get!()
** (exit) exited in: :gen_server.call(:hackney_manager, {:new_request, #PID<0.334.0>, #Reference<0.0.2.365>, {:client, :undefined, :hackney_dummy_metrics, :hackney_ssl_transport, 'api.twitch.tv', 443, "api.twitch.tv", [connect_timeout: 5000, recv_timeout: :infinity], nil, nil, nil, true, :hackney_pool, :infinity, false, 5, false, 0, nil, nil, nil, :undefined, :start, nil, :normal, false, false, false, nil, :waiting, nil, 4096, "", [], :undefined, nil, nil, nil, nil, :undefined, nil}}, :infinity)
    ** (EXIT) no process
    (stdlib) gen_server.erl:212: :gen_server.call/3
             src/hackney_client/hackney_manager.erl:65: :hackney_manager.init_request/1
             src/hackney_client/hackney_manager.erl:55: :hackney_manager.new_request/1
             src/hackney_connect/hackney_connect.erl:181: :hackney_connect.socket_from_pool/4
             src/hackney_connect/hackney_connect.erl:41: :hackney_connect.connect/5 
             src/hackney_client/hackney.erl:317: :hackney.request/5
             lib/httpoison.ex:60: HTTPoison.request/5
             lib/httpoison.ex:60: HTTPoison.request!/5
like image 343
rockerBOO Avatar asked Jul 03 '15 14:07

rockerBOO


1 Answers

Are you sure you've added :httpoison in the applications list in your mix.exs? I had the same problem, I kept banging my head on the wall for hours because of this:

def application do
  [mod: {MyAwesomeApp, []},
   applications: [:phoenix, :phoenix_html, :cowboy, :logger,
                  :phoenix_ecto, :postgrex, :httpoison]]
end

Source: HTTPoison#Installation

like image 159
Sheharyar Avatar answered Oct 15 '22 02:10

Sheharyar