Debian 10 反向移植上的 git 抛出致命错误:无法访问‘https://github.com/user/repo.git’:无法发送 HTTP2 数据

Debian 10 反向移植上的 git 抛出致命错误:无法访问‘https://github.com/user/repo.git’:无法发送 HTTP2 数据

从昨天开始,在更新我的 Debian 10+bpo 系统后,每当我尝试git clonegit fetch或任何其他依赖网络的 git 操作时,我都会得到fatal: unable to access 'https://domain.example/repo.git': Failed sending HTTP2 datafatal: unable to access 'https://domain.example/repo.git': Failed sending HTTP request,具体取决于 git 服务器是否支持 HTTP2。有趣的是,如果我使用git://或 ssh 方案而不是https://,则命令会成功,可能是因为curl未使用。我尝试通过禁用 SSL 验证,git config --global http.sslVerify false但无济于事。我也尝试重新安装libcurl、、和,但这也无济于事。将 git 从降级到也不起作用,我正在努力在不破坏系统的libgnutls情况下降级库。libnettlelibhogweed1:2.29.2-1~bpo10+11:2.20.1-2+deb10u3

输出GIT_CURL_VERBOSE=1 GIT_TRACE2=1 git clone https://github.com/imageworks/pystring.git/(针对 HTTP2):

14:48:42.804049 common-main.c:48                  version 2.29.2
14:48:42.804073 common-main.c:49                  start git clone https://github.com/imageworks/pystring.git/
14:48:42.804104 git.c:445                         cmd_name clone (clone)
14:48:42.804316 repository.c:130                  worktree /home/user/apps/blender-git/pystring
Cloning into 'pystring'...
14:48:42.807866 run-command.c:735                 child_start[0] git remote-https origin https://github.com/imageworks/pystring.git/
14:48:42.809068 common-main.c:48                  version 2.29.2
14:48:42.809107 common-main.c:49                  start /usr/lib/git-core/git remote-https origin https://github.com/imageworks/pystring.git/
14:48:42.809171 git.c:723                         cmd_name _run_dashed_ (clone/_run_dashed_)
14:48:42.809181 run-command.c:735                 child_start[0] git-remote-https origin https://github.com/imageworks/pystring.git/
14:48:42.813549 common-main.c:48                  version 2.29.2
14:48:42.813565 common-main.c:49                  start /usr/lib/git-core/git-remote-https origin https://github.com/imageworks/pystring.git/
14:48:42.813642 repository.c:130                  worktree /home/user/apps/blender-git
14:48:42.813660 remote-curl.c:1482                cmd_name remote-curl (clone/_run_dashed_/remote-curl)
14:48:42.813992 http.c:756              == Info: Couldn't find host github.com in the .netrc file; using defaults
14:48:42.817012 http.c:756              == Info:   Trying 52.64.108.95:443...
14:48:42.848824 http.c:756              == Info: Connected to github.com (52.64.108.95) port 443 (#0)
14:48:42.872164 http.c:756              == Info: found 414 certificates in /etc/ssl/certs
14:48:42.872268 http.c:756              == Info: ALPN, offering h2
14:48:42.872274 http.c:756              == Info: ALPN, offering http/1.1
14:48:42.905343 http.c:756              == Info: SSL connection using TLS1.3 / ECDHE_RSA_AES_128_GCM_SHA256
14:48:42.905367 http.c:756              == Info:         server certificate verification SKIPPED
14:48:42.905374 http.c:756              == Info:         server certificate status verification SKIPPED
14:48:42.905614 http.c:756              == Info:         common name: github.com (matched)
14:48:42.905624 http.c:756              == Info:         server certificate expiration date OK
14:48:42.905649 http.c:756              == Info:         server certificate activation date OK
14:48:42.905664 http.c:756              == Info:         certificate public key: EC/ECDSA
14:48:42.905669 http.c:756              == Info:         certificate version: #3
14:48:42.905715 http.c:756              == Info:         subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=github.com
14:48:42.905743 http.c:756              == Info:         start date: Thu, 25 Mar 2021 00:00:00 GMT
14:48:42.905749 http.c:756              == Info:         expire date: Wed, 30 Mar 2022 23:59:59 GMT
14:48:42.905770 http.c:756              == Info:         issuer: C=US,O=DigiCert\, Inc.,CN=DigiCert High Assurance TLS Hybrid ECC SHA256 2020 CA1
14:48:42.905787 http.c:756              == Info: ALPN, server accepted to use h2
14:48:42.905827 http.c:756              == Info: Using HTTP2, server supports multi-use
14:48:42.905832 http.c:756              == Info: Connection state changed (HTTP/2 confirmed)
14:48:42.905838 http.c:756              == Info: Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
14:48:42.905848 http.c:756              == Info: Failed sending HTTP2 data
14:48:42.905857 http.c:756              == Info: Connection #0 to host github.com left intact
14:48:42.905923 usage.c:64                        error unable to access 'https://github.com/imageworks/pystring.git/': Failed sending HTTP2 data
fatal: unable to access 'https://github.com/imageworks/pystring.git/': Failed sending HTTP2 data
14:48:42.905937 usage.c:68                        exit elapsed:0.092565 code:128
14:48:42.905944 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.092574 code:128
14:48:42.906771 run-command.c:990                 child_exit[0] pid:83401 code:128 elapsed:0.097579
14:48:42.906805 git.c:745                         exit elapsed:0.097976 code:128
14:48:42.906834 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.098004 code:128
14:48:42.907086 transport-helper.c:581            exit elapsed:0.103296 code:128
14:48:42.907580 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.103794 code:128

输出GIT_CURL_VERBOSE=1 GIT_TRACE2=1 git clone https://git.blender.org/blender.git(针对 HTTP1):

14:52:36.744018 common-main.c:48                  version 2.29.2
14:52:36.744038 common-main.c:49                  start git clone https://git.blender.org/blender.git
14:52:36.744051 git.c:445                         cmd_name clone (clone)
14:52:36.744198 repository.c:130                  worktree /home/user/apps/blender
Cloning into 'blender'...
14:52:36.747829 run-command.c:735                 child_start[0] git remote-https origin https://git.blender.org/blender.git
14:52:36.749130 common-main.c:48                  version 2.29.2
14:52:36.749146 common-main.c:49                  start /usr/lib/git-core/git remote-https origin https://git.blender.org/blender.git
14:52:36.749209 git.c:723                         cmd_name _run_dashed_ (clone/_run_dashed_)
14:52:36.749221 run-command.c:735                 child_start[0] git-remote-https origin https://git.blender.org/blender.git
14:52:36.753056 common-main.c:48                  version 2.29.2
14:52:36.753068 common-main.c:49                  start /usr/lib/git-core/git-remote-https origin https://git.blender.org/blender.git
14:52:36.753138 repository.c:130                  worktree /home/user/apps
14:52:36.753164 remote-curl.c:1482                cmd_name remote-curl (clone/_run_dashed_/remote-curl)
14:52:36.753479 http.c:756              == Info: Couldn't find host git.blender.org in the .netrc file; using defaults
14:52:36.976470 http.c:756              == Info:   Trying 82.94.226.105:443...
14:52:37.283163 http.c:756              == Info: Connected to git.blender.org (82.94.226.105) port 443 (#0)
14:52:37.316727 http.c:756              == Info: found 414 certificates in /etc/ssl/certs
14:52:37.316825 http.c:756              == Info: ALPN, offering h2
14:52:37.316835 http.c:756              == Info: ALPN, offering http/1.1
14:52:38.205929 http.c:756              == Info: SSL connection using TLS1.3 / ECDHE_RSA_AES_256_GCM_SHA384
14:52:38.205945 http.c:756              == Info:         server certificate verification SKIPPED
14:52:38.205950 http.c:756              == Info:         server certificate status verification SKIPPED
14:52:38.206028 http.c:756              == Info:         common name: git.blender.org (matched)
14:52:38.206035 http.c:756              == Info:         server certificate expiration date OK
14:52:38.206039 http.c:756              == Info:         server certificate activation date OK
14:52:38.206048 http.c:756              == Info:         certificate public key: RSA
14:52:38.206052 http.c:756              == Info:         certificate version: #3
14:52:38.206061 http.c:756              == Info:         subject: CN=git.blender.org
14:52:38.206068 http.c:756              == Info:         start date: Sat, 10 Apr 2021 21:01:12 GMT
14:52:38.206073 http.c:756              == Info:         expire date: Fri, 09 Jul 2021 21:01:12 GMT
14:52:38.206087 http.c:756              == Info:         issuer: C=US,O=Let's Encrypt,CN=R3
14:52:38.206097 http.c:756              == Info: ALPN, server accepted to use http/1.1
14:52:38.206119 http.c:756              == Info: Failed sending HTTP request
14:52:38.206127 http.c:756              == Info: Connection #0 to host git.blender.org left intact
14:52:38.206200 usage.c:64                        error unable to access 'https://git.blender.org/blender.git/': Failed sending HTTP request
fatal: unable to access 'https://git.blender.org/blender.git/': Failed sending HTTP request
14:52:38.206216 usage.c:68                        exit elapsed:1.453319 code:128
14:52:38.206223 trace2/tr2_tgt_normal.c:123       atexit elapsed:1.453328 code:128
14:52:38.207093 run-command.c:990                 child_exit[0] pid:85831 code:128 elapsed:1.457863
14:52:38.207131 git.c:745                         exit elapsed:1.458262 code:128
14:52:38.207140 trace2/tr2_tgt_normal.c:123       atexit elapsed:1.458288 code:128
14:52:38.207310 transport-helper.c:581            exit elapsed:1.463514 code:128
14:52:38.207751 trace2/tr2_tgt_normal.c:123       atexit elapsed:1.463956 code:128

输出GIT_TRACE2=1 git clone git://github.com/imageworks/pystring.git/

13:30:27.152552 common-main.c:48                  version 2.29.2
13:30:27.152566 common-main.c:49                  start git clone git://github.com/imageworks/pystring.git/
13:30:27.152577 git.c:445                         cmd_name clone (clone)
13:30:27.152720 repository.c:130                  worktree /home/user/apps/pystring
Cloning into 'pystring'...
13:30:28.360314 run-command.c:735                 child_start[0] git index-pack --stdin -v --fix-thin '--keep=fetch-pack 36506 on wsmb-3fd4' --check-self-contained-and-connected
remote: Enumerating objects: 130, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
13:30:28.361412 common-main.c:48                  version 2.29.2
13:30:28.361444 common-main.c:49                  start /usr/lib/git-core/git index-pack --stdin -v --fix-thin '--keep=fetch-pack 36506 on wsmb-3fd4' --check-self-contained-and-connected
13:30:28.361509 repository.c:130                  worktree /home/user/apps
13:30:28.361581 git.c:445                         cmd_name index-pack (clone/index-pack)
remote: Total 130 (delta 2), reused 3 (delta 0), pack-reused 123
Receiving objects: 100% (130/130), 65.18 KiB | 314.00 KiB/s, done.
Resolving deltas: 100% (64/64), done.
13:30:28.781387 git.c:700                         exit elapsed:0.420193 code:0
13:30:28.781400 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.420211 code:0
13:30:28.781752 run-command.c:990                 child_exit[0] pid:36528 code:0 elapsed:0.421436
13:30:28.781939 run-command.c:735                 child_start[1] git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'
13:30:28.783078 common-main.c:48                  version 2.29.2
13:30:28.783095 common-main.c:49                  start /usr/lib/git-core/git rev-list --objects --stdin --not --all --quiet --alternate-refs '--progress=Checking connectivity'
13:30:28.783143 repository.c:130                  worktree /home/user/apps
13:30:28.783205 git.c:445                         cmd_name rev-list (clone/rev-list)
13:30:28.783479 git.c:700                         exit elapsed:0.000614 code:0
13:30:28.783486 trace2/tr2_tgt_normal.c:123       atexit elapsed:0.000623 code:0
13:30:28.783702 run-command.c:990                 child_exit[1] pid:36533 code:0 elapsed:0.001763
13:30:28.787864 git.c:700                         exit elapsed:1.635530 code:0
13:30:28.787898 trace2/tr2_tgt_normal.c:123       atexit elapsed:1.635567 code:0

输出ldd /usr/bin/git

    linux-vdso.so.1 (0x00007ffcc67ae000)
    libpcre2-8.so.0 => /lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007f320a759000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f320a53b000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f320a51a000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f320a510000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f320a34f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f320ab93000)

清除我的gitconfig也没有帮助。

此时我很茫然,不确定是否需要改变一些东西或者只是等待 git/curl 维护人员来解决这个问题。

答案1

在另一台具有相同系统但 git 正常工作的计算机上,我比较了未升级的软件包。

将 libcurl3-gnutls 降级到 7.64.0-4+deb10u2 后问题解决。

答案2

我在 devuan 上也遇到了这个问题。只需清除 git 并从源中安装即可。更喜欢最新版本 https://www.digitalocean.com/community/tutorials/how-to-install-git-from-source-on-ubuntu-20-04-quickstart https://mirrors.edge.kernel.org/pub/software/scm/git/

将其解压到 /tmp cd 中,进入解压后的文件夹 ./configure && make && sudo make install

然后,哪个 git

相关内容