Skip to content

Early EOF errors when running git fetch over ssh #2012

Closed

Description

@tessprime

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_

Activity

  1. 333fred commented on Oct 12, 2022

    @333fred

    @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.

  2. octolith commented on Oct 13, 2022

    @octolith

    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.

  3. tessprime commented on Oct 27, 2022

    @tessprime
    Author

    octolith (@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.

  4. tgauth commented on Apr 17, 2023

    @tgauth
    Collaborator
  5. RealLitb commented on Jun 15, 2023

    @RealLitb

    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.

  6. berniegp commented on Nov 7, 2023

    @berniegp

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

  7. Uxorious commented on Jan 19, 2024

    @Uxorious

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

  8. TroutZhang commented on Jul 15, 2024

    @TroutZhang

    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
    
  9. TroutZhang commented on Jul 22, 2024

    @TroutZhang

    It's actually fixed, just need to make sure our git is using the newer version SSH.exe.

    • make it listed in path is not enough.

    Coming back from #1322 (comment)

  10. Uxorious commented on Jul 22, 2024

    @Uxorious

    Does anybody know why Microsoft still hasn't included this fix in one of the bajillion Windows updates since this?

  11. TroutZhang commented on Jul 23, 2024

    @TroutZhang

    Uxorious (@Uxorious)
    One interesting thing during my tests is that:
    If you uninstall OpenSSH Client from System>Optional features, and uninstall OpenSSH from Apps > Installed apps.
    Then you add back OpenSSH Client from System>Optional features
    You will get both:

    • C:\Windows\System32\OpenSSH\ssh.exe @ 8.6p1
    • C:\Program Files\OpenSSH\ssh.exe @ 9.4p1

    And 9.4p1 even not the latest, is greater than 9.2.2.0p1, which contains the fix.

    So I think, if someone is not using an old Windows copy like me (upgraded per year from win10 21H2 to now win11 23H2), or they didn't install the "OpenSSH Client" feature in the first place. And now if they newly enable "OpenSSH Client" feature, they would get the nearly latest 9.4p1 and you-dont-want-in-system32 8.6p1 as well.

  12. TroutZhang commented on Dec 4, 2024

    @TroutZhang

    for win11 24H2:

    ❯ ssh -V
    OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions