git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.32k stars 2.53k forks source link

[REG 2.46.0 -> 2.47.0] Git hangs on fetch #5199

Open orgads opened 11 hours ago

orgads commented 11 hours ago

Setup

$ git --version --build-options

git version 2.47.0.windows.1
cpu: x86_64
built from commit: 8e380191abeda7a995e87abf4acc9e1702fdc698
sizeof-long: 4
sizeof-size_t: 8
shell-path: F:/git-sdk-64/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.10.1
OpenSSL: OpenSSL 3.2.3 3 Sep 2024
zlib: 1.3.1
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.4355]
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Rebase
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable FSMonitor: Disabled

Details

Git Bash

git fetch

It should be done successfully after a while.

It sometimes hangs. I see the following spawned process, which doesn't use any CPU, and doesn't terminate:

git index-pack --stdin -v --fix-thin "--keep=fetch-pack 4272 on my-pc" --pack_header=2,291

The output is:

remote: Counting objects: 195, done
remote: Finding sources: 100% (292/292)
<nothing happens>
<when I press Ctrl-C>
fetch-pack: unexpected disconnect while reading sideband packet
dscho commented 11 hours ago
git fetch

To make this example a little more complete, could you describe from where you are fetching? Is it github.com, a self-hosted git daemon, from a network share? Is it a big fetch, i.e. have already dozens of megabytes been transferred, or is it a small fetch? Did you try to disable sideband?

orgads commented 11 hours ago

It's a hosted gerrit 3.8 server. The fetch is small, took a few seconds after I downgraded to 2.46.

I can try to disable sideband tomorrow.

jfcherng commented 6 hours ago

Latest update: Now it clones okay... without any local env modification... Okay again it just happened.


I tried to clone my https://github.com/jfcherng/copilot-node-server .

It seems to alway hang if I clone git@github.com:jfcherng/copilot-node-server.git. But it's okay if I clone https://github.com/jfcherng/copilot-node-server.git.


Update: It still hangs with GIT_CURL_VERBOSE=1 GIT_TRACE=1 git -c sendpack.sideband=false clone git@github.com:jfcherng/copilot-node-server.git

[jfcherng@HOME Desktop]$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git -c sendpack.sideband=false clone git@github.com:jfcherng/copilot-node-server.git
10:14:30.318887 exec-cmd.c:266          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
10:14:30.329889 git.c:479               trace: built-in: git clone git@github.com:jfcherng/copilot-node-server.git
Cloning into 'copilot-node-server'...
10:14:30.350892 run-command.c:667       trace: run_command: unset GIT_CONFIG_PARAMETERS GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL git@github.com 'git-upload-pack '\''jfcherng/copilot-node-server.git'\'''
10:14:30.350892 run-command.c:928       trace: start_command: ssh -o SendEnv=GIT_PROTOCOL git@github.com 'git-upload-pack '\''jfcherng/copilot-node-server.git'\'''
remote: Enumerating objects: 542, done.
remote: Counting objects: 100% (100/100), done.
10:14:33.230184 run-command.c:667       trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 32844 on 3bc-f19' --check-self-contained-and-connected
10:14:33.230184 run-command.c:928       trace: start_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 32844 on 3bc-f19' --check-self-contained-and-connected
10:14:33.298183 exec-cmd.c:266          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
10:14:33.311182 git.c:479               trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 32844 on 3bc-f19' --check-self-contained-and-connected
remote: Compressing objects: 100% (65/65), done.
Receiving objects:   1% (6/542)

It just hangs on Receiving objects: 1% (6/542). It is always 1% (6/542) everytime I retried. Eventually it failed as the following.

[jfcherng@HOME Desktop]$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git -c sendpack.sideband=false clone git@github.com:jfcherng/copilot-node-server.git
10:16:32.600368 exec-cmd.c:266          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
10:16:32.614373 git.c:479               trace: built-in: git clone git@github.com:jfcherng/copilot-node-server.git
Cloning into 'copilot-node-server'...
10:16:32.653368 run-command.c:667       trace: run_command: unset GIT_CONFIG_PARAMETERS GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL git@github.com 'git-upload-pack '\''jfcherng/copilot-node-server.git'\'''
10:16:32.653368 run-command.c:928       trace: start_command: ssh -o SendEnv=GIT_PROTOCOL git@github.com 'git-upload-pack '\''jfcherng/copilot-node-server.git'\'''
remote: Enumerating objects: 542, done.
remote: Counting objects: 100% (100/100), done.
10:16:35.393876 run-command.c:667       trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 20220 on 3bc-f19' --check-self-contained-and-connected
10:16:35.393876 run-command.c:928       trace: start_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 20220 on 3bc-f19' --check-self-contained-and-connected
10:16:35.455879 exec-cmd.c:266          trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
10:16:35.469968 git.c:479               trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 20220 on 3bc-f19' --check-self-contained-and-connected
remote: Compressing objects: 100% (65/65), done.
fetch-pack: unexpected disconnect while reading sideband packet
fatal: fetch-pack: invalid index-pack output
orgads commented 5 hours ago

Ah right, my case was ssh too.

EemilAhonen commented 53 minutes ago

We are having this same problem with SSH on multiple machines that upgraded to the latest 2.47.0. All clones over 1mb from Gitlab are failing, the Git window just freezes at random points. Uninstalling 2.47.0 and reinstalling 2.44.0 solved the issue.

dscho commented 36 minutes ago

Does it work if you copy the usr\bin\ssh.exe over from v2.46.2?

jfcherng commented 26 minutes ago

Does it work if you copy the usr\bin\ssh.exe over from v2.46.2?

In my case, no.