Re: "Tramp failed to connect" to an ssh server (gpg as an ssh agent)

Daniel Krajnik <[email protected]>
Newsgroups gmane.emacs.tramp
Message-ID <[email protected]>
 > check where Tramp is started from, by 'M-x locate-library RET tramp'.

Thank you, this confirmed that the tramp version is shipped by the emacs 
system pacakge (/usr/share/emacs/29.1/lisp/net/tramp.elc) and not the 
doom framework (~/.config/emacs) like I originally thought (I might have 
looked at the "other versions" field in the "doom/help-packages" buffer 
by mistake).

> sign_and_send_pubkey: signing failed for ED25519 "cardno:000F73AE79E9" 
from agent: agent refused operation

I've switched temporarily back to pinentry (non-gtk) version and run 
tramp in emacs -Q. Log at level 10 and backtrace attached. It yielded 
the same error (quoted above) as on the terminal. GTK3 version pinentry 
still works fine though (both on emacs -Q and doom).

On 09/09/2023 08:37, Michael Albinus wrote:
> Daniel Krajnik<[email protected]>  writes:
>
> Hi Daniel,
>
>> Thank you, I've upgraded doom's packages to the latest version, which
>> bumped tramp up to version 2.6.1.1.
>>
>> I've tried looking for a way to upgrade it to 2.6.1.2 (package is
>> managed by straight.el and doom's documentation doesn't mention that
>> you can use release number instead of the hash commit), but this broke
>> emacs and I had to revert back (thankfully all is backed by btrfs'
>> snapshots).
> Well, the difference between 2.6.1.1 and 2.6.1.2 is small. If you have
> 2.6.1.1 it would be OK.
>
>> After restarting emacs daemon, I've tried to connect again (thinking
>> that it's on version 2.6.1.1) and initially this time it worked.
>>
>> It did however produce the same backtrace errors, which revealed that
>> tramp is still on version 2.6.0.29.1.
> You can check the Tramp version by 'C-h v tramp-version'. You can also
> check where Tramp is started from, by 'M-x locate-library RET tramp'.
>
>>> It is the "prompting PIN" text I'm interested in.
>> Because, ~/.gnupg/gpg-agent.conf was configured to use
>>
>> pinentry-program /usr/bin/pinentry-gnome3
>>
>> gtk3 for pinentry (it's necessary when working with gpg in
>> thunderbird) there was not output in the terminal - just the typical
>> graphical window appears and login succeeds.
> I see. In this case, Tramp is not involved, and I don't need to see
> anything :-)
>
>> Interestingly though if you change it to /usr/bin/pinentry (and
>> restart gpg-agent) it fails:
>>
>> sign_and_send_pubkey: signing failed for ED25519 "cardno:000F
>> 73AE79E9" from agent: agent refused operation
>>
>> I'm not sure why though?
> Again, show the debug buffer produced with tramp-verbose 10.
>
> Best regards, Michael.
backtrace (text/plain, 1.9 KB)
  backtrace()
  tramp-error(nil file-error "Tramp failed to connect.  If this happens repeated...")
  tramp-signal-hook-function(file-error ("Tramp failed to connect.  If this happens repeated..."))
  signal(file-error ("Tramp failed to connect.  If this happens repeated..."))
  tramp-maybe-open-connection((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil))
  tramp-send-command((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) "echo ~ 2>/dev/null; echo tramp_exit_status $?")
  tramp-send-command-and-check((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) "echo ~")
  tramp-sh-handle-get-home-directory((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) "")
  apply(tramp-sh-handle-get-home-directory ((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) ""))
  tramp-sh-file-name-handler(tramp-get-home-directory (tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) "")
  apply(tramp-sh-file-name-handler tramp-get-home-directory ((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) ""))
  tramp-file-name-handler(tramp-get-home-directory (tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) "")
  tramp-get-home-directory((tramp-file-name "ssh" "user1" nil "128.40.123.56" nil "" nil) "")
  tramp-sh-handle-expand-file-name("/ssh:[email protected]:" nil)
  apply(tramp-sh-handle-expand-file-name ("/ssh:[email protected]:" nil))
  tramp-sh-file-name-handler(expand-file-name "/ssh:[email protected]:" nil)
  apply(tramp-sh-file-name-handler expand-file-name ("/ssh:[email protected]:" nil))
  tramp-file-name-handler(expand-file-name "/ssh:[email protected]:" nil)
  expand-file-name("/ssh:[email protected]:")
  find-file-noselect("/ssh:[email protected]:" nil nil t)
  find-file("/ssh:[email protected]:" t)
  funcall-interactively(find-file "/ssh:[email protected]:" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
debug tramp-ssh [email protected] (text/plain, 32.6 KB) - not displayed
OpenPGP_0xCFC60FFCAAEC3A7D.asc (application/pgp-keys, 1.3 KB)
-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEZEwmuBYJKwYBBAHaRw8BAQdAUSPhBHvM5HVLqdnnA8UFqDYIWHxw1HlnUD4d
vvKhXFjNJkRhbmllbCBLcmFqbmlrIDxrcmFqbmlrLmRhbkBnbWFpbC5jb20+wpAE
ExYIADgWIQROikqEcL7GbFTtzbDPxg/8quw6fQUCZEwmuAIbAQULCQgHAgYVCgkI
CwIEFgIDAQIeAQIXgAAKCRDPxg/8quw6fUtVAP9He/b8gOLZa/tmVHIwU3sqJv9m
A95Wu8+DckHwPiPmngD9HIhe8IDS/CILzYKnLU05SoR7c8nXSY1JAnJp057uQAfO
MwRkTChFFgkrBgEEAdpHDwEBB0B3G+ZMHI5hXPw/ixIhVCGnb41SQF+flGXB8mnD
mVA+RMLANQQYFggAJhYhBE6KSoRwvsZsVO3NsM/GD/yq7Dp9BQJkTChFAhsCBQkB
4TOAAIEJEM/GD/yq7Dp9diAEGRYIAB0WIQQUEHvti7oyCbklIY8cJKqm/xtZBAUC
ZEwoRQAKCRAcJKqm/xtZBHStAQCeRXVN9X7BJmcjxEDe4cXP7pkHpidjjX4mr3TO
MJDZOQEAgmNhLJVjEREIQwyhw4Ws7VwWUaIyFPN1N/g0QtRGvAxkCQD5AVNx+V07
oTpOwdIZ/L4V+jK1c8VQaIA04ddLOMCyOC0BAOfb2WXu6iWxlrDqEoSgc8pC4tYq
lU7jO5VV7xQc7IoMzjgEZEwo3hIKKwYBBAGXVQEFAQEHQGOa8m4s8shclIl5F8SF
DN+2xg+vW1PZAqyo8nV8s7dPAwEIB8J+BBgWCAAmFiEETopKhHC+xmxU7c2wz8YP
/KrsOn0FAmRMKN4CGwwFCQHhM4AACgkQz8YP/KrsOn3fHAD+NqIqRUMm6Jxar0ck
KvBnhYWp+jBNLc71oZF4TJAsdhIA/RVutRg7GVFhAWl1om2cu2aZlAXBp6lWzUTg
+xEU7ZQNzjMEZEwpbxYJKwYBBAHaRw8BAQdAnmF552EV6XsamdaD7XNJiv0P071X
K5kaJxXwPRBaOFnCfgQYFggAJhYhBE6KSoRwvsZsVO3NsM/GD/yq7Dp9BQJkTClv
AhsgBQkB4TOAAAoJEM/GD/yq7Dp9C4oA/RIgCO4Sul8MRKIRzzP1TheByb6lEwqM
OFh7JvFwhuDBAP9b5uqNaYGN1Wik4XjguXFcICVrWf/NwcPpShPqoSpxAQ==
=UtN6
-----END PGP PUBLIC KEY BLOCK-----
OpenPGP_signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEARYIAB0WIQQUEHvti7oyCbklIY8cJKqm/xtZBAUCZPxW0AAKCRAcJKqm/xtZ
BKgcAQD5K7tgGHsu/wi430lrXw9nYLJM8ZWHiI4uOJteV0zEDAEA/wG+3Bgy+4zM
p2BtH+bPK8YRiGStbOnLzWvj+ISXjA0=
=uraB
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.