简体   繁体   中英

Why does my heroku app crash without showing any error?

There is no error in logs, and around 50 seconds after it says Nest application successfully started , it says: State changed from starting to crashed . The last log before the crash is a console log which says the port number. Heroku logs after successful building

Does anybody know how to fix this? or at least where to see a more detailed error log?

I recently had exactly the same problem. My server would crash shortly after the deploy without any log messages.

For me the problem was that my server was listing to http://127.0.0.1:{PORT} . When I changed the server to listen to http://0.0.0.0:PORT my issue was solved.

I am assuming that the container Heroku uses under the hood does not default to exposing mapped ports to localhost. I am using Fastify and found the solution here: https://github.com/fastify/fastify/blob/aea4100062353cf4da1cfcb4fe8167ac0092117c/docs/Server.md#listen

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM