Subject: bug#60777: 29.0.60; tramp+eglot don't work if remote user is not local user

From: Michael Albinus <[email-masked]>
Date: Fri, 13 Jan 2023 13:04:48 +0100

Pedro Andres Aranda Gutierrez <[email-masked]> writes:

Hi Pedro,

> (use-package tramp
>   :config
>   ;;
>   ;; For VMs with the student user and for my private VMs
>   ;;
>   (add-to-list 'tramp-remote-path "/home/paag/.local/bin")
>   (add-to-list 'tramp-remote-path "/home/student/.local/bin"))

Could you pls add (setq tramp-verbose 6) to this config?

> When I edit Python code locally or on the 'paag' user in the VM
> everything works correctly. However, when I try to edit remotely
> on the 'student' user, I get the following error:
>
> Tramp: Checking 'vc-registered' for
> /ssh:student@localhost#10042:/home/student/Devel/test1.py...done
> Configuring eglot
> Tramp: Opening connection *EGLOT (Devel/(python-mode)) stderr* for
> student@localhost using ssh...done
> Tramp: Opening connection EGLOT (Devel/(python-mode)) for
> student@localhost using ssh...done
> [jsonrpc] Server exited with status 127
> Error in post-command-hook (#[0
> "\303\304\300\242\305#\210\306\301!\205 \0r\301q\210
> ?\205 \0\307\310\311 \")\207" [(#0) #<buffer test1.py>
> eglot--managed-mode remove-hook post-command-hook nil buffer-live-p
> apply eglot--connect eglot--guess-contact] 4]): (error "[eglot] -1:
> Server died")

Rerun the test.

With this config, there shall also be a Tramp debug buffer
*debug tramp/ssh student@localhost#10042* Pls send it as attachment.

Best regards, Michael.