AdonisJs error during deployment to Heroku

I am deploying my adonis-api on heroku, all gone good, when i am trying to access the url and see the logs it says bellow;

.env


HOST=127.0.0.1
PORT=93440
NODE_ENV=development
APP_NAME=api
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=fGJq7soIsCDz7YC8eUIggZjnTOMViq5s
DB_CONNECTION=pg
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=password
DB_DATABASE=dbname
HASH_DRIVER=bcrypt
DATABASE_URL=postgres://diprthenpfuifk:...

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

profile

release: ENV_SILENT=true node ace migration:run  --force
web: ENV_SILENT=true node server

all logs

2020-02-11T16:11:27.138107+00:00 heroku[web.1]: Starting process with command `ENV_SILENT=true node server`
2020-02-11T16:11:30.963984+00:00 app[web.1]: info: serving app on http://127.0.0.1:35995
2020-02-11T16:12:27.489455+00:00 heroku[web.1]: State changed from starting to crashed
2020-02-11T16:12:27.381166+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-02-11T16:12:27.381232+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-02-11T16:12:27.468118+00:00 heroku[web.1]: Process exited with status 137
2020-02-11T16:12:29.019322+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=beem-api.herokuapp.com request_id=63976d10-5d3f-4ca6-9624-b1e1d8cf38b0 fwd="103.35.209.17" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T16:12:31.021548+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=beem-api.herokuapp.com request_id=87ef4b5e-9a81-42c1-947b-92f38ad7f796 fwd="103.35.209.17" dyno= connect= service= status=503 bytes= protocol=https
2020-02-11T16:15:44.497858+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=beem-api.herokuapp.com request_id=aec0c64a-1f26-48d5-b39a-ac770e595c0c fwd="46.101.109.4" dyno= connect= service= status=503 bytes= protocol=https
1 Like

Hi @a-qadeer, welcome to our community :smiley:

Try to change host to 0.0.0.0 and remove PORT (it’s automatically set by heroku)

I advise you to use the heroku environment variables (App->Settings->Config Vars) instead of the .env file

2 Likes

shall I use all the variable available in .env from config vars, including APP_KEY

and should I use PORT and HOST too config vars of Heroku?

Sorry for late answer. Yes you can use all your variables from your .env except PORT