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

[Remote-SSH Bug]: code command not found #10039

Closed
3 tasks done
tim-lucera opened this issue Jul 8, 2024 · 3 comments
Closed
3 tasks done

[Remote-SSH Bug]: code command not found #10039

tim-lucera opened this issue Jul 8, 2024 · 3 comments
Assignees
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@tim-lucera
Copy link

tim-lucera commented Jul 8, 2024

Is there an existing issue for this bug?

  • I have searched the existing issues

Required Troubleshooting Steps

  • I have followed these troubleshooting steps
  • I have tried both values of the remote.SSH.useLocalServer setting

Connect Locally

It connects successfully

->

No response

Expected Behavior

connect to remote
open terminal
code my.file
Expected:
my.file opens in vscode
Actual:

user@server> code my.file
bash: code: command not found
user@server> 

It seems that the ~/.vscode-server/bin has not been created

user@server> ls -1 ~/.vscode-server/
cli
code-ea1445cc7016315d0f5728f8e8b12a45dc0a7286
data
extensions
user@server> 

Steps To Reproduce

uninstalled vscode-server on remote
connect to remote
(it installs new server)
try the steps in "expected behaviour"

Remote-SSH Log

Remote-SSH Log

[11:13:45.875] Log Level: 2
[11:13:45.902] SSH Resolver called for "ssh-remote+lab04", attempt 1
[11:13:45.903] "remote.SSH.useLocalServer": false
[11:13:45.903] "remote.SSH.useExecServer": true
[11:13:45.904] "remote.SSH.showLoginTerminal": false
[11:13:45.904] "remote.SSH.remotePlatform": {"172.23.97.3":"linux","lab04":"linux","lab02":"linux","lab03":"linux","lab01":"linux"}
[11:13:45.904] "remote.SSH.path": undefined
[11:13:45.904] "remote.SSH.configFile": undefined
[11:13:45.904] "remote.SSH.useFlock": true
[11:13:45.904] "remote.SSH.lockfilesInTmp": false
[11:13:45.904] "remote.SSH.localServerDownload": auto
[11:13:45.904] "remote.SSH.remoteServerListenOnSocket": false
[11:13:45.904] "remote.SSH.showLoginTerminal": false
[11:13:45.904] "remote.SSH.defaultExtensions": []
[11:13:45.904] "remote.SSH.loglevel": 2
[11:13:45.904] "remote.SSH.enableDynamicForwarding": true
[11:13:45.905] "remote.SSH.enableRemoteCommand": false
[11:13:45.905] "remote.SSH.serverPickPortsFromRange": {}
[11:13:45.905] "remote.SSH.serverInstallPath": {}
[11:13:45.909] VS Code version: 1.91.0
[11:13:45.909] Remote-SSH version: [email protected]
[11:13:45.909] win32 x64
[11:13:45.916] SSH Resolver called for host: lab04
[11:13:45.917] Setting up SSH remote "lab04"
[11:13:45.921] Using commit id "ea1445cc7016315d0f5728f8e8b12a45dc0a7286" and quality "stable" for server
[11:13:45.925] Install and start server if needed
[11:13:45.928] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe -V"
[11:13:45.932] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe ENOENT
[11:13:45.932] Checking ssh with "C:\WINDOWS\system32\ssh.exe -V"
[11:13:45.934] Got error from ssh: spawn C:\WINDOWS\system32\ssh.exe ENOENT
[11:13:45.934] Checking ssh with "C:\WINDOWS\ssh.exe -V"
[11:13:45.935] Got error from ssh: spawn C:\WINDOWS\ssh.exe ENOENT
[11:13:45.936] Checking ssh with "C:\WINDOWS\System32\Wbem\ssh.exe -V"
[11:13:45.937] Got error from ssh: spawn C:\WINDOWS\System32\Wbem\ssh.exe ENOENT
[11:13:45.937] Checking ssh with "C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[11:13:45.938] Got error from ssh: spawn C:\WINDOWS\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[11:13:45.938] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[11:13:45.973] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2

[11:13:45.978] Running script with connection command: "C:\WINDOWS\System32\OpenSSH\ssh.exe" -T -D 54087 lab04 bash
[11:13:45.980] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[11:13:46.292] > �]0;C:\WINDOWS\System32\cmd.exe�
[11:13:46.292] Got some output, clearing connection timeout
[11:13:48.160] > 09d6a1c980ac: running
[11:13:48.191] > Installing to /home/tmason/.vscode-server...
> 09d6a1c980ac%%1%%
> Downloading with wget
[11:13:48.674] > Download complete
[11:13:48.707] > 09d6a1c980ac%%2%%
> tar --version:
> tar (GNU tar) 1.26
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by John Gilmore and Jay Fenlason.
[11:13:48.893] > code 1.91.0 (commit ea1445cc7016315d0f5728f8e8b12a45dc0a7286)
> Starting VS Code CLI... "/home/tmason/.vscode-server/code-ea1445cc7016315d0f5728
> f8e8b12a45dc0a7286" command-shell --cli-data-dir "/home/tmason/.vscode-server/cl
> i" --on-port --on-host=127.0.0.1 --parent-process-id 6573 &> "/home/tmason/.vsco
> de-server/.cli.ea1445cc7016315d0f5728f8e8b12a45dc0a7286.log" < /dev/null        
> printenv:
>     XDG_SESSION_ID=2139
>     SHELL=/bin/bash
>     SSH_CLIENT=148.106.20.1 44014 22
>     USER=tmason
>     SFX_INSTALL_PATH=/home/tmason/lumefx
>     ASAN_OPTIONS=detect_odr_violation=0
>     VSCODE_AGENT_FOLDER=/home/tmason/.vscode-server
>     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/dell/srvadmin/sb
> in:/opt/dell/srvadmin/sbin
>     MAIL=/var/mail/tmason
[11:13:48.911] > 
>     PWD=/home/tmason
>     LANG=en_US.UTF-8
>     CMAKE_EXPORT_COMPILE_COMMANDS=1
>     HOME=/home/tmason
>     SHLVL=2
>     LOGNAME=tmason
>     SSH_CONNECTION=148.106.20.1 44014 172.23.97.4 22
>     LESSOPEN=||/usr/bin/lesspipe.sh %s
>     XDG_RUNTIME_DIR=/run/user/1077
>     HISTTIMEFORMAT=%h/%d - %H:%M:%S
>     _=/usr/bin/printenv
>     OLDPWD=/home/tmason/.vscode-server
> Spawned remote CLI: 6666
[11:13:48.928] > 
> Waiting for server log...
[11:13:48.957] > 09d6a1c980ac: start
> listeningOn==127.0.0.1:46084==
> osReleaseId==centos==
> arch==x86_64==
> vscodeArch==x64==
[11:13:48.999] > 
[11:13:49.023] > bitness==64==
> tmpDir==/run/user/1077==
> platform==linux==
> unpackResult==success==
> didLocalDownload==0==
> downloadTime==503==
> installTime==208==
> serverStartTime==57==
> execServerToken==1a1aa1a1-a11a-1a11-aaa1-1aa1a11111a1==
> 09d6a1c980ac: end
[11:13:49.023] Received install output: 
listeningOn==127.0.0.1:46084==
osReleaseId==centos==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/1077==
platform==linux==
unpackResult==success==
didLocalDownload==0==
downloadTime==503==
installTime==208==
serverStartTime==57==
execServerToken==1a1aa1a1-a11a-1a11-aaa1-1aa1a11111a1==

[11:13:49.024] Remote server is listening on port 46084
[11:13:49.024] Parsed server configuration: {"serverConfiguration":{"remoteListeningOn":{"port":46084},"osReleaseId":"centos","arch":"x86_64","tmpDir":"/run/user/1077","platform":"linux","execServerToken":"1a1aa1a1-a11a-1a11-aaa1-1aa1a11111a1"},"downloadTime":503,"installTime":208,"serverStartTime":57,"installUnpackCode":"success"}
[11:13:49.028] Starting forwarding server. local port 54093 -> socksPort 54087 -> remotePort 46084
[11:13:49.029] Forwarding server listening on port 54093
[11:13:49.029] Waiting for ssh tunnel to be ready
[11:13:49.031] Tunneled port 46084 to local port 54093
[11:13:49.031] Resolved "ssh-remote+lab04" to "port 54093"
[11:13:49.040] Initizing new exec server for ssh-remote+lab04
[11:13:49.040] Resolving exec server at port 54093
[11:13:49.060] [Forwarding server port 54093] Got connection 0
[11:13:49.062] [Forwarding server port 54093] Got connection 1
[11:13:49.405] Exec server for ssh-remote+lab04 created and cached
[11:13:49.412] ------




[11:13:49.536] [server] Checking /home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/log.txt and /home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/pid.txt for a running server...
[11:13:49.667] [server] Installing and setting up Visual Studio Code Server...
[11:13:50.003] [server] Downloading Visual Studio Code server -> /tmp/.tmplBhqxb/vscode-server-linux-legacy-x64.tar.gz
[11:13:50.003] [server] server download progress: 0/57758475 (0%)
[11:13:50.023] [server] server download progress: 2105344/57758475 (4%)
[11:13:50.040] [server] server download progress: 4210687/57758475 (7%)
[11:13:50.059] [server] server download progress: 6316031/57758475 (11%)
[11:13:50.079] [server] server download progress: 8421374/57758475 (15%)
[11:13:50.098] [server] server download progress: 10526718/57758475 (18%)
[11:13:50.115] [server] server download progress: 12632061/57758475 (22%)
[11:13:50.137] [server] server download progress: 14737405/57758475 (26%)
[11:13:50.162] [server] server download progress: 16842748/57758475 (29%)
[11:13:50.182] [server] server download progress: 18948092/57758475 (33%)
[11:13:50.200] [server] server download progress: 21053435/57758475 (36%)
[11:13:50.220] [server] server download progress: 23158779/57758475 (40%)
[11:13:50.239] [server] server download progress: 25264122/57758475 (44%)
[11:13:50.256] [server] server download progress: 27369466/57758475 (47%)
[11:13:50.274] [server] server download progress: 29474809/57758475 (51%)
[11:13:50.293] [server] server download progress: 31580153/57758475 (55%)
[11:13:50.312] [server] server download progress: 33685496/57758475 (58%)
[11:13:50.504] [server] server download progress: 35790840/57758475 (62%)
[11:13:50.504] [server] server download progress: 37896183/57758475 (66%)
[11:13:50.505] [server] server download progress: 40001527/57758475 (69%)
[11:13:50.505] [server] server download progress: 42106870/57758475 (73%)
[11:13:50.505] [server] server download progress: 44212214/57758475 (77%)
[11:13:50.506] [server] server download progress: 46317557/57758475 (80%)
[11:13:50.506] [server] server download progress: 48422901/57758475 (84%)
[11:13:50.506] [server] server download progress: 50528244/57758475 (87%)
[11:13:50.507] [server] server download progress: 52633588/57758475 (91%)
[11:13:50.515] [server] server download progress: 54738931/57758475 (95%)
[11:13:50.529] [server] server download progress: 56844275/57758475 (98%)
[11:13:50.537] [server] server download progress: 57758475/57758475 (100%)
[11:13:51.286] [server] server inflate progress: 86/1707 (5%)
[11:13:51.303] [server] server inflate progress: 173/1707 (10%)
[11:13:51.321] [server] server inflate progress: 260/1707 (15%)
[11:13:51.341] [server] server inflate progress: 347/1707 (20%)
[11:13:51.359] [server] server inflate progress: 434/1707 (25%)
[11:13:51.382] [server] server inflate progress: 521/1707 (31%)
[11:13:51.401] [server] server inflate progress: 608/1707 (36%)
[11:13:51.453] [server] server inflate progress: 695/1707 (41%)
[11:13:51.983] [server] server inflate progress: 782/1707 (46%)
[11:13:51.992] [server] server inflate progress: 869/1707 (51%)
[11:13:51.995] [server] server inflate progress: 956/1707 (56%)
[11:13:52.000] [server] server inflate progress: 1043/1707 (61%)
[11:13:52.005] [server] server inflate progress: 1130/1707 (66%)
[11:13:52.120] [server] server inflate progress: 1217/1707 (71%)
[11:13:52.159] [server] server inflate progress: 1304/1707 (76%)
[11:13:52.173] [server] server inflate progress: 1391/1707 (81%)
[11:13:52.178] [server] server inflate progress: 1478/1707 (87%)
[11:13:52.188] [server] server inflate progress: 1565/1707 (92%)
[11:13:52.192] [server] server inflate progress: 1652/1707 (97%)
[11:13:52.198] [server] server inflate progress: 1707/1707 (100%)
[11:13:52.419] [server] Server integrity verified, version: 1.91.0 / ea1445cc7016315d0f5728f8e8b12a45dc0a7286 / x64 / 
[11:13:52.432] [server] Server setup complete
[11:13:52.433] [server] Starting server...
[11:13:52.433] [server] Starting server with command... Command { std: "/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/bin/code-server" "--connection-token=remotessh" "--accept-server-license-terms" "--start-server" "--enable-remote-auto-shutdown" "--socket-path=/tmp/code-a6323744-f0cd-4623-a901-7b42579cba08", kill_on_drop: false }
[11:13:52.481] [server] *
[11:13:52.483] [server] * Visual Studio Code Server
[11:13:52.484] [server] *
[11:13:52.484] [server] * By using the software, you agree to
[11:13:52.485] [server] * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-license) and
[11:13:52.485] [server] * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacystatement).
[11:13:52.486] [server] *
[11:13:52.486] [server] Server bound to /tmp/code-a6323744-f0cd-4623-a901-7b42579cba08
[11:13:52.486] [server] Extension host agent listening on /tmp/code-a6323744-f0cd-4623-a901-7b42579cba08
[11:13:52.541] [server] parsed location: "/tmp/code-a6323744-f0cd-4623-a901-7b42579cba08"
[11:13:52.541] [server] 
[11:13:52.541] [server] Server started
[11:13:52.659] [server] [06:13:52] 
[11:13:52.659] [server] 
[11:13:52.660] [server] 
[11:13:52.660] [server] 
[11:13:52.715] [server] [06:13:52] Extension host agent started.
[11:13:52.769] [server] [06:13:52] Started initializing default profile extensions in extensions installation folder. file:///home/tmason/.vscode-server/extensions
[11:13:52.781] [server] [06:13:52] Completed initializing default profile extensions in extensions installation folder. file:///home/tmason/.vscode-server/extensions
[11:13:52.972] [server] [06:13:52] [<unknown>][c1e89ce1][ExtensionHostConnection] New connection established.
[11:13:52.974] [server] [06:13:52] [<unknown>][05781beb][ManagementConnection] New connection established.
[11:13:53.040] [server] [06:13:52] [<unknown>][c1e89ce1][ExtensionHostConnection] <6907> Launched Extension Host Process.
[11:13:55.600] Opening exec server for ssh-remote+lab04
[11:13:57.210] Verified and reusing cached exec server for ssh-remote+lab04
[11:13:59.188] [server] rejected promise not handled within 1 second: CodeExpectedError: Could not find pty on pty host
[11:13:59.188] [server] stack trace: CodeExpectedError: Could not find pty on pty host
[11:13:59.188] [server]     at A.U (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:56:30817)
[11:13:59.188] [server]     at A.attachToProcess (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:56:25830)
[11:13:59.188] [server]     at D.<computed> (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:56:21292)
[11:13:59.188] [server]     at Object.call (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:37:5367)
[11:13:59.189] [server]     at c.s (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:35:5506)
[11:13:59.189] [server]     at c.q (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:35:4947)
[11:13:59.189] [server]     at b.value (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:35:4247)
[11:13:59.189] [server]     at n.B (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:30:741)
[11:13:59.189] [server]     at n.fire (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:30:958)
[11:13:59.190] [server]     at process.$e (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:25:11142)
[11:13:59.190] [server]     at process.emit (node:events:518:28)
[11:13:59.190] [server]     at emit (node:internal/child_process:951:14)
[11:13:59.190] [server]     at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
[11:13:59.191] [server] [06:13:59] Error [CodeExpectedError]: Could not find pty on pty host
[11:13:59.191] [server]     at A.U (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:56:30817)
[11:13:59.191] [server]     at A.attachToProcess (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:56:25830)
[11:13:59.191] [server]     at D.<computed> (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:56:21292)
[11:13:59.191] [server]     at Object.call (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:37:5367)
[11:13:59.191] [server]     at c.s (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:35:5506)
[11:13:59.191] [server]     at c.q (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:35:4947)
[11:13:59.192] [server]     at b.value (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:35:4247)
[11:13:59.192] [server]     at n.B (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:30:741)
[11:13:59.192] [server]     at n.fire (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:30:958)
[11:13:59.192] [server]     at process.$e (/home/tmason/.vscode-server/cli/servers/Stable-ea1445cc7016315d0f5728f8e8b12a45dc0a7286/server/out/vs/platform/terminal/node/ptyHostMain.js:25:11142)
[11:13:59.192] [server]     at process.emit (node:events:518:28)
[11:13:59.193] [server]     at emit (node:internal/child_process:951:14)
[11:13:59.193] [server]     at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Anything else?

This is an error in the remote-ssh log, maybe this is related

[11:13:59.191] [server] [06:13:59] Error [CodeExpectedError]: Could not find pty on pty host
@tim-lucera tim-lucera added the ssh Issue in vscode-remote SSH label Jul 8, 2024
@tim-lucera
Copy link
Author

Hi, some more info about this: I am using vscode-remote on 3 machines, all with same (old) OS

CentOS Linux release 7.7.1908 (Core)

On 2 of the machines I can run code command OK. But on the third machine, code command does not work

On the 2 machines where it works OK, I see that it is running an old versison (1.87.2)

> code --version
1.87.2
863d2581ecda6849923a2118d93a088b0745d9d6
x64
> 

So I think this is not a new problem with 1.91, it seems like something has been broken since the release following 1.87.2

The two machine where it works OK, they are still using the old version
On the machine where it doesn't work, I removed entire ~/.vscode-server folder (due to an unrelated issue), and now it cannot install ~/.vscode-server/bin

@roblourens
Copy link
Member

Does disabling remote.SSH.useExecServer help?

@roblourens roblourens added the info-needed Issue requires more information from poster label Jul 26, 2024
@tim-lucera
Copy link
Author

Yes, that fixed the issue.
Thanks!

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

2 participants