Gitlab Windows Runner fails, cannot find file

Hey there,

I successfully registered a docker-windows gitlab runner, in the GitLab project it shows correctly as running and when the pipeline is triggered, it also provisions the build. However, I am having trouble successfully using it as it errors out on me.

I just used a simple .gitlab-ci.yml:

image: hello-world

stages:
  - test

test_job:
  stage: test
  script:
  - 'echo Hi'
  tags:
  - windows

But it always gives me this output:

Running with gitlab-runner 12.1.0 (de7731dd)
  on windows-gitlab-runner QtXWZoFR
Using Docker executor with image hello-world ...
Pulling docker image hello-world ...
Using docker image sha256:af5989ee148f0436ba05937797accf5feed9aa046975fdadbcf91c4cee2ee1d9 for hello-world ...
Running on RUNNER-QTXWZOFR via 
WS2019GLR...
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in c:/builds/build-infrastructure/gitlab-ci-with-windows-containers/.git/
Checking out 0dbfdbd6 as master...

git-lfs/2.7.1 (GitHub; windows amd64; go 1.11.5; git 6b7fb6e3)

Skipping Git submodules setup

ERROR: Job failed (system failure): Error response from daemon: container 3d2a6b6872e5d8170c75d6e4944a6312700a5d50a06bf8f4a82a0904246a60a5 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2) extra info:

I omitted the rest of the log, as it shows a lot of gitlab variables. But it does not really tell me which file could not be found. Does anyone has any tips on how to solve this?

Hi. I have a same issue with runner. Do you find any solution for this?

I had the same issue. Gitlab seems to always tries to use Powershell. When powershell.exe does not exist in the docker image, you get that exact error.
So, make sure you use an image that supplies powershell.exe, using a “mcr.microsoft.com/dotnet/core/sdk:3.0”, for example, won’t work - that contains pwsh.exe but not powershell.exe! Similar for “hello-world”.

1 Like

Thank you @FabianMaurerRedheads . Solved my issue with mcr.microsoft.com/dotnet/core/sdk:4.8 image.