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 not working #13140

Closed
jlahoda opened this issue Dec 2, 2023 · 8 comments · Fixed by #13584
Closed

Remote SSH not working #13140

jlahoda opened this issue Dec 2, 2023 · 8 comments · Fixed by #13584
Labels
remote issues related to the remote functionality remote-ssh issues related to the ssh remote functionality
Milestone

Comments

@jlahoda
Copy link

jlahoda commented Dec 2, 2023

I wanted to try the remote ssh in Theia, as introduced by this:
#12618

But, it does not see to work (for me). I am on a Linux machine, trying to connect to the same machine. I tried the same (user) account and a different account, did not notice any difference.

What I did:

  • the following checked-out commit 764d9baf205eab01b1262db2c5821816f446aeeb for me:
  • $ git clone https://github.com/eclipse-theia/theia-blueprint
  • $ cd theia-blueprint
  • //since the blueprint does not seem to include the remote plugin, I added it:
  • apply patch:
diff --git a/applications/electron/package.json b/applications/electron/package.json
index 8e19bfe..9f8b6f2 100644
--- a/applications/electron/package.json
+++ b/applications/electron/package.json
@@ -74,6 +74,7 @@
     "@theia/preferences": "1.43.0",
     "@theia/process": "1.43.0",
     "@theia/property-view": "1.43.0",
+    "@theia/remote": "1.43.0",
     "@theia/secondary-window": "1.43.0",
     "@theia/scm": "1.43.0",
     "@theia/search-in-workspace": "1.43.0",
  • $ yarn && yarn build && yarn download:plugins && yarn electron package
  • $ ./applications/electron/dist/TheiaBlueprint.AppImage
  • clicked in the left bottom corner, selected "Connet to Host", typed ide@localhost. I have a key without a passphrase (specifically for this experiment), that can login to the account without password.
  • Theia connects, and starts to download of Node.js and the backend.
  • it then fails with:
Could not open SSH connection to remote. Could not start remote system: node:internal/modules/cjs/loader:1080 throw err; ^ Error: Cannot find module '/home/ide/.blueprint-electron-app-1.43.0-remote/lib/backend/main.js' �[90m at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)�[39m �[90m at Module._load (node:internal/modules/cjs/loader:922:27)�[39m �[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)�[39m �[90m at node:internal/main/run_main_module:23:47�[39m { code: �[32m'MODULE_NOT_FOUND'�[39m, requireStack: [] } Node.js v18.17.0

If I look at the content of .blueprint-electron-app-1.43.0-remote/lib/backend:

$ cd ~/.blueprint-electron-app-1.43.0-remote/lib
$ find .
.
./build
./build/Release
./build/Release/spawn-helper
./backend
./backend/native
./backend/native/pty.node
./backend/native/nsfw.node
./backend/native/drivelist.node
./backend/native/findGitRepos.node
./backend/native/sshcrypto.node
./backend/native/cpufeatures.node
./backend/native/rg
./backend/native/keytar.node

This seem probably wrong - some things are probably missing.

I think my glibc is new enough:

$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.4) 2.35
...
@msujew
Copy link
Member

msujew commented Dec 2, 2023

@jlahoda thanks for the report. Seems like the copy mechanism failed to find the backend sources. I assume that the packaging messes with the app path. I'll take a look at it.

In the meantime: Can you see whether it works in a non-packaged app?

@jlahoda
Copy link
Author

jlahoda commented Dec 2, 2023

The non-packaged app is applications/electron/dist/linux-unpacked/blueprint-electron-app? I tried, with the same result (I've deleted ~/.blueprint-electron-app-1.43.0-remote before, in an attempt to start from scratch):

Could not open SSH connection to remote. Could not start remote system: node:internal/modules/cjs/loader:1080 throw err; ^ Error: Cannot find module '/home/ide/.blueprint-electron-app-1.43.0-remote/lib/backend/main.js' �[90m at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)�[39m �[90m at Module._load (node:internal/modules/cjs/loader:922:27)�[39m �[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)�[39m �[90m at node:internal/main/run_main_module:23:47�[39m { code: �[32m'MODULE_NOT_FOUND'�[39m, requireStack: [] } Node.js v18.17.0

I've also tried replacing .blueprint-electron-app-1.43.0-remote/lib/backend/ with the content of applications/electron/dist/linux-unpacked/resources/app/lib/backend. Not sure if that makes any sense, but this ends with:

...
2023-12-02T10:34:28.612Z root ERROR Request establishConnection failed with error: Could not start remote system: /home/ide/.blueprint-electron-app-1.43.0-remote/lib/backend/428.js:2
<a very long line>
                                                                                                                                                                                                                                                                                                                    ^

Error: node-loader:
Error: Module did not self-register: '/home/ide/.blueprint-electron-app-1.43.0-remote/lib/backend/native/drivelist.node'.
    at 20840 �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/428.js:2:315�[90m)�[39m
    at o �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/main.js:1:12228�[90m)�[39m
    at e.exports �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/main.js:1:2886�[90m)�[39m
    at 99100 �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/428.js:2:744971�[90m)�[39m
    at o �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/main.js:1:12228�[90m)�[39m
    at 53420 �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/428.js:2:56598�[90m)�[39m
    at o �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/main.js:1:12228�[90m)�[39m
    at 85909 �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/428.js:2:58137�[90m)�[39m
    at o �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/main.js:1:12228�[90m)�[39m
    at 92061 �[90m(/home/ide/.blueprint-electron-app-1.43.0-remote/�[39mlib/backend/428.js:2:50170�[90m)�[39m

Node.js v18.17.0

I wonder if I am doing something wrong.

@msujew
Copy link
Member

msujew commented Dec 2, 2023

@jlahoda The non-packaged version can just be started via yarn electron start.

@jlahoda
Copy link
Author

jlahoda commented Dec 2, 2023

Thanks. With yarn electron start, I can connect to the remote, and open a directory there. Is there a description somewhere on what should work? I don't have built in extensions available on the remote and when I installed one that is of a particular interest to me (a VS Code extension bundling and starting an LSP server), it apparently started, the LSP server ran, but e.g. code completion didn't work for me. I checked, and the CC works in the local mode, when the extension is built in into the application. Is there something the extension must or should do?

Thanks!

@msujew
Copy link
Member

msujew commented Dec 2, 2023

Extensions currently aren't moved over (it's still work in progress). But plugin support itself should work as expected. I'll take a look at that as well.

@msujew msujew added remote-ssh issues related to the ssh remote functionality remote issues related to the remote functionality labels Dec 2, 2023
@jlahoda
Copy link
Author

jlahoda commented Dec 2, 2023

Regarding the extension not working on the remote - I've installed the eclipse-theia.builtin-extension-pack-1.50.1.vsix (from vsix) on the remote side, which added bunch of additional extensions and I've restarted/reconnected. After that, the code completion seems to work. So, apparently one of the extension installed as a dependency of the builtin extension pack is needed. Probably not an issue specifically related to the remote extension.

@JonasHelming
Copy link
Contributor

@jlahoda Can we close this issue?

@msujew
Copy link
Member

msujew commented Dec 19, 2023

@JonasHelming I still haven't really investigated this. It might be that the feature breaks when packaging the Electron app up for distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
remote issues related to the remote functionality remote-ssh issues related to the ssh remote functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants