I have a docker container that is exiting with code 137 for mongodb connection. So when I first start the server, the connection is successful and everything is fine. But after sometime, mongodb is throwing exited 137 code. When checked the OOMKilled value, its stating to be false.
Using docker version 4.4.1 with mongodb version 4.4
Saw another post where some other users are facing similar issues with version 18.9 onwards. Wondering is it the same issue with version 4.4.1? Any idea what could be the cause for this random disconnection?
Exit code 137 is SIGKILL, which can be caused by an OOM kill, but doesn’t necessarily have to be caused by it.
You can lookup which exit code is actually used by subtracting 128 from it: 137 - 128 = 9; 9 = SIGKILL
I can’t say anything to mongodb, so I will leave your questions for someone else to answer.
Since there is no docker version like that, you probably meant Docker Desktop. On which operating system?
Again, 18.9 (or rather 18.09) is most likely the version of Docker CE while 4.4.1 is the version of Docker Desktop that contains Docker CE. Unless it is so old Desktop that the versioning strategy was different, but I don’t remember those days. Since I don’t know what you found about 18.9, it is impossible to say if those issues are related
Sigkill happens also when you run
docker stop and the process in the container can’t handle the signal because it is running in a bash shell due to wrong entrypoint or command. So if there is something or someone that stops the container you can still see it was killed.
It is also possible that it is simply a MongoDB issue it just happens to run in a container. If you search for “mongodb killed” on Google, you can find issues when mongodb was killed because didn’t have enough space on the disk. But that is just one I could find in 10 seconds so you can have a totally different issue.