-
Notifications
You must be signed in to change notification settings - Fork 214
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
edit remote files via tramp - emacs freez and other issues #758
Comments
lsp-bridge can works if you ssh login server directly, I guess something wrong with proxy server. I'm not good at using multi-level server, welcome to send patches |
All right. If I got the time i will have a look into it. Maybe I will come back with some questions regarding the lsp-bridge code in general. |
I push commit: https:github.com/manateelazycat/lsp-bridge/commit/2fe97d91db938ac70ee59a11d1eacc23f6697199 This patch will print an error message in the 'lsp-bridge' buffer when the login is incorrect, you can try it and see what error is reported? Maybe it's lsp-bridge's internal library that uses paramiko doesn't support jump servers |
Appreciated
I think so too. I had a quick look into it and a proxy command support came out later. I found something in there docs. |
For now lsp-bridge's internal library doesn't support jump servers. My work scenario also requires the use of jump servers. If lsp-bridge supports jump server, it can support more remote editing scenarios. |
@werhner I need it ... so I started writing and tinkering with the internals. Help is definitely welcome and probably needed. Especially later one for the lisp code 😅. |
Thank you for providing information about the ProxyCommand function. I have written a patch that supports jump server. you should change the ProxyJump option in ssh/config to the following ProxyCommand option
You can give it a try. Thank you. |
@werhner connection to the ssh host now works but I'm getting some errors when my emacs lsp-bridge and the lsp-bridge that runs on the ssh host try to communicate. Emacs *lsp-bridge* output: --- [14:57:29.319523] Receive remote message: {"command": "get_emacs_vars", "args": ["tabnine-bridge-binaries-folder"], "host": "141.3.88.138"}
Exception in thread Thread-12:
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
self.run()
File "$HOME/.config/emacs/elpaca/repos/lsp-bridge/core/remote_file.py", line 100, in run
self.callback(message)
File "$HOME/.config/emacs/elpaca/builds/lsp-bridge/lsp_bridge.py", line 416, in <lambda>
lambda message: self.receive_socket_message(message, server_port),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$HOME/.config/emacs/elpaca/builds/lsp-bridge/lsp_bridge.py", line 439, in receive_socket_message
client = self.get_socket_client(host, REMOTE_FILE_ELISP_CHANNEL)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$HOME/.config/emacs/elpaca/builds/lsp-bridge/lsp_bridge.py", line 413, in get_socket_client
self.host_names[server_host]["username"],
~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: '141.3.88.138' ssh host's lsp-bridge.py terminal output: * Running lsp-bridge in remote server, use command 'lsp-bridge-open-remote-file' to open remote file.
--- [14:57:29.278537] Build connect from 141.3.88.138:49950
Traceback (most recent call last):
File "./lsp-bridge/lsp_bridge.py", line 510, in event_dispatcher
getattr(self, func_name)(*func_args)
AttributeError: 'LspBridge' object has no attribute '_signature_help'
Exception in thread Thread-8:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "./lsp-bridge/lsp_bridge.py", line 499, in handle_remote_request
getattr(self, message["method"])(*message["args"])
AttributeError: 'LspBridge' object has no attribute 'search_file_words_search' |
First error, please add |
Second error, you need git clone lsp-bridge on server then start lsp_bridge.py, you need include all lsp-bridge files under remote server. You will got strange error if you just copy lsp_bridge.py to some directory to start. |
*** {
'$HOST': {
'server_host': '$HOST_NAME',
'username': '$USER',
'ssh_port': [],
'use_gssapi': False,
'proxy_command': 'ssh -qW $HOST_NAME:22 $USER@$JUMP_HOST_NAME'
},
'$HOST_NAME': {
'username': '$USER',
'ssh_port': 22,
'use_gssapi': False,
'proxy_command': 'ssh -qW $HOST_NAME:22 $USER@$JUMP_HOST_NAME'
}}
$HOST_NAME 9997
--- [16:11:49.498121] Receive remote message: {"command": "get_emacs_vars", "args": ["tabnine-bridge-binaries-folder"], "host": "$HOST_NAME_IP_ADDRESS"}
*** {
'$HOST': {
'server_host': '$HOST_NAME',
'username': '$USER',
'ssh_port': [],
'use_gssapi': False,
'proxy_command': 'ssh -qW $HOST_NAME:22 $USER@$JUMP_HOST_NAME'
},
'$HOST_NAME': {
'username': '$USER',
'ssh_port': 22,
'use_gssapi': False,
'proxy_command': 'ssh -qW $HOST_NAME:22 $USER@JUMP_HOST_NAME'
}}
$HOST_NAME_IP_ADDRESS 9997 I have to do a bit of censoring because the ip's are for work. I also should mention that when I open the file with tramp, I get no extra output from lsp_bridge.py on my ssh host or the *lsp-bridge* buffer.
I have the repo cloned on my ssh host. I even remembered to pull all the newest changes before I started. |
@werhner can you take a look? thanks |
Sorry for the delayed response. |
Change it to IP format and try again. |
The output that i get in emacs looks to be pretty similar but i get a bigger stacktrache from the console on my ssh host running the lsp_bridge py --- [17:22:49.061546] Build connect from 141.3.88.138:47084
Traceback (most recent call last):
File "./lsp-bridge/lsp_bridge.py", line 510, in event_dispatcher
getattr(self, func_name)(*func_args)
File "./lsp-bridge/lsp_bridge.py", line 754, in _do
open_file_success = self.open_file(filepath) # _do is called inside event_loop, so we can block here.
File "./lsp-bridge/lsp_bridge.py", line 538, in open_file
project_path = get_project_path(filepath)
File "/common/homes/students/ughlu_gleissner/lsp-bridge/core/utils.py", line 384, in get_project_path
if get_command_result("git rev-parse --is-inside-work-tree", dir_path) == "true":
File "/common/homes/students/ughlu_gleissner/lsp-bridge/core/utils.py", line 285, in get_command_result
encoding="utf-8", errors="replace")
TypeError: __init__() got an unexpected keyword argument 'text' With domian name format: --- [17:25:41.303238] Build connect from 141.3.88.138:50594
Traceback (most recent call last):
File "./lsp-bridge/lsp_bridge.py", line 510, in event_dispatcher
getattr(self, func_name)(*func_args)
AttributeError: 'LspBridge' object has no attribute '_signature_help' |
With numerical IPv4: --- [17:22:49.061546] Build connect from 141.3.88.138:47084
Traceback (most recent call last):
File "./lsp-bridge/lsp_bridge.py", line 510, in event_dispatcher
getattr(self, func_name)(*func_args)
File "./lsp-bridge/lsp_bridge.py", line 754, in _do
open_file_success = self.open_file(filepath) # _do is called inside event_loop, so we can block here.
File "./lsp-bridge/lsp_bridge.py", line 538, in open_file
project_path = get_project_path(filepath)
File "/common/homes/students/ughlu_gleissner/lsp-bridge/core/utils.py", line 384, in get_project_path
if get_command_result("git rev-parse --is-inside-work-tree", dir_path) == "true":
File "/common/homes/students/ughlu_gleissner/lsp-bridge/core/utils.py", line 285, in get_command_result
encoding="utf-8", errors="replace")
TypeError: __init__() got an unexpected keyword argument 'text' This error is because the Python versoin in your server is too older, I have commit 29cc7a0 patch that make get_command_result works with Python below 3.7 @Moerliy You can update to newest version and try again. |
@manateelazycat seems to work now, but using the numerical IPv4 is required otherwise it will not work. I only checked it with one project that uses typescript tho. The language server should not make any difference but I will have a look at some other projects tomorrow to make sure. |
I was trying to use lsp-bridge to edit a remote project via ssh and tramp. Tramp itself works, the lsp server and lsp-bridge is installed on the ssh-host and lsp-bridge.py is running.
When i open a remote file via tramp lsp-bridge asks me for the ssh host's password. When i provide this emacs freezes up. When i open another emacs session (i'm running emacs with a daemon in the background), the old one stops freezing and when i start typing inside the oped file, lsp-brideg asks again for my ssh-host's password. If I type it in again it will not freeze up but there will be no connection to the lsp-bridge running on the ssh-host.
*lsp-bridge* buffer
I should mention that i have a ssh key-pair working with the ssh-machine and it works like it should but not with lsp-bridge. I also have a config for the ssh host in ssh/config.
My wild guess is that lsp-bridge is not the biggest fan of jump connections with ssh.
The text was updated successfully, but these errors were encountered: