hackney icon indicating copy to clipboard operation
hackney copied to clipboard

hackney breaks on Elixir with new application definition in mix.exs

Open tallakt opened this issue 10 years ago • 6 comments

In Hackney 1.5.5 there an application function was defined in mix.exs. This will replace the contents of srv/hackney_app.src and hackney will no longer work. I suggest reverting this commit c6b540aa7e018100c237369be875173a23ac9c1d

tallakt avatar Mar 19 '16 08:03 tallakt

I'm confused. The change was introduced recently to #302 . Which error do you have?

benoitc avatar Mar 19 '16 08:03 benoitc

** (CaseClauseError) no case clause matching: {:error, {{:EXIT, {{:badmatch, :undefined}, [{:hackney_util, :maybe_apply_defaults, 2, [file: 'src/hackney_util.erl', line: 70]}, {:hackney_pool, :start_link, 2, [file: 'src/hackney_pool.erl', line: 203]}, {:supervisor, :do_start_child, 2, [file: 'supervisor.erl', line: 358]}, {:supervisor, :handle_start_child, 2, [file: 'supervisor.erl', line: 717]}, {:supervisor, :handle_call, 3, [file: 'supervisor.erl', line: 415]}, {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 629]}, {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 661]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}}, {:child, :undefined, :default, {:hackney_pool, :start_link, [:default, [name: :default]]}, :permanent, 10000, :worker, [:hackney_pool]}}}
      (hackney) src/hackney_pool.erl:177: :hackney_pool.do_start_pool/2
      (hackney) src/hackney_pool.erl:65: :hackney_pool.checkout/4
      (hackney) src/hackney_connect.erl:186: :hackney_connect.socket_from_pool/4
      (hackney) src/hackney_connect.erl:36: :hackney_connect.connect/5
      (hackney) src/hackney.erl:321: :hackney.request/5
    (httpoison) lib/httpoison/base.ex:396: HTTPoison.Base.request/9
          (osp) lib/wind/metar.ex:6: Wind.Metar.fetch/0

tallakt avatar Mar 19 '16 08:03 tallakt

because application:get_env now returns undefined for all keys defined in src/hackney.app.src

tallakt avatar Mar 19 '16 08:03 tallakt

I see... @edgurgel any idea how both tickets can be answered then?

benoitc avatar Mar 19 '16 08:03 benoitc

There is a temporary workaround here (httpoison)

https://github.com/edgurgel/httpoison/issues/126

nigelramsay avatar Mar 19 '16 08:03 nigelramsay

so when adding this application, mix is not looking at the .app to load the env?

benoitc avatar Mar 19 '16 09:03 benoitc