Deploy on heroku: I'm receiving 503 - Service Unvailable

I’m trying to make a deploy using heroku, but when i make a get in the URL/route i get:

Status: 503 Service Unvailable.

My application is only api;

My ProcFile:

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

When i run git push heroku master i get:

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 291 bytes | 145.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: Compressing source files… done.
remote: Building source:
remote: -----> Node.js app detected
remote: -----> Creating runtime environment
remote: NODE_ENV=production
remote: NODE_VERBOSE=false
remote: -----> Installing binaries
remote: engines.node (package.json): 10.16.3
remote: engines.npm (package.json): unspecified (use default)
remote: Resolving node version 10.16.3…
remote: Downloading and installing node 10.16.3…
remote: Using default npm version: 6.9.0
remote: -----> Restoring cache
remote: - node_modules
remote: -----> Installing dependencies
remote: Installing node modules (package.json + package-lock)
remote: added 137 packages from 91 contributors and audited 5288 packages in 10.225s
remote: found 2 high severity vulnerabilities
remote: run npm audit fix to fix them, or npm audit for details
remote: -----> Build
remote: -----> Pruning devDependencies
remote: removed 137 packages and audited 4976 packages in 5.253s
remote: found 2 high severity vulnerabilities
remote: run npm audit fix to fix them, or npm audit for details
remote: -----> Caching build
remote: - node_modules
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> release, web
remote: -----> Compressing…
remote: Done: 26M
remote: -----> Launching…
remote: ! Release command declared: this new release will not be available until the command succeeds.
remote: Released v20
remote: deployed to Heroku
remote: Verifying deploy… done.
remote: Running release command…
remote: Nothing to migrate
remote: Waiting for release… done.
xxx…62bc4e0 master -> master

I try differents routes that work in localhost, but when i try in heroku i get 503.

If i access the log i have:

2019-11-28T12:49:46.000000+00:00 app[api]: Build started by user

2019-11-28T12:50:15.502786+00:00 app[api]: Running release v21 commands by user

2019-11-28T12:50:15.502786+00:00 app[api]: Deploy xxx by user

2019-11-28T12:50:15.991700+00:00 app[api]: Starting process with command `/bin/sh -c 'if curl $HEROKU_RELEASE_LOG_STREAM --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then

2019-11-28T12:50:15.991700+00:00 app[api]: chmod u+x /tmp/log-stream

2019-11-28T12:50:15.991700+00:00 app[api]: /tmp/log-stream /bin/sh -c ‘"’"‘ENV_SILENT=true node ace migration:run --force’"’"’

2019-11-28T12:50:15.991700+00:00 app[api]: else

2019-11-28T12:50:15.991700+00:00 app[api]: ENV_SILENT=true node ace migration:run --force

2019-11-28T12:50:15.991700+00:00 app[api]: fi’` by user

2019-11-28T12:50:17.000000+00:00 app[api]: Build succeeded

2019-11-28T12:50:19.984716+00:00 heroku[release.4574]: Starting process with command /bin/sh -c 'if curl --silent --connect-timeout 10 --retry 3 --retry-delay 1 >/tmp/log-stream; then chmod u+x /tmp/log-stream /tmp/log-stream /bin/sh -c '"'"'ENV_SILENT=true node ace migration:run --force'"'"' else ENV_SILENT=true node ace migration:run --force fi'

2019-11-28T12:50:20.562678+00:00 heroku[release.4574]: State changed from starting to up

2019-11-28T12:50:25.427722+00:00 heroku[release.4574]: State changed from up to complete

2019-11-28T12:50:25.404630+00:00 heroku[release.4574]: Process exited with status 0

2019-11-28T12:50:25.289830+00:00 app[release.4574]: e[36mNothing to migratee[39m

2019-11-28T12:50:28.589813+00:00 heroku[web.1]: State changed from crashed to starting

2019-11-28T12:50:27.841393+00:00 app[api]: Release v21 created by user

2019-11-28T12:50:31.893318+00:00 heroku[web.1]: Starting process with command ENV_SILENT=true npm start

2019-11-28T12:50:34.382933+00:00 app[web.1]:

2019-11-28T12:50:34.382959+00:00 app[web.1]: > adonis-api-app@4.1.0 start /app

2019-11-28T12:50:34.382961+00:00 app[web.1]: > cross-env NODE_ENV=production node server.js

2019-11-28T12:50:34.382963+00:00 app[web.1]:

2019-11-28T12:50:35.182502+00:00 app[web.1]: e[32minfoe[39m: serving app on http://localhost:35169

2019-11-28T12:52:38.217941+00:00 heroku[web.1]: State changed from starting to crashed

2019-11-28T12:52:38.088185+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

2019-11-28T12:52:38.088273+00:00 heroku[web.1]: Stopping process with SIGKILL

2019-11-28T12:52:38.194510+00:00 heroku[web.1]: Process exited with status 137

1 Like

Try to change HOST to (In your Heroku environment variables)