unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Filipp Gunbin <fgunbin@fastmail.fm>
Cc: 20246@debbugs.gnu.org
Subject: bug#20246: 25.0.50; Tramp does not show correct error message when ssh refuses to connect to host due to changed host key
Date: Fri, 10 Apr 2015 16:38:18 +0200	[thread overview]
Message-ID: <87vbh4oxph.fsf@gmx.de> (raw)
In-Reply-To: <m2a8yh2hi3.fsf@fastmail.fm> (Filipp Gunbin's message of "Thu, 09 Apr 2015 23:07:00 +0300")

Filipp Gunbin <fgunbin@fastmail.fm> writes:

Hi Filipp,

> That's what I can reproduce now:
>
> - change host identity in ~/.ssh/known-host
> - M-x tramp-cleanup-all-connections
> - C-x 4 r /ssh:user@host:/file
>
> Now, Tramp shows correct error message from ssh.

OK.

> - now, quit it with C-]
> - again C-x 4 r (as above)
>
> Now Tramp shows in the echo area: "/ssh:user@host:/file does not exist"
>
> This is the behavior which takes place if the above steps are done
> rather quickly.

"rather quickly" means within 10 seconds. This is the default value of
`remote-file-name-inhibit-cache', the time Tramp keeps its cache for a
given file.

> If I take a pause before retrying to visit a file, ssh error message is
> shown correctly.

OK.

> Maybe this is not the same problem I had originally, but that's what
> I'm able to reproduce right now.

Could you, please, apply the following patch:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp.el.~master~	2015-04-10 16:34:06.421074752 +0200
--- /home/albinus/src/tramp/lisp/tramp.el	2015-04-10 16:29:29.236143227 +0200
***************
*** 3558,3563 ****
--- 3558,3565 ----
  	  (tramp-message vec 6 "\n%s" (buffer-string)))
  	(unless (eq exit 'ok)
  	  (tramp-clear-passwd vec)
+ 	  (tramp-flush-directory-property vec "")
+ 	  (tramp-flush-connection-property proc)
  	  (delete-process proc)
  	  (tramp-error-with-buffer
  	   (tramp-get-connection-buffer vec) vec 'file-error
--8<---------------cut here---------------end--------------->8---

This changes the behaviour that Tramp doesn't keep its cache anymore,
when there is an error during connection. Tramp reports that the
file/directory doesn't exist, and Emacs falls back to its default
behaviour, offering you a new empty buffer. This sounds consistent.

> Filipp

Best regards, Michael.





  reply	other threads:[~2015-04-10 14:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 14:10 bug#20246: 25.0.50; Tramp does not show correct error message when ssh refuses to connect to host due to changed host key Filipp Gunbin
2015-04-03 10:05 ` Michael Albinus
2015-04-09 20:07   ` Filipp Gunbin
2015-04-10 14:38     ` Michael Albinus [this message]
2015-04-14 18:52       ` Filipp Gunbin
2015-04-16 14:30         ` Michael Albinus
2015-05-08 10:36           ` Filipp Gunbin
2022-01-24 16:12 ` Lars Ingebrigtsen
2022-02-22  1:05   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbh4oxph.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=20246@debbugs.gnu.org \
    --cc=fgunbin@fastmail.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).