Skip to content
Advertisement

Heroku process crashing as soon as the process starts

I have a simple Micronaut server I am trying to launch on Heroku by building it with a heroku.yml but for some reason when I check the logs the process exits as soon as it starts. The docker image runs just fine locally and nothing else prints out in the logs so I can’t find out why.

Here is my Dockerfile

JavaScript

Here is my heroku.yml

JavaScript

and finally my Micronaut application.yml which just sets some configs

JavaScript

When I just do docker build -t test-image:latest . and docker run -p 80:8080 test-image:latest I can connect just fine on localhost and the docker container runs the micronaut server. If it fails for some reason I see an output in the container logs detailing why. When I upload this to heroku (through a github deployment) All i see in the logs are

JavaScript

I have tried: To run it locally connected to the heroku addon postgres database, works just fine Simplifying the build as much as possible Removing the default on the port (to ensure it picks up $PORT), and running it locally with export PORT=8080 set (works just fine, docker container picks up the env port like we expect in heroku)

And I cannot figure out why it just quits immediately on Heroku. editted: originally thought it had to do with the port value but but I figured out how to give micronaut a port through the command line and it still doesn’t work on Heroku (works locally)

edit: I tried changing my application.yml to this with the DB hardcoded and still nothing. Just does not seem to work. App still crashes and there is nothing to indicate why in the logs

JavaScript

I still have no extra output from Heroku. No stacktrace or stderr or stdout at all.

Advertisement

Answer

Well, it isn’t much of an answer. And nothing in the Heroku docs points me to why this works but removing ENTRYPOINT exec java -XX:+UseContainerSupport -XX:MaxRAMPercentage=80.0 -noverify -XX:+AlwaysPreTouch -jar myjar.jar from my Dockerfile works. With entrypoint removed I see logs again and can see my micronaut server starting. With ENTRYPOINT defined in my Dockerfile I just get what I posted about above “Process starting” followed immediately by process crashed

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement