BruneX
BruneX

Reputation: 588

Heroku - "No web processes running" message, but server already started

I'm facing the following issue with Heroku and my Node / Express / MongoDB app:

XXXX-05-10T22:56:41.782988+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=fast-depths-03410.herokuapp.com request_id=d42d214e-051d-4ba9-842f-ad98cedaf4ab fwd="xxx.xxx.xxx.xxx" dyno= connect= service= status=503 bytes= protocol=https

I saw in a lot of posts that this error is related to the dyno scale, but I think this is not the case.

As you can see in the below logs, the app is running:

XXXX-05-10T22:41:56.098412+00:00 app[api.1]: yarn run v1.22.5
XXXX-05-10T22:41:56.253837+00:00 app[api.1]: $ node index.js
XXXX-05-10T22:41:57.849610+00:00 app[api.1]: server started on port 23804 (development)

but when I'm trying to access to my Heroku app: https://fast-depths-03410.herokuapp.com/ The only thing I can see is the message

Application error check the logs..."

Regarding my app, I've tried the following things:

What is the problem, and how can I fix it?

Upvotes: 0

Views: 356

Answers (1)

Chris
Chris

Reputation: 136918

You have something running, but it's not a web process. Your log shows an api process:

XXXX-05-10T22:41:57.849610+00:00 app[api.1]: server started on port 23804 (development)
                                     ^^^

For non-Docker deploys, process types are defined by your Procfile, and only web processes can receive traffic from the internet. In this scenario, change your Procfile from

api: some command

to

web: some command

and redeploy.

If you are using Docker, make sure to use web for your process-type when you build and push your image and later when you release it, e.g.:

heroku container:push web
heroku container:release web

Upvotes: 1

Related Questions