elixir-crawly / crawly

Crawly, a high-level web crawling & scraping framework for Elixir.
https://hexdocs.pm/crawly
Apache License 2.0
965 stars 113 forks source link

`Could not start application crawly` when trying to enter IEx #187

Closed thiagomajesk closed 1 year ago

thiagomajesk commented 3 years ago

Having crawly as a dev dependency on mix gives an error if I try to run iex -S mix in my phoenix project:

** (Mix) Could not start application crawly: Crawly.Application.start(:normal, []) returned an error: shutdown: failed to start child: {:ranch_listener_sup, Crawly.API.Router.HTTP}
    ** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup
        ** (EXIT) {:listen_error, Crawly.API.Router.HTTP, :eaddrinuse}

The error :eaddrinuse only happens because I'm already running phoenix in localhost:3000. Why is crawly trying to reserve port 3000? Also: could we improve the error message to be more clear?

Ziinc commented 3 years ago

Crawly automatically starts a cowboy http endpoint to allow remote controlling of the Crawly service.

It is probably a good idea to let this as an opt-in feature, to avoid unexpected scenarios like this.

bjunc commented 1 year ago

It would be nice to be able to disable this. We found this to be an issue when running tests while also running a dev environment. It can be solved by setting different port in the test environment from what is used in dev, but it seems more appropriate to simply disable remote control.