Open jleechpe opened 4 months ago
Hi @jleechpe, thanks for opening the issue. I'm personally not an emacs user and only understood half of the issue description.
Could you isolate the problem in the ssh connection somehow?
If not I'd be grateful for any help from the community here
I tried using the debug flag both in TRAMP and in the devpod ssh connection and didn't see very much that helped hint at what might be going wrong.
09:52:53.745464 tramp-send-command (6) # cd /workspaces/repo/ && exec 2>'/tmp/tramp.aZI9TA' env INSIDE_EMACS\=31.0.50\,tramp\:2.7.1 PS1\=/ssh\:repo.devpod\:/workspaces/repo/\ \#\$\ /bin/sh -c stty\ raw\ \>\ /dev/null\;\ rye\ run\ pyright-langserver\ --stdio
09:52:53.746626 tramp-send-command (6) # (if test -h "/workspaces/repo/"; then echo t; else echo nil; fi) && \readlink --canonicalize-missing /workspaces/repo/ 2>/dev/null; echo tramp_exit_status $?
09:52:53.747891 tramp-wait-for-regexp (6) #
nil
/workspaces/repo
tramp_exit_status 0
(SSH to another machine for the same command has the equivalent output accounting for path but then has subsequent commands that occur afterwards)
The flow that Emacs is trying to use is:
From what I can see happening...
docker ps
to find the container first] (uses docker exec ...
rather than ssh ...
as far as I can tell) the Language Server initializes properly and responds to the JSONRPC init command@pascalbreuninger Looking back into this again. Is there a way to connect to the devpod via SSH without going through the devpod-cli ssh
wrapper/proxy command (even if it is not recommended/inconvenient outside of debugging)? The fact that it works when connecting to it as a docker container (and ssh working for non-devpod hosts) makes me think there's something not being passed through the proxy properly (It expects a JSONRPC sentinel process to communicate with that never seems to establish)
@jleechpe not directly. If you need to split it up, you could start the workspace with DevPod and then docker exec into the container once everything is set up. That's a bad experience though and I'd rather fix the underlying issue
@pascalbreuninger That's effectively what I was doing to troubleshoot.
ssh
(devpod-cli ssh
due to .ssh/config) then the pyright langserver times out after 30 seconds since it never gets a jsonrpc
response.docker exec
then it works as expectedssh
(2nd local machine where I cloned the same code repo) then it works as expectedWas able to get normal SSH working by updating the password for codespace
(which I'm assuming will break everything else but was enough to use normal SSH commands for testing.
Switching to just the normal SSH connection ( ssh codespace@172.17.0.2 -p 2222
) everything works as expected. So it looks like the issue is somewhere in how the Go SSH implementation is setting up the tunnel or wrapping the messages that prevent the JSONRPC connection from establishing properly.
What happened?
When trying to connect to a language server within the DevPod from Emacs over Tramp it fails after a 30 second timeout. Connecting to the devpod through via the
docker:
protocol rather thanssh:
everything works as expected.ssh:
protocol also works when connecting to language servers that don't have thedevpod-cli
wrapper in theProxyCommand
What did you expect to happen instead?
Language Server initializes and connects successfully.
How can we reproduce the bug? (as minimally and precisely as possible)
Start a devpod container, connect to code files within it using TRAMP (
/ssh:name.devpod:/path/to/files
or/sshx:name.devpod:/path/to/files
) then try to start a language server (M-x eglot
[then provide path to Language Server executable if it fails to find]). ... Eglot (language server handler) will successfully set up the LSP connection then timeout ~30 seconds later.Do the same but connect via docker (
/docker:<container-name>:/path/to-files
) and Eglot will successfully connect and interact.Local Environment:
DevPod Provider:
Anything else we need to know?