code-server icon indicating copy to clipboard operation
code-server copied to clipboard

[Bug]: Terminal closes immediately after opening it since v4.16.1

Open Rucadi opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

OS/Web Information

  • Web Browser: X
  • Local OS:
  • Remote OS: Centos7 & Ubuntu
  • Remote Architecture: x86-64
  • code-server --version: anything > 4.16.1

Steps to Reproduce

  1. open code-server on the web
  2. Open a folder
  3. Open a folder again in a new tab seems to help
  4. Begin using the terminals, run processses etc...
  5. Suddently, when you try to open a terminal, it'll automatically close. For some reason, trying to open 20 terminals or so at the same time makes it so 2-3 survive.
  6. killing code-server and opening it again restores functionality

The error that most probably is the culprit: Error [CodeExpectedError]: Could not find pty on pty host

It also occurs with openvscode-server, and I have the same issue with different computes and people, That's the reason I keep using the older v4.16.1 which does not have this issue.

Expected

The terminal opens.

Actual

The terminal is killed

Logs

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

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • [ ] I tested this in native VS Code.
  • [ ] This does not happen in native VS Code.
  • [ ] I tested this in GitHub Codespaces.
  • [ ] This does not happen in GitHub Codespaces.

Are you accessing code-server over a secure context?

  • [ ] I am using a secure context.

Notes

No response

Rucadi avatar Feb 22 '24 14:02 Rucadi

In 4.17.0 the minimum glibc version was raised and code-server no longer works in CentOS 7, so that could be why. If you check code-server's logs you might see something about glibc.

code-asher avatar Feb 26 '24 21:02 code-asher

Although, you say it does work if you open enough or restart code-server so that must not be it. I am not sure, in that case. Do you have some way for me to reproduce? A Dockerfile maybe? If not, check code-server's output and see if anything shows up there.

code-asher avatar Feb 26 '24 21:02 code-asher

Although, you say it does work if you open enough or restart code-server so that must not be it. I am not sure, in that case. Do you have some way for me to reproduce? A Dockerfile maybe? If not, check code-server's output and see if anything shows up there.

The glibc problem was already taken care of by compiling node + some dependencies and no errors related to that are present.

I was wondering if node-pty had a regression, since the error log more plausible is the one I put on the first message... I'll try to create a minimum example

Rucadi avatar Feb 26 '24 22:02 Rucadi

Closing as stale but feel free to comment if you come up with a reproduction.

code-asher avatar Jul 12 '24 00:07 code-asher

The issue is not fully resolved. Previously, the terminal would crash on the 5th or 6th instance of the same session. Now, it doesn't seem to crash at all during the first session, regardless of the number of instances. However, it crashes when starting a new (second) session after closing all instances of the first session. image

Error: Aug 02 07:38:25 a b: [07:38:25] Error [CodeExpectedError]: Could not find pty on pty host Aug 02 07:38:25 a b: at D.U (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:45:32461) Aug 02 07:38:25 a b: at D.updateIcon (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:45:27673) Aug 02 07:38:25 a b: at j. (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:45:22865) Aug 02 07:38:25 a b: at Object.call (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:35:5137) Aug 02 07:38:25 a b: at l.s (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:33:5144) Aug 02 07:38:25 a b: at l.q (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:33:4646) Aug 02 07:38:25 a b: at n.value (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:33:4044) Aug 02 07:38:25 a b: at t.y (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:29:666) Aug 02 07:38:25 a b: at t.fire (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:29:883) Aug 02 07:38:25 a b: at process.ue (../code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:25:25717)

nikhilstcorp avatar Aug 02 '24 07:08 nikhilstcorp

Is this on 4.91.1? I experimented by opening six instances (using the +), closing them all (using the trash icon), then opening a new one (using Terminal > New Terminal) but it seems to work.

code-asher avatar Aug 02 '24 19:08 code-asher

This was on the version:

code-server: v4.23.1, Code: 1.88.1

I installed it using conda from the conda-forge channel.

nikhilstcorp avatar Aug 05 '24 08:08 nikhilstcorp

Interesting, possibly this was fixed upstream then. Let me know if it still happens for you with 4.91.1.

code-asher avatar Aug 06 '24 17:08 code-asher