microsoft / hcsshim

Windows - Host Compute Service Shim
MIT License
578 stars 259 forks source link

hcsshim::System::waitBackground failure on docker build RUN step (0xc0370110) #790

Open jmeubank opened 4 years ago

jmeubank commented 4 years ago

Can't find any other evidence of this in the wild beyond the quote below. As of upgrading to docker-desktop-ce 2.2.0.4 (43472) I see this error on a RUN command with docker build:

The command '/bin/sh -c apk add --no-cache openssh==8.1_p1-r0' returned a non-zero code: 4294967295: failed to shutdown container: container e0f131bf256edbf1e0cc073e6492a3227b4d6563f5b1f377e80f3cbce8978cf1 encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110): subsequent terminate failed container e0f131bf256edbf1e0cc073e6492a3227b4d6563f5b1f377e80f3cbce8978cf1 encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110)

The same command completes successfully on the base image in docker run --rm -it, and the shutdown appears normal there.

Docker Engine: 19.03.8 LCOW enabled Windows 10 Pro 64-bit 1909 build 18363.720

This is for saltstack/salt:3000 which is based on alpine 3.11. This was working in LCOW before, only thing that's changed is a Docker Desktop upgrade.

Originally posted by @Iristyle in https://github.com/microsoft/hcsshim/pull/737#issuecomment-566335575:

I'm not sure if this PR is responsible for a new error I'm seeing or not -- but something in between nightly docker 2019-09-25 and nightly docker 2019-12-04 is causing errors on container exit under LCOW with a hcsshim::System::waitBackground message like this now:

PS C:\agent\_work\13\s> docker run -it hadolint/hadolint hadolint --version
Haskell Dockerfile Linter v1.17.3-1-g3fab409
time="2019-12-16T16:45:25-08:00" level=error msg="Error waiting for container: failed to shutdown container: container 33acef4c0b8c4edc15192cf81df85189a7b09d961ca893ac0437811c2625967c encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110): subsequent terminate failed container 33acef4c0b8c4edc15192cf81df85189a7b09d961ca893ac0437811c2625967c encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110)"

This is the last change to roll in that modified system.go so I figured I'd start here @kevpar

jmeubank commented 4 years ago

The difference is between running with and without --rm; the command fails with the same error message when running without --rm. This is true even for simple commands like echo. Same error message in both CMD and bash/mintty.

metrotyranno commented 4 years ago

Just had to battle this issue too.

The issue is present in Docker Desktop CE for windows 2.2.0.4 & 2.2.0.5

A downgrade to 2.2.0.3 resolved the issue.

Windows Server 2019 Standard Microsoft Windows [Version 10.0.17763.1039]

Just tested on my laptop, Issue present in Docker 2.2.3.0 Windows 10 version 2004 19041 (WSL2 & windows containers)

ghost commented 4 years ago

This is the same issue as this one : https://github.com/microsoft/hcsshim/issues/813

Josefczak commented 4 years ago

Issue happens also with Windows Server Core 2004, Docker engine 19.03.12.