Skip to content

Fetch hangs forever when SSH key or credential helper stalls — no timeout on trampoline socket #22046

Closed

Description

@coleleavitt

The problem

When git fetch triggers an SSH passphrase prompt, host key verification, or credential helper that stalls, Desktop shows "Fetching origin / Hang on..." forever with no way to recover except force-quitting. The user gets no error, no timeout, just an infinite spinner.

Root cause: The trampoline server (TCP socket that handles credential/SSH askpass communication between git and Desktop) has no socket timeout. If the git process sends a credential request and the handler stalls (e.g., SSH key has passphrase but no agent running, host not in known_hosts, GCM hung), the socket stays open indefinitely → git blocks waiting for response → Desktop hangs.

Common scenarios:

  • User has SSH remote but keys aren't configured for Windows SSH
  • SSH key has passphrase but ssh-agent isn't running
  • Host not in known_hosts — SSH tries to prompt on non-existent TTY
  • Git Credential Manager (GCM) hangs or is unresponsive

Steps to reproduce

  1. Set up a repo with SSH remote ([email protected]:...)
  2. Ensure Windows SSH doesn't have the key (e.g., keys only in WSL ~/.ssh/)
  3. Click "Fetch origin" in Desktop
  4. Observe: "Fetching origin / Hang on..." forever

Proposed solution

Add a socket timeout to the trampoline server:

socket.setTimeout(120_000, () => {
  log.error('Trampoline socket timed out after 120s — killing connection')
  socket.destroy()
})

This gives the user an actionable error after 2 minutes instead of hanging forever.

Release version

3.5.8 (x64)

Operating system

Windows 11 (primarily affects SSH users)

Related issues

Implementation in PR #22043.

Activity

  1. niik commented on May 25, 2026

    @niik
    Member

    Thanks for the report! We'd like to understand this better before proceeding.

    GitHub Desktop already handles SSH passphrase prompts, host key verification, and password prompts via its askpass trampoline — so the scenarios you describe (key has passphrase but no agent, host not in known_hosts) should trigger Desktop's built-in UI dialogs rather than hanging.

    Could you provide more detail about what's happening in your specific case?

    • Are you seeing the Desktop SSH passphrase/host key dialog at all, or does it never appear?
    • Could you share the relevant section of your Desktop logs (Help > Show Logs in Finder/Explorer) showing the hang?
    • Is there something specific about your SSH setup (e.g., a custom SSH_ASKPASS, non-standard credential helper) that might prevent the trampoline from intercepting the prompt?

    We'd like to understand the specific conditions where our existing SSH handling isn't working before adding a general socket timeout.

  2. added
    more-info-needed
    on May 25, 2026
  3. github-actions commented on Jun 8, 2026

    @github-actions
    Contributor

    Thank you for your issue!
    We haven't gotten a response to our questions above. With only the information that is currently in the issue, we don't have enough information to take action. We're going to close this but don't hesitate to reach out if you have or find the answers we need. If you answer our questions above, this issue will automatically reopen.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    more-info-neededneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions