Using gitlab-runner will result in an "error: bogus format in GIT_CONFIG_PARAMETERS" error.
Running with gitlab-runner 14.3.3 (febb2a09)
on MACHINE 4nC48mnS
Preparing the "shell" executor 00:00
Preparing environment 00:01
Running on MACHINE...
Getting source from Git repository 00:00
Fetching changes with git depth set to 50...
Reinitialized existing Git repository in /home/gitlab-runner/builds/4nC48mnS/0/dev/test/.git/
error: bogus format in GIT_CONFIG_PARAMETERS
fatal: unable to parse command-line config
ERROR: Job failed: exit status 1
Gitlab-runner's abstract.go has a git fetch -c option.
https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/shells/abstract.go
userAgent := fmt.Sprintf("http.userAgent=%s %s %s/%s", v.Name, v.Version, v.OS, v.Architecture)
fetchArgs := []string{"-c", userAgent, "fetch", "origin"}
fetchArgs = append(fetchArgs, build.GitInfo.Refspecs...)
if depth > 0 {
fetchArgs = append(fetchArgs, "--depth", strconv.Itoa(depth))
}
fetchArgs = append(fetchArgs, build.GetGitFetchFlags()...)
w.Command("git", fetchArgs...)
However, git's fetch command does not have -c.
https://git-scm.com/docs/git-fetch
https://github.com/git/git/blob/master/Documentation/fetch-options.txt
Even if the command is actually executed, an error occurs.
# git -c http.userAgent=gitlab-runner fetch origin
error: bogus format in GIT_CONFIG_PARAMETERS
fatal: unable to parse command-line config
How do you operate it?
- gitlab : 14.3.3
- gitlab-runner : 14.3.3
- git : 2.35.2
- target OS : RHEL8.4
(6/23 Added)
# echo $GIT_CONFIG_PARAMETERS
# test -v GIT_CONFIG_PARAMETERS
# echo $?
1
# cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[user]
name = aaaaaa@example.com
password = "aaaaaa"
[remote "origin"]
url = http://githostname/dev/test.git
fetch = +refs/heads/*:refs/remotes/origin/*
Succeeds if -c option is not used.
# git fetch origin
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 15 (delta 0), reused 0 (delta 0), pack-reused 6
Unpacking objects: 100% (15/15), 1.22 KiB | 52.00 KiB/s, done.
From http://githostname/dev/test
* [new branch] main -> origin/main
# git -c http.userAgent=gitlab-runner fetch origin
error: bogus format in GIT_CONFIG_PARAMETERS
fatal: unable to parse command-line config
So I think the -c option is bad. Do you use the -c option? What to do ... Is there any other reason?