Search code examples
dockergitlabgitlab-cigitlab-ci-runnerdocker-for-windows

Gitlab CI prepare environment: Error response from daemon: hcsshim::CreateComputeSystem


I have created a windows image that I pushed to a custom registry. The image builds without any error. It also runs perfectly fine on any machine using the command docker run.

I use a gitlab runner configured to use docker-windows, on a windows host. The image also runs perfectly fine on the windows host when using the command docker run in a shell.

However, when gitlab CI triggers the pipeline, I get the following log containing an error :

Running with gitlab-runner 14.9.0 (d1f69508)
  on Test windows docker runner daSVobYW
Preparing the "docker-windows" executor 00:01
Using Docker executor with image someaddress:someport/windows_msvc2019_qt-desktop-6.2.3:v1.0.0 ...
Pulling docker image someaddress:someport/windows_msvc2019_qt-desktop-6.2.3:v1.0.0 ...
Using docker image sha256:XXX for someaddress:someport/windows_msvc2019_qt-desktop-6.2.3:v1.0.0 with digest someaddress:someport/windows_msvc2019_qt-desktop-6.2.3@sha256:XXX ...
Preparing environment
ERROR: Job failed (system failure): prepare environment: Error response from daemon: hcsshim::CreateComputeSystem 2f20866e4110118edc3274945d93d6138a16a67f9865d325e8b81c572ce08b96: Access denied. (exec.go:73:0s). Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

I looked a the pointed web page but didn't find any good answer to my issue. Any idea ?

Here is my docker info output:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.1)
  compose: Docker Compose (Docker Inc., v2.3.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 15
  Running: 0
  Paused: 0
  Stopped: 15
 Images: 5
 Server Version: 20.10.13
 Storage Driver: windowsfilter (windows) lcow (linux)
  Windows:
  LCOW:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
 Swarm: inactive
 Default Isolation: hyperv
 Kernel Version: 10.0 19044 (19041.1.amd64fre.vb_release.191206-1406)
 Operating System: Windows 10 Pro Version 2009 (OS Build 19044.1586)
 OSType: windows
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.9GiB
 Name: RUNNERNAME
 ID: 35KO:UJAL:TZQ6:KA57:7Q3I:QTLO:YCTI:AR2Y:TIDC:K4UL:VYJ5:BPWR
 Docker Root Dir: C:\ProgramData\Docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries: someaddress:someport
 Live Restore Enabled: false
 Product License: Community Engine

and the content of gitlab runner config file :

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  url = "someurl"
  token = "sometoken"
  executor = "docker-windows"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "someaddress:someport/windows_msvc2019_qt-desktop-6.2.3"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["c:\\cache"]
    shm_size = 0

Solution

  • I have the same problem using Docker version 4.6.0 and above. Try to install docker 4.5.1 from here https://docs.docker.com/desktop/windows/release-notes/ and let me know if this works for you.