Ctrl-Z while running mix phx.server

Hi,

I accidentally pressed Ctrl-Z while running my Phoenix app with mix phx.server.

Got:

^Z
[1]+  Stopped                 mix phx.server

And now I cannot start it again. Just gets:

[info] Application app exited: App.Application.start(:normal, []) returned an error: shutdown: failed to start child: AppWeb.Endpoint
    ** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Handler
        ** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, AppWeb.Endpoint.HTTP}
            ** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup
                ** (EXIT) {:listen_error, AppWeb.Endpoint.HTTP, :eaddrinuse}
** (Mix) Could not start application app: App.Application.start(:normal, []) returned an error: shutdown: failed to start child: AppWeb.Endpoint
    ** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Handler
        ** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, AppWeb.Endpoint.HTTP}
            ** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup
                ** (EXIT) {:listen_error, AppWeb.Endpoint.HTTP, :eaddrinuse}

It seems to be something still running…

Where can I find what I did?

1 Like

$ lsof -i :4000

COMMAND     PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
beam.smp  12345 admin   12u  IPv4 0xab0cd6e6fghi5jk5      0t0  TCP *:terabase (LISTEN)

$ kill -9 12345;

[1]  + 12345 killed     mix phx.server

I usually do this. Phoenix is on port :4000.

3 Likes

You can use fg to get the program back into foreground or bg to make it run in the background.

11 Likes