1
I’m trying to deploy an API-only application using Heroku, but I deploy it and when I try to get a route I get:
Status: 503 Service Unvailable.
Man Procfile:
release: ENV_SILENT=true node ace migration:run --force web: ENV_SILENT=true npm start
When I use the command: git push heroku master
i get:
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: remote: ----> Creating Runtime Environment
remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_ENV=Production
remote: NODE_MODULES_CACHE=true remote: NODE_VERBOSE=false remote:
remote: ----> Installing binaries remote: Engines.Node
(package.json): 10.16.3 remote: Engines.npm (package.json):
unspecified (use default) remote: remote: Resolving Node version
10.16.3... remote: downloading and Installing Node 10.16.3... remote: Using default npm version: 6.9.0 remote: remote: ----> Restoring
remote cache: - node_modules remote: 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: remote: ----> Build remote: 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: remote: ----> Caching build remote: - node_modules remote:
remote: ----> Build succeeded! remote: ----> Discovering process
types remote: Procfile declares types -> release, web remote: remote:
-----> Compressing... remote: Done: 26M remote: ----> Launching... remote: ! Release command declared: this new release will not be
until the command succeeds. remote: Released V20 remote:
https://xxx.herokuapp.com/ Deployed to Heroku remote: remote:
Verifying deploy... done. remote: Running release command... remote:
remote: Nothing to migrate remote: Waiting for release.... done. To
https://git.heroku.com/xxx.git xxx.. 62bc4e0 master -> master
I’ve tried different routes that work on localhost but all are returning 503 status in Heroku, whether or not they exist.
My log on Heroku:
2019-11-28T12:49:46.000000+00:00 app[api]: Build Started by user [email protected]
2019-11-28T12:50:15.502786+00:00 app[api]: Running release v21 Powered by user [email protected]
2019-11-28T12:50:15.502786+00:00 app[api]: Deploy xxx by user [email protected]
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 [email protected]
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 https://heroku-release-output.s3.amazonaws.com/log-stream?X-Amz-Algorithm=xxx --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]: [36mNothing to migrate[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 [email protected]
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]: > [email protected] 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]: [32minfo[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
The main error seems to be this: Web process failed to bind to $PORT Within 60 Seconds of Launch, probably the application is not even starting, this is probably because it is a fault that we cannot see in this log, the process waits 60 seconds to start your application, but it just doesn’t start (at least not within the time limit), or the problem is some slowness in your project, possible reasons: "maybe the application accesses an unavailable database and takes too long" or "error in some configuration". Only with this log we have no way of knowing.
– Guilherme Nascimento