Skip to content

Runner Docker Windows - git broken inside gitlab-runner-helper image

Summary

I am running a self-hosted runner for Windows (1909).

The executor is: docker-windows

When CI/CD triggers the pipeline, git fails with error:

fatal: exceeded maximum include depth (10) while including
	C:/Program Files/Git/etc/gitconfig
from
	C:/Program Files/Git/etc/gitconfig
This might be due to circular includes.

I verified this by running the same image that the executor is using directly (gitlab/gitlab-runner-helper:x86_64-86ad88ea-servercore1909), and indeed running git inside this image gives the same error.

The issue seems to be that the gitconfig file inside this image is including itself. Below is the related section inside C:\Program Files\git\etc\gitconfig inside the image:

[include]
        ; include Git for Windows' system config in order
        ; to inherit settings like `core.autocrlf`
        path = C:/Program Files (x86)/Git/etc/gitconfig
        path = C:/Program Files/Git/etc/gitconfig

Steps to reproduce

The minimal steps to reproduce are the following.

  1. Launch powershell
  2. run docker run --rm -it gitlab/gitlab-runner-helper:x86_64-86ad88ea-servercore1909 powershell
  3. run git inside the container

What is the current bug behavior?

fatal: exceeded maximum include depth (10) while including
	C:/Program Files/Git/etc/gitconfig
from
	C:/Program Files/Git/etc/gitconfig
This might be due to circular includes.

What is the expected correct behavior?

That git runs, enabling the pipeline job not to fail.

Relevant logs and/or screenshots

Original problem:

gitlab-bug

Reproduced inside the gitlab-runner-helper image:

gitlab-bug-2

Possible fixes

The problem is the gitconfig file, but I do not have insider knowledge to propose a fix.

Edited by Kevin Napoli