AkkaHttpServer terminating abruptly after starting up

I’ve posted this before but didn’t get any replies. I’m trying to understand why the server is shutting down. The only indication I get is the following:

13111 INFO play.core.server.AkkaHttpServer - Stopping server…

I suspect this is due to input being entered shortly after the command is executed to start the play application because I can re-create this by just hitting Enter when I run the play application in the sbt shell.

This play app is running in a docker container in AWS and because of this immediate shutdown the health check continuously fails and eventually the deployment will fail. Interestingly though, if done enough times eventually it ‘may’ not shut down and the deployment will pass. I can’t seem to figure out what other purpose would cause this. There is no error happening only the INFO message indicating the server is shutting down.

Resolved. Has nothing to do with Akka or the play server. The issue was an ECS timeout issue where the container service wasn’t giving the application enough time to start up before failing the health check. Fixing the issue was a simple update to add a grace period.

This can be done in the cloud formation template via:
HealthCheckGracePeriodSeconds: 120

or it can be done directly in the AWS console on the ECS container in question. Just click update container and click to the screen which has this setting.