This is a problem, a workaround I have found and a suggestion for the developers to improve error reporting for gitlabs runner “docker-windows”
My environment;
- Latest Gitlab self-hosted on a Virtual machine “gitvm” on Suse Linux host.
- Separate Machine running Windows 10 Pro 21H2 “supersally” and Docker with windows containers
All latest patches/updates/service packs installed.
What I’m trying to do;
Create a CI/CD job to run a docker image on the Windows machine to build some Visual Basic code.
What works;
I have built a docker image, and can fetch/build the code manually from CLI sat at the windows machine. I added gitvm to the hosts file of the image by manually editing the hosts file, and by using the --add-hostname command.
The docker host and docker image can both ping “gitvm” by name.
I can use git (which I installed in the image) to fetch the code from my repository, then MSBUILD to build it. Yay !
I can push the container to gitvm, and it exists in the contaier repository.
What Doesn’t work
If I register and use gitlab-runner on “supersally”, and create a pipeline to build the source, then it will fetch the image from the container registry, but it fails when trying to fetch the source code - see below;
My workaround
The workaround is quite simple, I put the following entry in .gitlab-ci.yaml
variables:
GIT_STRATEGY: none
and get my script to call a powershell screipt inside the container which performs a git clone
What I have discovered;
As with other people I have found that the windows runner can fail with a message
encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: The user name or password is incorrect. (0x52e)
unlike other people who have posted similar error messages which appear as part of the event log, the entry inside Event Viewer for this particular issue doesn’t actually tell you what command it was trying to run.
in other examples I have discovered online, there’s actually a like under the last one that tells you what the command was…eg:
Provider: 00000000-0000-0000-0000-000000000000] extra info: {“CommandLine”:“cmd.exe /C “ECHO 192.100.1.4 host.docker.internal \u003e\u003e %systemroot%\system32\drivers\etc\hosts \u0026 ECHO 192.100.1.4 gateway.docker.internal \u003e\u003e %systemroot%\system32\drivers\etc\hosts””,“User”:“Administrator”,“WorkingDirectory”:“C:\inetpub\wwwroot”,"Environment
My suggestion to the developers;
If possible add the command that was being issued when trying to fetch the source to the Windows Event log !
What I haven’t been able to figure out is why it can’t seem to resolve the name gitvm, when it should all be fine and dandy, and what is the command that the runner is trying to execute that it can’t, and how would I fix the issue so for now, I seem to be stuck with my workaround.
Anyone else have any ideas, suggestions, or solutions to my probelm?
I don’t know how else to get any additional information, and adding
log_level = "debug"
to config.toml hasn’t given any further insight.
Thanks for looking,
Paul.