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

Could not start application #1

Open
Slavenin opened this issue Apr 2, 2018 · 2 comments
Open

Could not start application #1

Slavenin opened this issue Apr 2, 2018 · 2 comments
Assignees
Labels

Comments

@Slavenin
Copy link

Slavenin commented Apr 2, 2018

Hi!
I add extatus in my mix:

{:extatus, "~> 0.2"}

add config in config/config.exs

config :extatus,
  timeout: 5000,
  port:  1338, #System.get_env("METRIC_PORT"),
  prometheus_registry: :default

add gen server how in example.
add :extatus in application section mix.exs

add Instrumented to supervisor

worker(Instrumented, [restart: :permanent]),

but when i start my application i see error:

[2018-04-02 14:03:13.902] [debug] Using the lastest version of yggdrasil (3.2.3)
[port: nil]
** (Mix) Could not start application extatus: Extatus.start(:normal, []) returned an error: shutdown: failed to start child: Extatus.Server
    ** (EXIT) {{:shutdown, {:failed_to_start_child, :ranch_acceptors_sup, :badarg}}, {:child, :undefined, {:ranch_listener_sup, :http}, {:ranch_listener_sup, :start_link, [:http, 100, :ranch_tcp, [port: nil], :cowboy_protocol, [compress: true, env: [dispatch: [{:_, [], [{["metrics"], [], Extatus.Callback, []}]}]], name: Extatus.Server]]}, :permanent, :infinity, :supervisor, [:ranch_listener_sup]}}

this error because port is nill. But why?

@alexdesousa
Copy link
Member

Thanks for checking this project out :)

I have found the bug that's causing this problem. It's a problem with our recent way of reading arguments from the configuration. I'll fix this soon (probably tomorrow). But for now, you can use the Environment variable EXTATUS_PORT to set your port.

This environment variable must exist before you compile extatus (this is the bug). So, you need to do mix deps.clean --all, mix clean, set the variable EXTATUS_PORT and then recompile everything.

If these steps don't work, let me know. For now, I'll mark this as a bug.

@alexdesousa alexdesousa self-assigned this Apr 2, 2018
@alexdesousa alexdesousa added the bug label Apr 2, 2018
@Slavenin
Copy link
Author

Slavenin commented Apr 2, 2018

this work!

export EXTATUS_PORT=1338
mix deps.clean extatus
mix deps.get
mix deps.compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants