Skip to content

[Remote-SSH Bug]: Infinite reconnect loop on macOS — delay-shutdown IPC socket path exceeds macOS 103-char limit (EINVAL), regression in da03e4ef #11672

Description

@overbog

Is there an existing issue for this bug?

  • I have searched the existing open issues and found none that apply.
  • If I find any issue of interest that is related or closed, I will included a link to it in this issue.

Required Troubleshooting Steps

  • I have read and performed the troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting
  • My issue was not covered in the Tips and Tricks linked from the Troubleshooting Wiki.
  • I will include a complete copy of my Remote - SSH logs by running Remote-SSH: Show Log in the command palette or from View > Output in the menu bar

[Optional] Diagnose with Copilot

I did not ask the @remote-ssh participant for help

In step 2 of the troubleshooting wiki, what was the result of running the generated SSH command verbatim outside of VS Code?

I COULD successfully SSH to the remote machine with the generated SSH command

Remote-SSH Log

Remote-SSH Log

[21:02:46.687] VS Code version: 1.122.0-insider
[21:02:46.687] Remote-SSH version: [email protected]
[21:02:46.688] darwin arm64
[21:02:46.771] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/bf/k4yjzypn7n56b_zmb872vddh0000gn/T/vscode-ssh-askpass-420670381789beafab13184221ca980df9919745.sock",...}
[21:02:46.836] stderr> local-server-1> listen EINVAL: invalid argument /var/folders/bf/k4yjzypn7n56b_zmb872vddh0000gn/T/vscode-ssh-askpass-420670381789beafab13184221ca980df9919745.sock
[21:02:46.953] stderr> Authenticated to 192.168.2.103 ([192.168.2.103]:22) using "publickey".
[21:02:47.275] Server delay-shutdown request failed: connect EINVAL /var/folders/bf/k4yjzypn7n56b_zmb872vddh0000gn/T/vscode-ssh-askpass-420670381789beafab13184221ca980df9919745.sock - Local (undefined:undefined)
[21:02:51.838] Exec server for ... closed (gracefully)
[21:02:51.839] > local-server-1> Timed out
[21:02:51.842] SSH Resolver called for ... attempt 2, (Reconnection)
[21:02:56.943] Exec server for ... closed (gracefully)
[21:02:56.943] > local-server-2> Timed out
[21:02:56.946] SSH Resolver called for ... attempt 3, (Reconnection)
... (infinite loop)

Expected Behavior

Remote SSH connects and stays connected without reconnect loop.

Actual Behavior

Remote SSH enters an infinite reconnect loop. The local server fails
to bind its IPC socket (EINVAL) because the generated path is 114 chars,
exceeding macOS's 103-char limit for sockaddr_un.sun_path. The connection
attempts every ~5 seconds indefinitely and never succeeds.

Steps To Reproduce

  1. macOS with default TMPDIR (e.g. /var/folders/bf/k4yjzypn7n56b_zmb872vddh0000gn/T/ — 49 chars)
  2. VS Code Insiders build da03e4ef ([email protected])
  3. Connect to any Remote-SSH host
  4. Observe infinite reconnect loop in Remote-SSH log:
    • "listen EINVAL: invalid argument .../vscode-ssh-askpass-{40hex}.sock"
    • "Server delay-shutdown request failed: connect EINVAL ..."
    • "local-server-N> Timed out"
    • "SSH Resolver called ... attempt N+1 (Reconnection)"

Bisect: build 7090241a (previous) works — no delay-shutdown socket, no EINVAL.
Regression introduced in da03e4ef.

Anything else?

No response

Metadata

Metadata

Assignees

Labels

sshIssue in vscode-remote SSH

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions