mkalish
mkalish

Reputation: 330

Docker container stops without any errors while runnning sbt/play application

I'm running into an issue where my docker container will exit with exit code 137 after ~a day of running. The logs for the container contains no information indicating that an error code has occurred. Additionally, attempts to restart the container returns an error that the PID already exists for the application.

The container is built using the sbt docker plugin, sbt docker:publishLocal and is then run using docker run --name=the_app --net=the_app_nw -d the_app:1.0-SNAPSHOT.

I'm also running 3 other docker containers which all together do use 90% of the available memory, but its only ever that particular container which exits.

Looking for any advice on to where to look next.

Upvotes: 1

Views: 490

Answers (1)

Salem
Salem

Reputation: 12986

The error code 137 (128+9) means that it was killed (like kill -9 yourApp) by something. That something can be a lot of things (maybe it was killed because was using too much resources by docker or something else, maybe it got out of memory, etc)

Regarding the pid problem, you can add to your build.sbt this

javaOptions in Universal ++= Seq(
  "-Dpidfile.path=/dev/null"
)

Basically this should instruct Play to not create a RUNNING_PID file. If it does not work you can try to pass that option directly in Docker using the JAVA_OPTS env variable.

Upvotes: 2

Related Questions