Docker Community Forums

Share and learn in the Docker community.

Docker containers are randomly terminated

My Docker containers are randomly disconnected. I am using Windows Server 2019 1809, and Docker Engine 19.03.13 I am getting this error sometimes after 1 minute of starting my containers, sometimes after 15 minutes:

time=“2020-12-07T20:29:54-08:00” level=error msg="Error waiting for container: failed to shutdown container: container <container ID> encountered an error during hcsshim::System::Shutdown: failure in a Windows system call: The remote procedure call failed and did not execute. (0x6bf): subsequent terminate failed container <container ID> encountered an error during hcsshim::System::Terminate: failure in a Windows system call: The remote procedure call failed and did not execute. (0x6bf)

Sometimes I am not even running anything special in the container. I just connect to it (with powershell for example) and after a while receive the error.

Any help will be really appreciated!

I think my issue was caused by the VMware ‘appinfo’ plugin. Find workaround here:

Docker by design can run natively only under Linux.
Under Windows it requires virtualization layer like Vmware with a Linux kernel created then it runs on top of it
This kind of error often occur due to either Vmware version incompatibility or some dodgy software running on the Windows Host
If you are running Vmware version 11 or above try changing it to 10.xx
Disable any malware / intruder detection software .
Try to have a plan to switch to Linux later.

Is this another bot? Or did you just choose to ignore that the post is about Windows containers on a Windows Server 2019?

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

So asking questions is consider rude now?

Others have mentioned docker logs $container_id to view the output of the application. This would always be my first thing to check.

Next, you can run a docker inspect $container_id to view details on the state, e.g.:

"State": {
    "Status": "exited",
    "Running": false,
    "Paused": false,
    "Restarting": false,
    "OOMKilled": false,
    "Dead": false,
    "Pid": 0,
    "ExitCode": 2,
    "Error": "",
    "StartedAt": "2016-06-28T21:26:53.477229071Z",
    "FinishedAt": "2016-06-28T21:26:53.478066987Z"
},

The important line there is “OOMKilled” which will be true if you exceed the container memory limits and Docker kills your app. You may also want to lookup the exit code to see if it identifies a cause for the exit by your app.

Note, this only indicates if docker itself kills your process, and requires that you have set a memory limit on your container. Outside of docker, the Linux kernel can lol your process if the host itself runs out of memory. Linux often writes to a log in /var/log when this happens. With Docker Desktop on Windows and Mac, you can adjust the memory allocated to the embedded Linux VM in the docker settings.