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

Persistent error : Could not find pty on pty host #210792

Open
TonyGravagno opened this issue Apr 19, 2024 · 2 comments
Open

Persistent error : Could not find pty on pty host #210792

TonyGravagno opened this issue Apr 19, 2024 · 2 comments
Assignees
Labels
confirmation-pending remote Remote system operations issues terminal Integrated terminal issues
Milestone

Comments

@TonyGravagno
Copy link

TonyGravagno commented Apr 19, 2024

VSCode over Windows 10, with Remote SSH extension to a remote Ubuntu v20. I've been running this configuration for many months. Remote extensions are acting a bit wonky. I can't tell if this is a recent issue, after an update, or within the last couple months. I'm just trying now to get extensions to work while installed remotely, and they are not, so I'm investigating causes.

While trying to diagnose that I found that on the every initial SSH connection that the Output : Window reports:

[error] Could not find pty on pty host: CodeExpectedError: Could not find pty on pty host

Detail from Output : Window
2024-04-19 13:03:03.059 [info] [LocalProcess0][resolveAuthority(ssh-remote,1)][26305ms] waiting...
2024-04-19 13:03:04.066 [info] [LocalProcess0][resolveAuthority(ssh-remote,1)][27313ms] waiting...
2024-04-19 13:03:05.004 [info] [LocalProcess0][resolveAuthority(ssh-remote,1)][28250ms] returned Managed(1)
2024-04-19 13:03:05.004 [info] resolveAuthority(ssh-remote) returned 'Managed(1)' after 28252 ms
2024-04-19 13:03:05.030 [info] Creating a socket (renderer-Management-855038fc-c9f5-4b79-a305-73937542dd9a)...
2024-04-19 13:03:05.031 [info] Creating a socket (renderer-ExtensionHost-a739e94d-7d7f-402e-89d0-a31fdb2f8598)...
2024-04-19 13:03:05.197 [info] Creating a socket (renderer-ExtensionHost-a739e94d-7d7f-402e-89d0-a31fdb2f8598) was successful after 169 ms.
2024-04-19 13:03:05.199 [info] Creating a socket (renderer-Management-855038fc-c9f5-4b79-a305-73937542dd9a) was successful after 172 ms.
2024-04-19 13:03:07.121 [info] [perf] Render performance baseline is 32ms
2024-04-19 13:03:07.681 [error] Could not find pty on pty host: CodeExpectedError: Could not find pty on pty host
    at D.U (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:47:32471)
    at D.updateTitle (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:47:27632)
    at j.<computed> (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:47:22875)
    at Object.call (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:36:5137)
    at l.s (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:34:5145)
    at l.q (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:34:4647)
    at n.value (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:34:4045)
    at t.y (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:29:665)
    at t.fire (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:29:882)
    at process.ue (/home/ubuntu/.vscode-server/cli/servers/Stable-e170252f762678dec6ca2cc69aba1570769a5d39/server/out/vs/platform/terminal/node/ptyHostMain.js:25:10030)
    at process.emit (node:events:517:28)
    at emit (node:internal/child_process:944:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
2024-04-19 13:03:32.240 [info] Extension host (Remote) is unresponsive.
2024-04-19 13:03:35.973 [info] Extension host (Remote) is responsive.

I believe this is the correct stack leading to that : ptyHostMain > ptyService > throw

I have been running the Release version of the Remote SSH extension but loaded the Pre-Release today to see if the issue was fixed. Nope.

It may or may not be related but I'm also struggling with SSH connection drops. The session will be fine for a long time, until "something changes" and then it goes into a reconnect state and cannot reconnect. I need to restart the connection. This also happens with no other extensions. I have other SSH sessions open to the same server:port/user and there are no drops. To my knowledge, only VSCode is experiencing issues.

The issues with extensions may or may not be related. My focus right now is only on this error from ptyHostMain. When this is resolved I'll move up the chain for the other challenges.

I do not see related issues noted in server logs but will activate and check debug logs if details are provided here.

The .vscode-server folder has been deleted and recreated many times. After closing the client-side app I've terminated the server pids.

Used/Max Ptys = 1/4096

Other settings from VSCode:

// user
  "remote.SSH.connectTimeout": 120,
  "remote.SSH.enableRemoteCommand": true,
  "remote.SSH.enableX11Forwarding": false,
  "remote.SSH.localServerDownload": "auto",
  "remote.SSH.logLevel": "debug",
  "remote.SSH.showLoginTerminal": true,
// app
  "remote.SSH.useLocalServer": false, // was true, no difference
  "remote.SSH.connectTimeout": 120
# vscode_remote.config
  PreferredAuthentications publickey
  ServerAliveInterval 60
  ServerAliveCountMax 10

I researched this issue in Issues here, in StackOverflow, and with other googling, but found nothing close to this previously reported.

Dunno what else I can add. I have full access to client and server and will be eager to provide info, and load and test patches.

Thanks.

(I tried to post this from in-app Issue Reporter and the "Create on GitHub" button wasn't responsive. ( #134530 )

System Info

Version: 1.88.1 (system setup)
Commit: e170252 ( client and server agree )
Date: 2024-04-10T17:41:02.734Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2 (default server version is v20 but I believe VSC uses 18)
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.19045

CPUs Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz (16 x 2304)
GPU Status 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled
Load (avg)  
Memory (System) 31.82GB (15.59GB free)
Process Argv --crash-reporter-id 3555131d-7d56-4887-a807-ceafc2556f0b
Screen Reader no
VM 0%
Extension Author (truncated) Version
remote-ssh ms- 0.111.2024040515
remote-ssh-edit ms- 0.86.0
remote-explorer ms- 0.4.3
@bpasero bpasero assigned Tyriar and unassigned bpasero Apr 20, 2024
@Tyriar Tyriar added terminal Integrated terminal issues remote Remote system operations issues confirmation-pending labels Apr 22, 2024
@Tyriar Tyriar added this to the Backlog milestone Apr 22, 2024
@torext
Copy link

torext commented May 3, 2024

Having the same continuous CodeExpectedError: Could not find pty on pty hosterror in my Remote - SSH console output. Running VSCode 1.89.0 and Remote - SSH extension v0.110.1.

What usually happens is that after successfully connecting via SSH, when I open the extension explorer it will show Activating extensions... in the status bar and then the above error usually shows up in the log and the connection dies and it reconnects. If I don't touch the extension explorer or open a folder/file that uses extensions (e.g. Python, Git...etc.) then the connection stays fine; as soon as extensions get involved somehow all hell breaks loose.

EDIT: I also noticed that running Terminal: Kill All Terminals causes the reconnection to happen. I tend to hit that command frequently in order not to have stale terminals around, but it definitely didn't use to cause the disconnects with previous versions of VSCode.

@wzh4464
Copy link

wzh4464 commented May 16, 2024

I encounter the problem that when using remote ssh, no second terminal can be opened. When I check the log in the remote server, it also shows me "Could not find pty on pty host"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmation-pending remote Remote system operations issues terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

6 participants