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

[Bug]: Terminal not working #5218

Closed
3 tasks done
filipton opened this issue May 22, 2022 · 36 comments
Closed
3 tasks done

[Bug]: Terminal not working #5218

filipton opened this issue May 22, 2022 · 36 comments
Labels
waiting-for-info Waiting for more information from submitter

Comments

@filipton
Copy link

filipton commented May 22, 2022

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: Arch Linux
  • Remote OS: Ubuntu
  • Remote Architecture: aarch64
  • code-server --version: 4.4.0

Steps to Reproduce

  1. open code-server
  2. open new termina

Expected

Terminal window should open.

Actual

Terminal window is blank.

Logs

[IPC Library: Pty Host] WARN Shell integration cannot be enabled for executable "/usr/bin/bash" and args undefined

...

[22:22:15] Terminal process launching on remote agent {
shellLaunchConfig: {
name: undefined,
executable: '/usr/bin/bash',
args: undefined,
cwd: '/root/sandbox/StatusPage',
env: undefined,
useShellEnvironment: true
},

Screenshot/Video

image

Does this issue happen in VS Code?

  • I cannot reproduce this in VS Code.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

I tried to reinstall code-server, and even I ran the docker version from linuxservers with the same results. It's weird because 2 days ago it was working, and I didn't update anything on that server.

@filipton filipton added bug Something isn't working triage This issue needs to be triaged by a maintainer labels May 22, 2022
@filipton filipton changed the title [Bug]: Terminal not work [Bug]: Terminal not working May 22, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented May 23, 2022

Do you have bash installed?

I've seen this happen when I don't have zsh installed. You can also change the default shell in the VS Code Settings UI. I would try that.

@jsjoeio jsjoeio added waiting-for-info Waiting for more information from submitter and removed bug Something isn't working triage This issue needs to be triaged by a maintainer labels May 23, 2022
@exosiscrypto
Copy link

I confirm this issue, after updating to 4.4.0 terminal is not working

@filipton
Copy link
Author

Do you have bash installed?

I've seen this happen when I don't have zsh installed. You can also change the default shell in the VS Code Settings UI. I would try that.

It was working before update, but yup i have bash installed.

@jsjoeio
Copy link
Contributor

jsjoeio commented May 31, 2022

Can you share the logs for the browser and the server? I'm not sure what could be going on here.

@9SMTM6
Copy link

9SMTM6 commented May 31, 2022

I'm getting a similar error, but not anymore when using chrominum.

Server: raspberry pi 4, Manjaro-ARM, code-server AUR package (yeah i know manjaro and AUR).

Client: Fedora 35, normal amd64 chipset, Firefox 100.0.2 vs Chrominum Version 100.0.4896.127 (Official Build) Fedora Project (64-bit)
systemctl status

Mai 31 22:20:56 theEolian code-server[432]: rejected promise not handled within 1 second: TypeError: Cannot read properties of undefined (reading 'windowsEnableConpty')
Mai 31 22:20:56 theEolian code-server[432]: stack trace: TypeError: Cannot read properties of undefined (reading 'windowsEnableConpty'),    at new Ae (/usr/lib/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:17:1069>
Mai 31 22:20:56 theEolian code-server[432]: [22:20:56] [Error [TypeError]: Cannot read properties of undefined (reading 'windowsEnableConpty'),    at new Ae (/usr/lib/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js:>
Mai 31 22:21:00 theEolian code-server[432]: [22:21:00] No ptyHost response to createProcess after 5 seconds

Browser log (a lot of other errors that dont directly seem related excluded, of course firefox only):

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'windowsEnableConpty')
ipc.ts:558:40
    Ri tabsTitleControl.ts:1946
    (Async: promise callback)
    Ri tabsTitleControl.ts:1946
    _createInstance menu.ts:1389
    createInstance menu.ts:1389
    createInstance extensionsWidgets.ts:559
    createInstance self-hosted:1124
    addInstance tabsTitleControl.ts:1946
    n tabsTitleControl.ts:1946
    _createInstance menu.ts:1389
    createInstance menu.ts:1389
    createGroup tabsTitleControl.ts:1946
    createGroup self-hosted:1124
    _createTerminal extensionsWidgets.ts:559
    createTerminal extensionsWidgets.ts:559
    AsyncFunctionNext self-hosted:635
    (Async: async)
    initializeTerminals extensionsWidgets.ts:559
    AsyncFunctionNext self-hosted:635
    (Async: async)
    initializeTerminals self-hosted:1124
    renderBody tabsTitleControl.ts:2013
    fire event.ts:727
    setVisible mainThreadDebugService.ts:297
    setVisible testingExplorerFilter.ts:54
    map self-hosted:180
    setVisible testingExplorerFilter.ts:44
    setVisible testingExplorerView.ts:1005
    showComposite mainThreadDebugService.ts:297
    doOpenComposite mainThreadDebugService.ts:297
    openComposite mainThreadDebugService.ts:297
    doOpenPanel workbench.web.main.js:2612
    openPaneComposite workbench.web.main.js:2612
    openPaneComposite preferencesService.ts:50
    setPanelHidden preferencesService.ts:50
    createWorkbenchLayout editorService.ts:991
    fire event.ts:727
    setVisible viewportSemanticTokens.ts:135
    setVisible gridview.ts:899
    setVisible splitview.ts:235
    resize splitview.ts:1141
    onSashChange splitview.ts:856
    fire event.ts:733
    i event.ts:40
    fire event.ts:727
    O sash.ts:549
    fire event.ts:727
    b canIUse.ts:45
    (Async: EventListener.handleEvent)
    onFirstListenerAdd canIUse.ts:45
    get event/this._event event.ts:653

The connection to the terminal's pty host process is unresponsive, the terminals may stop working. workbench.web.main.js:789:179061
    onDidChangeNotification workbench.web.main.js:789
    registerListeners workbench.web.main.js:789
    fire event.ts:727
    addNotification wordHighlighter.ts:508
    notify workbench.web.main.js:1598
    prompt workbench.web.main.js:1598
    y webviewPreloads.ts:2227
    fire event.ts:727
    fire event.ts:733
    K ipc.ts:633
    onResponse ipc.ts:716
    onBuffer ipc.ts:697
    protocolListener ipc.ts:509
    fire event.ts:727
    fire ipc.net.ts:641
    _receiveMessage ipc.net.ts:961
    p ipc.net.ts:831
    fire event.ts:727
    acceptChunk ipc.net.ts:382
    o ipc.net.ts:339
    onData editorOptions.ts:4146
    fire event.ts:727
    onload editorOptions.ts:4041
    (Async: EventHandlerNonNull)
    E editorOptions.ts:4036
    create editorOptions.ts:4131
    connect editorOptions.ts:4178
    r editorOptions.ts:4214
    l editorOptions.ts:4256
    s editorOptions.ts:4389
    i editorOptions.ts:4401
    h editorOptions.ts:4415
    _createConnection workbench.web.main.js:1731
    _getOrCreateConnection workbench.web.main.js:1731
    getChannel workbench.web.main.js:1731
    withChannel workbench.web.main.js:1731
    _withChannel workbench.web.main.js:1731
    getRawEnvironment workbench.web.main.js:1731
    c workbench.web.main.js:1735
    register workbench.web.main.js:1735
    registerFileSystemProviders auxiliaryBarPart.ts:151
    initServices auxiliaryBarPart.ts:151
    open auxiliaryBarPart.ts:151
    m auxiliaryBarPart.ts:151
    <anonymous> fake:1
    <anonymous> fake:1
    _invokeFactory loader.js:1185
    complete loader.js:1195
    _onModuleComplete loader.js:1821
    _resolve loader.js:1781
    defineModule loader.js:1424
    v loader.js:1871
    <anonymous> fake:8
    <anonymous> fake:1

@ljishen
Copy link

ljishen commented Jun 11, 2022

I have the same issue after updating to 4.4.0. I used the docker image on an arm64 machine.

@Steveorevo
Copy link

Steveorevo commented Jun 12, 2022

New installation 4.4.0, Ubuntu 20.04 on arm64,

"The terminal process failed to launch: A native exception occurred during launch (forkpty(3) failed.)."

[IPC Library: Pty Host] WARN Shell integration cannot be enabled for executable "/bin/bash" and args []

It appears that my issue appears with code-server is run from a chroot/jailkit account. Seems to work fine on a regular user; non-root account on Ubuntu. Wondering if it's a missing dependency issue of something simply not copied over to the jailed account.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 13, 2022

It appears that my issue appears with code-server is run from a chroot/jailkit account. Seems to work fine on a regular user; non-root account on Ubuntu. Wondering if it's a missing dependency issue of something simply not copied over to the jailed account.

@code-asher any ideas?

@Steveorevo
Copy link

I found out that you can mount your /dev and /dev/pts folders to your jailkit account and it works. I.e.

mount -o bind /dev /[your jailkit root]/dev
mount -t devpts devpts /[your jailkit root]/dev/pts

However, this mounts everything in your root /dev to the jailkit and may defeat the purpose of jailkit altogether; to provide isolation. Other forums have indicated that /dev/pts is the only device necessary and doesn't pose a "big risk" as each device has it's own owner/group; but I couldn't get it to work with just that. I'm wondering what else is actually needed and is a dependency? I don't want to give full access to items like /dev/mem (memory) to a jailkit'd user.

@code-asher
Copy link
Member

Does anything in this issue help? microsoft/vscode-remote-release#4233

At first glance seems like /dev/ptmx and /dev/pts should do it.

@bcotton
Copy link

bcotton commented Jun 29, 2022

Can confirm. Running code-server on OSX, with a vanilla docker-code-server, running on Docker locally.

No terminal start, nothing in any of the logs that I could find.

Downgrading to 4.3.0 seems to fix it

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 29, 2022

@bcotton nothing in the browser logs either? I'm on OSX and have 4.4.0 running locally (not in Docker) and the terminal works

@bcotton
Copy link

bcotton commented Jun 29, 2022

@bcotton nothing in the browser logs either?

Nope, I checked the "window" logs. Tailed all logs in the running image, in addition to the output of coder command line.

is there somewhere else to check?

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 30, 2022

If you open up code-server in a browser like Chrome, then View > Developer > Developer Tools and look in the Console tab there might be something helpful

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 30, 2022

in addition to the output of coder command line

wait are you using code-server or coder?

@bcotton
Copy link

bcotton commented Jun 30, 2022

wait are you using code-server or coder?

I'm using coder to start code-server in a docker container.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jun 30, 2022

@bcotton oh! thanks for clarifying. That sounds specific to coder then. Do you mind opening an issue there with steps to reproduce it? Sorry for the confusion!

@lenosi
Copy link

lenosi commented Jul 15, 2022

@jsjoeio I had the same issue today after upgrade code-server from 4.4.0 to 4.5.0 and I don't use 'coder'.

The background steps for the upgrade:

  1. Using code-server 4.40 ssh forward with chrome + safari on client side
  2. Install script upgrade failed on rpm
  3. Manually run rpm -U --replacefiles --replacepkgs ~/.cache/code-server/code-server-4.5.0-amd64.rpm
  4. Restart service

I could open more terminals, but I didn't see the content and titles of the terminals and otherwise exactly as the description/screenshot.

Likewise, I think it was caused by browser some cache or cookies. Because after I returned from a few local errands, the problem magically resolved itself. I had problem on client node with Safari and Chrome, server side RHEL 8.6, logs from the systemd coda-server service are clean, and I can't give you any more information backwards from the browsers, unfortunately.

@consideRatio
Copy link

consideRatio commented Jul 18, 2022

Using code-server 4.5.0, as started directly via code-server, the following occurs when I use ctrl+shift+p and then run the command to create a new terminal.

image

code-server 4.4.0 worked fine without this issue. Note that in case its relevant, using 4.4.0 instead of 4.5.0 also avoided issue #5343 which I also ran into using 4.5.0.

I've installed code-server in a docker image defined here: https://github.com/pangeo-data/jupyter-earth/blob/master/hub.jupytearth.org-image/Dockerfile. It is based on ubuntu:22.04.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 18, 2022

I believe this might be a duplicate of #5321

If someone wants to check, here is the PR which fixed it: #5332

@consideRatio
Copy link

@jsjoeio for me, the base path was not /, so any fix related to that seems to be relevant!

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 18, 2022

I hope we're right then 🤞🏼 Hoping to get 4.5.1 out soon. Sorry for all the trouble!

@consideRatio
Copy link

@jsjoeio do you think the regression about syntax highlighting (#5343) was resolved by #5332 as well? I could not find a clear error message or similar, but only conclude it didn't properly syntax-highlight as before in for example a .py file.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 18, 2022

@consideRatio I would bet so! CI just finished and now i'm testing 4.5.1 (what we'll publish) locally. I'll run it behind Caddy and check syntax highlighting now. Thanks for mentioning it!

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 18, 2022

Everything appears to be working for me!

image

@moqsien
Copy link

moqsien commented Oct 6, 2022

The same bug occurs on FreeBSD.
Maybe due to that the '@parcel/watcher' package does not support FreeBSD.

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 6, 2022

Maybe due to that the '@parcel/watcher' package does not support FreeBSD.

Hmm...any ideas for ways we can fix that? Would it be worth raising upstream?

@filipton
Copy link
Author

filipton commented Oct 6, 2022

My problem was in configuration of flags in chrome, so i think that wasn't code-server bug.

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 6, 2022

That's helpful! Do you remember which flag it was?

@filipton
Copy link
Author

filipton commented Oct 6, 2022

That's helpful! Do you remember which flag it was?

If I remember correctly, something with canvas. I can check that in about 3 hours.

@moqsien
Copy link

moqsien commented Oct 7, 2022

Maybe due to that the '@parcel/watcher' package does not support FreeBSD.

Hmm...any ideas for ways we can fix that? Would it be worth raising upstream?

[IPC Library: File Watcher] Loading "@parcel/watcher" failed [IPC Library: File Watcher] Error: /usr/local/lib/node_modules/@parcel/watcher/build/Release/watcher.node: Undefined symbol "_ZTV17BruteForceBackend" at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at load (/usr/local/lib/node_modules/@parcel/watcher/node_modules/node-gyp-build/index.js:22:10) at Object.<anonymous> (/usr/local/lib/node_modules/@parcel/watcher/index.js:1:42) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at r (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:101) at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1720) at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005) at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302) at Object.errorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10423) at e.triggerErrorback (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11369) at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11075 at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:1737) at e.load (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:3:11005) at a (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10302) at o._loadModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:10432) at o._resolve (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:452) at o.defineModule (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:5:6144) at y (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:6:1825) at h (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2554) at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/files/node/watcher/watcherMain.js:14:21897) at Object.<anonymous> (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/files/node/watcher/watcherMain.js:14:33421) at e._createAndEvalScript (/usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2598) at /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/loader.js:4:2237 at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) [IPC Library: File Watcher] Here are the modules that depend on it: [IPC Library: File Watcher]% [ 'vs/platform/files/node/watcher/parcel/parcelWatcher' ] [11:03:49] [192.168.98.1][1b00a7cd][ExtensionHostConnection] New connection established. [11:03:49] [192.168.98.1][1b00a7cd][ExtensionHostConnection] <894> Launched Extension Host Process. File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/vscode-textmate/release/main.js File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/vscode-oniguruma/release/onig.wasm File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/vscode-oniguruma/release/main.js File not found: /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/xterm/lib/xterm.js

@parcel/watcher

I have no idea how to fix it by now. Maybe raising upstream is viable.
Otherwise, just disable the terminal on FreeBSD, or else it may lead to high CPU usage.

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 7, 2022

@moqsien do you mind opening an issue upstream and linking here?

@rob4226
Copy link

rob4226 commented Oct 23, 2022

I'm having same issue on FreeBSD. Terminal does not work. Some languages, like Python, there is no syntax highlighting but JavaScript is highlighted correctly. The errors from the code-server server on FreeBSD 13.1 and code-server v4.7.1 look like:

[20:42:29] ptyHost was unable to resolve shell environment Error: Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 1, signal null)
...
[20:45:18] [Unknown channel: Channel name 'ptyHost' timed out after 1000ms]
rejected promise not handled within 1 second: Unknown channel: Channel name 'ptyHost' timed out after 1000ms

Also, when installed on FreeBSD via npm, I keep getting missing module errors after starting code-server. I had to keep killing/restarting to install the packages it was asking for until I stopped getting those errors. I ended having to manually install: npm i yazl yauzl @microsoft/1ds-core-js vscode-regexpp xterm-headless vscode-proxy-agent

@jiegec
Copy link

jiegec commented Jan 13, 2023

I got watcher working by installing watchman(!) and using @parcel/watcher from pr parcel-bundler/watcher#128 .

Steps:

  1. Install code-server
  2. Install dependencies: sudo npm i -g yazl yauzl @microsoft/1ds-core-js vscode-regexpp xterm-headless vscode-proxy-agent --unsafe-perm
  3. Link ripgrep: sudo pkg install ripgrep && cd /usr/local/lib/node_modules/@vscode/ripgrep/bin && ln -s /usr/local/bin/rg
  4. Install @parcel/watcher from pr Add FreeBSD support parcel-bundler/watcher#128: cd watcher && npm install && sudo cp build/Release/watcher.node /usr/local/lib/node_modules/@parcel/watcher/build/Release/
  5. Workaround Platform not supported by editing: sudo vim /usr/local/lib/node_modules/code-server/lib/vscode/out/vs/platform/terminal/node/ptyHostMain.js, pretending freebsd as linux
  6. Use workaround in [Bug]: terminal won't open/display - logs attached #5760:
sudo pkg install libsecret pkgconf
cd /usr/local/lib/node_modules/code-server
sudo npm install --unsafe-perm
# go back to @parcel/watcher
cd watcher
sudo cp build/Release/watcher.node /usr/local/lib/node_modules/code-server/lib/vscode/node_modules/@parcel/watcher/build/Release

Eventually got terminal, searching, watchers working.

@moqsien
Copy link

moqsien commented Jan 13, 2023 via email

@code-asher
Copy link
Member

code-asher commented Mar 12, 2024

Closing since it looks like the original issue was resolved? Check #5741 for the FreeBSD issue, although not sure there is anything actionable on our end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests