Gitlab protocol 2 not working

I was messing around with my gitlab server and found that my gitlab server isn’t responding to git protocol 2 header requests. I can’t find any setting that would actually disable or enable git protocol 2 feature. Here is what I’m currently seeing:

GIT_TRACE_CURL=1 git -c protocol.version=2 ls-remote https://XXX.XXX.XXX.XXX/IaC/tf-azure-cms.git 2>&1 | grep Git-Protocol
15:07:26.793989 http.c:688 => Send header: Git-Protocol: version=2
15:07:26.816366 http.c:688 => Send header: Git-Protocol: version=2
Username for ‘https://xxx.xxxxxxxxxxx.com:443’: user
Password for ‘https://user@xxx.xxxxxxxxxx.com:443’:
15:07:38.687592 http.c:688 => Send header: Git-Protocol: version=2
15:07:38.736313 http.c:688 => Send header: Git-Protocol: version=2
15:07:38.787270 http.c:688 => Send header: Git-Protocol: version=2

As you can see the server never responds with git-protocol v2. The server is running git 2.23.4

GitLab 13.10.2 (7efd19e3716)
GitLab Shell 13.17.0
GitLab Workhorse v13.10.2
GitLab API v4
Ruby 2.7.2p137
Rails 6.0.3.4
PostgreSQL 12.5
Redis 6.0.10

Gitlay servers
default unix:/var/opt/gitlab/gitaly/gitaly.socket 13.10.2 2.29.0

Hi,

Did you see this in the Gitlab docs? Configuring Git Protocol v2 | GitLab

Yes, according to that doc, the HTTP and HTTPS side should be ready to use Git-protocol 2 right out of the box, but it doesn’t respond at all.

Strange, mine does when I do this:

 GIT_TRACE_PACKET=1 git -c protocol.version=2 ls-remote https://myusername:mytoken@gitlab.mydomain.com/group/project.git 2>&1 | head
20:38:18.740274 pkt-line.c:80           packet:          git< # service=git-upload-pack
20:38:18.740317 pkt-line.c:80           packet:          git< 0000
20:38:18.740326 pkt-line.c:80           packet:          git< version 2
20:38:18.740335 pkt-line.c:80           packet:          git< agent=git/2.29.0
20:38:18.740341 pkt-line.c:80           packet:          git< ls-refs
20:38:18.740347 pkt-line.c:80           packet:          git< fetch=shallow filter
20:38:18.740353 pkt-line.c:80           packet:          git< server-option
20:38:18.740359 pkt-line.c:80           packet:          git< object-format=sha1
20:38:18.740365 pkt-line.c:80           packet:          git< 0000
20:38:18.740507 pkt-line.c:80           packet:          git< version 2

running Gitlab 13.10.3. Maybe the version of git on your computer is less than 2.18. Since on your computer you will need at least 2.18 or higher to have Git v2 as well as the server.

The only difference in URL is you do GIT_TRACE_CURL, and I do GIT_TRACE_PACKET - which is to check the server supports it. Your command checks the client. I suggest if you want to verify the server supports it, that you use the command I used.