-
-
Notifications
You must be signed in to change notification settings - Fork 914
fortls over tramp: fortls.jsonrpc.JSONRPC2ProtocolError: Line endings must be \r\n #3369
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
Comments
I could not believe it but it seems that adding (setq lsp-print-io t) seems to have solved the problem! Why? |
@XushanLu if this is fixing your issue then you are hitting a well-known issue with lsp--send-message not being reentrant. I know that the fix is, I just don't have the time to fix it yet. |
Thanks for your response, @yyoncho! Have played with it for 10 minutes but I think right now it is probably still unusable. Emacs hangs frequently. I think it may have something to do with my zsh (oh-my-zsh) although I have now removed most of the initialization in the .zshrc file when it detects TERM is dumb. Switched back to local development and only use remote for compilation with lsp disabled. Unless I can make tramp faster, I don't think lsp works well for me remotely. It could easily be my .Spacemacs messing up with everything but I just don't have the time to figure things out. |
- This fixes the implementation of `lsp-mode` tramp support. After this PR the remote clients will be automatically registered and in most of the cases it will work out of the box. The remote connection is managed to a way similar to what eglot does. Fixes emacs-lsp#4158 Fixes emacs-lsp#4150 Fixes emacs-lsp#4158 Fixes emacs-lsp#4150 Fixes emacs-lsp#3841 Fixes emacs-lsp#3642 Fixes emacs-lsp#3579 Fixes emacs-lsp#3530 Fixes emacs-lsp#3491 Fixes emacs-lsp#3490 Fixes emacs-lsp#3391 Fixes emacs-lsp#3369 Fixes emacs-lsp#3364 Fixes emacs-lsp#3020 Fixes emacs-lsp#3018 Fixes emacs-lsp#3020
- This fixes the implementation of `lsp-mode` tramp support. After this PR the remote clients will be automatically registered and in most of the cases it will work out of the box. The remote connection is managed to a way similar to what eglot does. Fixes emacs-lsp#4158 Fixes emacs-lsp#4150 Fixes emacs-lsp#4158 Fixes emacs-lsp#4150 Fixes emacs-lsp#3841 Fixes emacs-lsp#3642 Fixes emacs-lsp#3579 Fixes emacs-lsp#3530 Fixes emacs-lsp#3491 Fixes emacs-lsp#3490 Fixes emacs-lsp#3391 Fixes emacs-lsp#3369 Fixes emacs-lsp#3364 Fixes emacs-lsp#3020 Fixes emacs-lsp#3018 Fixes emacs-lsp#3020
* Fix lsp-mode's tramp support - This fixes the implementation of `lsp-mode` tramp support. After this PR the remote clients will be automatically registered and in most of the cases it will work out of the box. The remote connection is managed to a way similar to what eglot does. Fixes emacs-lsp#4158 Fixes emacs-lsp#4150 Fixes emacs-lsp#4158 Fixes emacs-lsp#4150 Fixes emacs-lsp#3841 Fixes emacs-lsp#3642 Fixes emacs-lsp#3579 Fixes emacs-lsp#3530 Fixes emacs-lsp#3491 Fixes emacs-lsp#3490 Fixes emacs-lsp#3391 Fixes emacs-lsp#3369 Fixes emacs-lsp#3364 Fixes emacs-lsp#3020 Fixes emacs-lsp#3018 Fixes emacs-lsp#3020 * Use executable-find with remote = t everywhere
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
I am having troubles using fortls over tramp. It keeps giving me the error information:
'Server fortls-remote:94034/starting exited with status exit(check corresponding stderr buffer for details). Do you want to restart it?'
I then opened the possible stderr buffer /tmp/fortls-remote-2-stderr on the remote machine and here is what I see:
Unexpected error: Line endings must be \r\n
Traceback (most recent call last):
File "/home/xsl/anaconda3/lib/python3.9/site-packages/fortls/langserver.py", line 115, in run
request = self.conn.read_message()
File "/home/xsl/anaconda3/lib/python3.9/site-packages/fortls/jsonrpc.py", line 110, in read_message
return self._receive()
File "/home/xsl/anaconda3/lib/python3.9/site-packages/fortls/jsonrpc.py", line 95, in _receive
length = self._read_header_content_length(line)
File "/home/xsl/anaconda3/lib/python3.9/site-packages/fortls/jsonrpc.py", line 81, in _read_header_content_length
raise JSONRPC2ProtocolError("Line endings must be \r\n")
fortls.jsonrpc.JSONRPC2ProtocolError: Line endings must be \r\n
When trying to print what line is by changing line 82 of jsonrps.py
to
I got
fortls.jsonrpc.JSONRPC2ProtocolError: Line endings must be \r\nContent-Length: 2682
I am using Spacemacs and here is my settings for fortls-remote in user-config:
I also tried Doom Emacs but the same thing is happening. The version of fortls is 1.12.0 and I installed it by using
pip
provided byAnaconda
if that matters.Any idea? Really want to get this working cause my laptop has not have MPI installed and I rely on my remote servers for daily development. VScode works just fine and no issues like this. I am using Mac OS and Emacs 27. The remote is Unbuntu 20.04.
It rarely works but when it is working everything seems to be fine.
Steps to reproduce
M-x lsp
Expected behavior
fortls-remote server is connected and everything is working.
Which Language Server did you use?
lsp-fortls
OS
MacOS
Error callstack
Anything else?
No response
The text was updated successfully, but these errors were encountered: