benoitc/hackney

Error Starting Hackney Manager

Closed this issue · 7 comments

Hi @benoitc

I am trying to enable the metrics feature of hackney (from my Elixir application)

config.exs

config :hackney,
  mod_metrics: :exometer

mix.exs

      {:elixometer, "~> 1.2"},
      {:exometer_core, "~> 1.5"},
      {:pobox, "~> 1.2"}

I am getting the following error. Please help

** (Mix) Could not start application hackney: exited in: :hackney_app.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, :hackney_manager, {:noproc, {:gen_server, :call, [:exometer_admin, {:ensure, [:hackney, :nb_requests], :counter, []}]}}}}}
            (hackney) c:/dev/ged2/hydra2/apps/dispatcher/deps/hackney/src/hackney_sup.erl:27: :hackney_sup.start_link/0
            (kernel) application_master.erl:277: :application_master.start_it_old/4
2019-05-10 17:03:29.345 [info] Application hackney exited: exited in: :hackney_app.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, :hackney_manager, {:noproc, {:gen_server, :call, [:exometer_admin, {:ensure, [:hackney, :nb_requests], :counter, []}]}}}}}
            (hackney) c:/dev/ged2/hydra2/apps/dispatcher/deps/hackney/src/hackney_sup.erl:27: :hackney_sup.start_link/0
            (kernel) application_master.erl:277: :application_master.start_it_old/4

exometer need to be started before hackney is

I'm running into the same issue with not being able to ensure exometer is started before hackney.

un erlang you can do it by passing it to the application list.

i won't extend this closed issue too much however, this is exactly how i tried to solve the issue, moving exometer to be first in application list above hackney. this did not resolve the issue.

i won't extend this closed issue too much however, this is exactly how i tried to solve the issue, moving exometer to be first in application list above hackney. this did not resolve the issue.

if you have still an issure, please open a new ticket and share the code/config you did. Maybe someone else could have a look.

I fixed the issue by adding the following

# mix.exs
def project do
    [
    ...,
      releases: [
        my_release_name: [
          applications: [exometer_core: :temporary]
        ]
      ]
    ]
  end

thanks i will fix it in new metric hooks