microsoft / microsoft/vscode-remote-release

no stdout/stderr in ProxyCommand output

Open
#10,708 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ssh
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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 did not try step 2 of the troubleshooting steps

Remote-SSH Log
Remote-SSH Log

[14:29:11.883] Log Level: 2
[14:29:11.896] SSH Resolver called for "ssh-remote+me-cloud9-dev-east-1", attempt 1
[14:29:11.899] remote.SSH.useLocalServer = true
[14:29:11.900] remote.SSH.useExecServer = false
[14:29:11.900] remote.SSH.bindHost = {}
[14:29:11.900] remote.SSH.path = /usr/bin/ssh
[14:29:11.900] remote.SSH.configFile = 
[14:29:11.900] remote.SSH.useFlock = true
[14:29:11.900] remote.SSH.lockfilesInTmp = false
[14:29:11.901] remote.SSH.localServerDownload = off
[14:29:11.901] remote.SSH.remoteServerListenOnSocket = false
[14:29:11.901] remote.SSH.defaultExtensions = []
[14:29:11.901] remote.SSH.defaultExtensionsIfInstalledLocally = []
[14:29:11.901] remote.SSH.loglevel = 2
[14:29:11.901] remote.SSH.maxReconnectionAttempts = 2
[14:29:11.902] remote.SSH.enableDynamicForwarding = true
[14:29:11.902] remote.SSH.enableRemoteCommand = false
[14:29:11.902] remote.SSH.serverPickPortsFromRange = {}
[14:29:11.902] remote.SSH.serverInstallPath = {}
[14:29:11.902] remote.SSH.permitPtyAllocation = false
[14:29:11.902] remote.SSH.preferredLocalPortRange = undefined
[14:29:11.902] remote.SSH.useCurlAndWgetConfigurationFiles = false
[14:29:11.903] remote.SSH.experimental.chat = false
[14:29:11.903] remote.SSH.experimental.enhancedSessionLogs = true
[14:29:11.909] VS Code version: 1.97.2
[14:29:11.909] Remote-SSH version: remote-ssh@0.117.1
[14:29:11.909] darwin arm64
[14:29:11.916] SSH Resolver called for host: me-cloud9-dev-east-1
[14:29:11.916] Setting up SSH remote "me-cloud9-dev-east-1"
[14:29:11.921] Acquiring local install lock: /var/folders/d5/wymf6s8566775p31234567140000gn/T/vscode-remote-ssh-87cad7c3-install.lock
[14:29:11.921] Looking for existing server data file at /Users/me/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-87cad7c3-e54c774e0add6123456eb0d1e229c6452cf8447-0.117.1-tr/data.json
[14:29:11.921] No existing data file
[14:29:11.922] Using commit id "e54c774e0add1234567eb0d1e229c6452cf8447" and quality "stable" for server
[14:29:11.922] Extensions to install: 
[14:29:11.925] Install and start server if needed
[14:29:11.928] Checking ssh with "/usr/bin/ssh -V"
[14:29:11.934] > OpenSSH_9.4p1, LibreSSL 3.3.6

[14:29:11.936] askpass server listening on /var/folders/d5/wymf6s8566775p31234567140000gn/T/vscode-ssh-askpass-a61234567609583fb84886d945a4cd6408ea.sock
[14:29:11.937] Spawning local server with {"serverId":1,"ipcHandlePath":"/var/folders/d5/wymf6s8566775p31234567140000gn/T/vscode-ssh-askpass-123456f596fcd62a472dac5ea138a0a926c03.sock","sshCommand":"/usr/bin/ssh","sshArgs":["-v","-T","-D","50939","-o","ConnectTimeout=30","me-cloud9-dev-east-1"],"serverDataFolderName":".vscode-server","dataFilePath":"/Users/me/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-87cad7c3-e54c774e0a1234567b0d1e229c6452cf8447-0.117.1-tr/data.json"}
[14:29:11.937] Local server env: {"SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.cGGrr4nXFB/Listeners","SHELL":"/bin/zsh","DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/Users/me/.vscode/extensions/ms-vscode-remote.remote-ssh-0.117.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"","VSCODE_SSH_ASKPASS_MAIN":"/Users/me/.vscode/extensions/ms-vscode-remote.remote-ssh-0.117.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/var/folders/d5/wymf612345678pkc140000gn/T/vscode-ssh-askpass-a6497110ad2d66091234566d945a4cd6408ea.sock"}
[14:29:11.937] Spawned 8766
[14:29:11.938] Using connect timeout of 32 seconds
[14:29:12.031] > local-server-1> Running ssh connection command: /usr/bin/ssh -v -T -D 50939 -o ConnectTimeout=30 me-cloud9-dev-east-1
[14:29:12.032] > local-server-1> Spawned ssh, pid=8767
[14:29:12.036] stderr> OpenSSH_9.4p1, LibreSSL 3.3.6

THERE SHOULD BE A BUNCH OF STDOUT AND STDERR OUTPUT HERE

[14:29:25.935] stderr> debug1: Server host key: ssh-ed25519 SHA256:<public key>
[14:29:26.628] stderr> Authenticated to <instance id> (via proxy) using "publickey".
[14:29:27.060] > 
> A newer release of "Amazon Linux" is available.
>   Version 2023.6.20250203:
>   Version 2023.6.20250211:
> Run "/usr/bin/dnf check-release-update" for full release and version update info
>    ,     #_
>    ~\_  ####_        Amazon Linux 2023
>   ~~  \_#####\
>   ~~     \###|
>   ~~       \#/ ___   https://aws.amazon.com/linux/amazon-linux-2023
>    ~~       V~' '->
>     ~~~         /
>       ~~._.   _/
>          _/ _/
>        _/m/'

Expected Behavior

while waiting 30-45s for connection, i want to see the output of my ProxyCommand script, which shows status of EC2 instance health checks, AWS credential time remaining before expiration, and other info.

Actual Behavior

instead, i see no output from my script (~/.ssh/ssm-proxy.sh) and therefore can't tell why a timeout is happening. sometimes SSH times-out because browser is waiting for SSO, or my card isn't inserted, or my internet connection is bad, or a healthcheck failed for EC2, or a VPN isn't connected, etc.

chatGPT gave a bunch of ideas to get my script output into the Output tab of VS Code for SSH - Remote -- none worked.

Steps To Reproduce

here's my steps to reproduce:
0. macOS 14 Sonoma local connecting to Amazon Linux 2023 remote. proxy command is used to establish connection to EC2 via AWS Se

  1. write a script to use AWS SSM for connecting to and managing EC2 instances for Cloud9
# ~/.ssh/ssm-proxy.ssh
echo "Checking status of instance, system, and reachability..." >&2
INSTANCE_STATUS=$(aws ec2 describe-instance-status --instance-ids ${HOST} --query 'InstanceStatuses[0].InstanceStatus.Status' --output text --region ${AWS_REGION} 2>/dev/null)
SYSTEM_STATUS=$(aws ec2 describe-instance-status --instance-ids ${HOST} --query 'InstanceStatuses[0].SystemStatus.Status' --output text --region ${AWS_REGION} 2>/dev/null)
REACHABILITY_STATUS=$(aws ec2 describe-instance-status --instance-ids ${HOST} --query 'InstanceStatuses[0].InstanceStatus.Details[?Name==`reachability`].Status' --output text --region ${AWS_REGION} 2>/dev/null)

echo "Instance Status: $INSTANCE_STATUS" >&2
echo "System Status: $SYSTEM_STATUS" >&2
echo "Reachability Status: $REACHABILITY_STATUS" >&2

...

note: regardless of whether i use stdout or redirect to stderr, these print statements dont appear in SSH - Remote output tab

  1. i define my ProxyCommand section of file ~/.ssh/config for the host i want to connect to
Host cloud9-dev-us-east-1
  HostName <EC2 Instance ID>
  User ec2-user
  IdentityFile ~/.ssh/ed25519
  ProxyCommand "/bin/bash" -c "~/.ssh/ssm-proxy.sh %h %p dev us-east-1"
  1. i connect to host and see long (30s) periods of no output followed by either successful connection or a timeout
Anything else?

please let me know if i am missing something obvious, or if there's an easier way. in the meantime, i will simply tee the logs and keep those logs open separately in a vs code editor whenever i am away from home on unstable internet.

thank you

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the connection using ~/.ssh/ssm-proxy.sh and the ProxyCommand entry in ~/.ssh/config, then trace how the Remote-SSH extension captures and displays the command's output in the SSH - Remote output tab. Done means stdout and stderr from the ProxyCommand are visible while a connection is pending or fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, shell, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.