Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Early EOF errors when running git fetch over ssh #2012

Closed
3 tasks done
cwgreene opened this issue Oct 7, 2022 · 9 comments
Closed
3 tasks done

Early EOF errors when running git fetch over ssh #2012

cwgreene opened this issue Oct 7, 2022 · 9 comments
Assignees

Comments

@cwgreene
Copy link

cwgreene commented Oct 7, 2022

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

If git is configured to use the code in this repo, then the following error will sometimes occur for largish repos:

fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

Full description, and discussion is in this issue here (closed for unknown reasons).

#1322

I have given an explanation there as to why this bug is happening.

#1322 (comment)

Exact reproduction steps are currently being developed. Since it is a race condition, trying to force this to occur is tricky, but I am able to reliable reproduce it with a private repository. Obviously, that won't help external verifcation :), so I am still developing a easily reproducible scenario given that I understand what is causing it.

Expected behavior

git clone works

Actual behavior

fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed


### Error details

```console
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed


### Environment data

```PowerShell
Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


### Version

8.9.10

### Visuals

_No response_
@333fred
Copy link

333fred commented Oct 12, 2022

@cwgreene I still see the issue regularly when cloning any repository of sufficient size, so that might help get a reliable repro. Some examples are dotnet/roslyn and dotnet/runtime, in my experience.

@octolith
Copy link

At work I have the built-in OpenSSH client configured for Git and this issue happens constantly, to the extent that sometimes I have to pull a repo 3-6 times for it to work.

@cwgreene
Copy link
Author

@octolith you're saying that you have the builtin OpenSSH client and you're seeing this issue? By built-in, do you mean winssh or the one bundled with git itself? I belive that the version bundled with git itself is using a version of openssh which is built using msys.

Can you use process explorer to determine which version of ssh git is spawning? The above issue and it's proposed cause only applies to the version of ssh that is built against the non msys compatibility layer which.

If you're seeing this against the msys ssh version, something else is happening.

My pardon for the delays, I haven't had time to get a self-contained repro yet, but heck, I'll open a pull request and see if the maintainers will accept it as is.

@tgauth
Copy link
Collaborator

tgauth commented Apr 17, 2023

closing - fix available in https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v9.2.2.0p1-Beta

@RealLitb
Copy link

This probably doesn't only cause problems for git, but also when piping tar content over from linux to a windows client, if my memory serves me correctly! I think the Windows SSH client clauses the connection too early and causes a "truncated tar" file.

@berniegp
Copy link

berniegp commented Nov 7, 2023

Hi, is a new version of OpenSSH planned for inclusion in Windows 10 updates at some point?

@Uxorious
Copy link

Same for Windows 11. A fix would be nice - seeing this all the time.

@TroutZhang
Copy link

Still see this error randomly on Win11 23H2(10.0.22631.3880) with OpenSSH 9.5.0.0(through Microsoft.OpenSSh.Beta from winget).

  • retry several times will succeed for the git clone that incurs git fetch.

My ssh info:

PS: where.exe ssh
C:\Program Files\OpenSSH\ssh.exe
C:\Windows\System32\OpenSSH\ssh.exe

And version for each

PS: &"C:\Program Files\OpenSSH\ssh.exe" -V
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
PS: C:\Windows\System32\OpenSSH\ssh.exe -V
OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3

@TroutZhang
Copy link

And for the git bash comes within windows git(git version 2.45.2.windows.1):

$ ssh -V
OpenSSH_9.7p1, OpenSSL 3.2.1 30 Jan 2024

It makes me feel maybe I need openSSH 10.0 to get this solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants