seanmor5

seanmor5

Author of Genetic Algorithms in Elixir

Heroku App failed to bind to $PORT in 60 seconds

Hi all, I have a Elixir Umbrella with a Phoenix Web app that I am attempting to deploy to Heroku using Docker.

The Docker build and release succeeds; however, whenever I attempt to visit the running application I get the following error:

2019-01-16T18:11:28.595542+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

2019-01-16T18:11:28.595632+00:00 heroku[web.1]: Stopping process with SIGKILL

2019-01-16T18:11:28.685658+00:00 heroku[web.1]: Process exited with status 137

I am using Phoenix 1.4. I tried a few fixes, namely setting the http config variable correctly. My Phoenix configuration is as follows:

config :bazaar, BazaarWeb.Endpoint,
    load_from_system_env: true,
    http: [port: {:system, "PORT"}],
    url: [host: {:system, "HOST"}, port: 80],
    cache_static_manifest: "priv/static/cache_manifest.json"

The host environment variable is properly set inside the Heroku configuration. I’m not sure what else to try.

Most Liked

gcauchon

gcauchon

It is so simple to build an OTP release with Distillery, wrap it in a Docker image and deploy a container on Heroku; there are no reason to use the buildpack-based deployment anymore.

Furthermore, mix is a development tool, that will one day support building releases. It was never intended to run production code!

gcauchon

gcauchon

Is your docker image based on mix phx.server or are you using distillery to create an OTP release?

If your setup uses Distillery (which I strongly suggest), you are missing a few configuration like described in the guide:

  • server configures the endpoint to boot the Cowboy application http endpoint on start.
  • root configures the application root for serving static files.
  • version ensures that the asset cache will be busted on versioned application upgrades.

Where Next?

Popular in Questions Top

nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New

Other popular topics Top

New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43487 311
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement