Group Runner stuck with 'Created fresh repository.'

Hi Everybody,

Initialized empty git repository seems wrong, because there is an git repositories which the runners should operate on (see pipline output below).

Could give me anyone an hint what I do wrong here?

I have two Gitlab-CI runners on two Windows LTSC VMs.

  • One is running as expected (Shared runner)
  • The other (Group Runner) stucks with “Initialized empty Git repository in C:/GitlabRunner/builds/fqYELQzP/0/
    Except the runner type (Shared vs. Gruop) I can’t figure out the difference.

We run the service as user account as described in [1]

Also please note that I have to prepare steps that include privileged security for our sys-admin, since I don’t have them…

Here is what the pipline says:

Initialized empty Git repository in C:/GitlabRunner/builds/fqYELQzP/0/group/project/.git/
[12](https://git.company.com/group/project/-/jobs/30672#L12)hint: Using 'master' as the name for the initial branch. This default branch name
[13](https://git.company.com/group/project/-/jobs/30672#L13)hint: is subject to change. To configure the initial branch name to use in all
[14](https://git.company.com/group/project/-/jobs/30672#L14)hint: of your new repositories, which will suppress this warning, call:
[15](https://git.company.com/group/project/-/jobs/30672#L15)hint:
[16](https://git.company.com/group/project/-/jobs/30672#L16)hint: git config --global init.defaultBranch <name>
[17](https://git.company.com/group/project/-/jobs/30672#L17)hint:
[18](https://git.company.com/group/project/-/jobs/30672#L18)hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
[19](https://git.company.com/group/project/-/jobs/30672#L19)hint: 'development'. The just-created branch can be renamed via this command:
[20](https://git.company.com/group/project/-/jobs/30672#L20)hint:
[21](https://git.company.com/group/project/-/jobs/30672#L21)hint: git branch -m <name>
Created fresh repository.
DEBUG:  286+  >>>> & "git" "-c" "http.userAgent=gitlab-runner 13.8.0 windows/amd64" "fetch" 
"origin" "+refs/pipelines/6207:refs/pipelines/6207" 
"+refs/heads/453-visual-studio-codium-with-gcc:refs/remotes/origin/453-visual-studio-codium-with-gc
c" "--depth" "10" "--no-tags"

Reading this, I tried to set the defaultBranch with an before_script (see below in gitlab-ci.yaml).

As you can see I also set log_level = debug, but
eventws.msc seems not to show any useful in this case:

Level	Date and Time	Source	Event ID	Task Category
Information	2/10/2021 12:01:59 PM	gitlab-runner	1	None	Checking for jobs... received                     e[0;m  jobe[0;m=30668 repo_urle[0;m=https://git.company.com/group/project.git runnere[0;m=fqYELQzP
Information	2/10/2021 11:56:10 AM	gitlab-runner	1	None	[session_server].listen_address not defined, session endpoints disablede[0;m  buildse[0;m=0
Information	2/10/2021 11:56:10 AM	gitlab-runner	1	None	listen_address not defined, metrics & debug endpoints disablede[0;m  buildse[0;m=0
Information	2/10/2021 11:56:10 AM	gitlab-runner	1	None	Configuration loaded                              e[0;m  buildse[0;m=0
Information	2/10/2021 11:56:10 AM	gitlab-runner	1	None	Starting multi-runner from C:\GitlabRunner\config.toml...e[0;m  buildse[0;m=0

gitlab-runner.toml:

concurrent = 2
check_interval = 0
log_level = "debug"
log_format = "text"

[session_server]
  session_timeout = 1800

[[runners]]
  name = "Computername"
  url = "https://git.company.com/"
  token = "TOKEN"
  executor = "shell"
  shell = "powershell"
  environment = ["PATH=PATH;C:/git/bin;C:/cmake/bin;C:/MinGW/bin"]
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]


.\gitlab-runner.exe --version
Version:      13.8.0
Git revision: 775dd39d
Git branch:   13-8-stable
GO version:   go1.13.8
Built:        2021-01-20T13:32:55+0000

Gitlab (Self-Hosted Community) Version: 13.8.3

gitlab-ci.yml (excerpt):
stages:
- compile

before_script:
     - git config --global init.defaultBranch develop

compile64.debug.mingw:
    stage: compile
    tags:
        - windows
        - debug
        - mingw
    variables:
        #GIT_DEPTH: 10
        #GIT_STRATEGY: fetch
        #GIT_FETCH_EXTRA_FLAGS: --no-tags
        #GIT_SUBMODULE_STRATEGY: recursive
        build_path: .\build\debug_x64-gnu830
        src_path: ..\..\src
    script:
        - git submodule sync
        - git submodule update --init --recursive
        - mkdir -Force $build_path
        - cd $build_path
        - cmake -DCMAKE_BUILD_TYPE=Debug $src_path
        - make

compile64.release.mingw:
    stage: compile
    tags:
        - windows
        - release
        - mingw
    variables:
        GIT_DEPTH: 10
        GIT_STRATEGY: fetch
        GIT_FETCH_EXTRA_FLAGS: --no-tags
        GIT_SUBMODULE_STRATEGY: recursive
        build_path: .\build\release_x64-gnu830
        src_path: ..\..\src\
    script:
        - mkdir -Force $build_path
        - cd $build_path
        - cmake -DCMAKE_BUILD_TYPE=Release $src_path
        - make    

For testing (we use this VM for other stuff too) git is not in the system path, that’s why it’a appended in the runner config (see above).

[1] Install GitLab Runner on Windows | GitLab

Btw,
still having this problem!
Gitlab Version: v13.12.5
Runner Version: 13.8.0

Really no idea?

Should I provide some more information?

Thanks!

Hey,
similar Problem here.

I have one shared runner (docker executor on a linux LXC)
on some jobs, it gets stuck:

Fetching changes with git depth set to 50…

[21] (https://git.domain.tld/< user>/< project-name>/-/jobs/2159#L21)Initialized empty Git repository in /builds/< user >/< project-name >/.git/

[22] (https://git.domain.tld/< user>/< project-name>/-/jobs/2159#L22)Created fresh repository.

If I click “Cancel” and then “Retry” it works without any issue.

root@gitrunner:~# gitlab-runner -v   
Version:      13.12.0
Git revision: 7a6612da
Git branch:   13-12-stable
GO version:   go1.13.8
Built:        2021-05-20T15:16:05+0000
OS/Arch:      linux/amd64
root@gitrunner:~# 

HI,
at least someone else :smiley:
Well, I decided to not looking in the issue any further… at least, until I really need them.

Regards

This was a while ago, but I had the same problem multiple times and figured out a solution.

If you inspect the fresh git repository it’s supposedly creating, you will see that it’s empty and looks like git is waiting for something to access the remote. Especially on Windows, you learn to suspect git being silently stuck on authentication pretty often.

In my case, I had to do

git config --system --unset credential.helper

and then everything worked fine.
Hope this helps !

1 Like

Thank you @Sahnvour ! after debugging my windows VM for many days this works!!