all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Issues with multi-hop in TRAMP
@ 2019-02-14 19:48 Jordan Wilson
  2019-02-15  9:52 ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Jordan Wilson @ 2019-02-14 19:48 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

I'm using Emacs 26.1 on Windows 10.

I'm trying to get the following multi-hop to work in TRAMP:
    /plink:username@machine|sshx:username@machine2:
    
(i.e. connect to a "machine" using plink and then from there connect to
    "machine2" using sshx)

The first time this is run it will first try to connect to "machine2"
via sshx on my local machine. This causes Emacs to hang, and I have to
kill the resulting "ssh" child process. The connection will then go
through as expected. All future connections seem to work.

Looking, it seems Windows 10 comes with a version of OpenSSH, and
presumably some incompatibility between Emacs/TRAMP and that version of
ssh is causing a hang. But I'm confused as to why "sshx" is being
called on my local machine at all.

Is my multi-hop line above correct?

Thanks,
-- 
Jordan Wilson
    Sent from Gnus v5.13, GNU Emacs 26.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issues with multi-hop in TRAMP
  2019-02-14 19:48 Issues with multi-hop in TRAMP Jordan Wilson
@ 2019-02-15  9:52 ` Michael Albinus
  2019-02-16  0:10   ` Jordan Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2019-02-15  9:52 UTC (permalink / raw)
  To: Jordan Wilson; +Cc: help-gnu-emacs

Jordan Wilson <jordan.t.wilson@gmx.com> writes:

> Hi all,

Hi Jordan,

> I'm using Emacs 26.1 on Windows 10.
>
> I'm trying to get the following multi-hop to work in TRAMP:
>     /plink:username@machine|sshx:username@machine2:
>     
> (i.e. connect to a "machine" using plink and then from there connect to
>     "machine2" using sshx)
>
> The first time this is run it will first try to connect to "machine2"
> via sshx on my local machine. This causes Emacs to hang, and I have to
> kill the resulting "ssh" child process. The connection will then go
> through as expected. All future connections seem to work.
>
> Looking, it seems Windows 10 comes with a version of OpenSSH, and
> presumably some incompatibility between Emacs/TRAMP and that version of
> ssh is causing a hang. But I'm confused as to why "sshx" is being
> called on my local machine at all.

I have never tried OpenSSH on Windows, yet. But as you said, it
shouldn't be in play.

> Is my multi-hop line above correct?

Looks OK to me. Do you see the same when starting "emacs -Q"?

> Thanks,

Best regards, Michael.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issues with multi-hop in TRAMP
  2019-02-15  9:52 ` Michael Albinus
@ 2019-02-16  0:10   ` Jordan Wilson
  2019-02-16  8:51     ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Jordan Wilson @ 2019-02-16  0:10 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Hi Michael,

On 2019-02-15 (Fri) at 10:52 (+0100), Michael Albinus <michael.albinus@gmx.de> wrote:
> Looks OK to me. Do you see the same when starting "emacs -Q"?
Yes.

I tried to edebug my way to find the problem but with no luck.

If I remove "%SYSTEMROOT%\System32\OpenSSH\" from the system path,
everything seems to work fine. So it's not a massive issue for
me. But...

Using Microsoft's process monitor program[1], I can see Emacs is going
through the $PATHs trying to call a "ssh" executable on the local
machine. I gather it gives up and does what it is supposed to. Is that a
bug?

Footnotes: 
[1]  https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

Thanks,
-- 
Jordan Wilson
    Sent from Gnus v5.13, GNU Emacs 26.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issues with multi-hop in TRAMP
  2019-02-16  0:10   ` Jordan Wilson
@ 2019-02-16  8:51     ` Michael Albinus
  2019-02-16 14:53       ` Jordan Wilson
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2019-02-16  8:51 UTC (permalink / raw)
  To: Jordan Wilson; +Cc: help-gnu-emacs

Jordan Wilson <jordan.t.wilson@gmx.com> writes:

> Hi Michael,

Hi Jordan,

>> Looks OK to me. Do you see the same when starting "emacs -Q"?
> Yes.

Strange.

> I tried to edebug my way to find the problem but with no luck.
>
> If I remove "%SYSTEMROOT%\System32\OpenSSH\" from the system path,
> everything seems to work fine. So it's not a massive issue for
> me. But...
>
> Using Microsoft's process monitor program[1], I can see Emacs is going
> through the $PATHs trying to call a "ssh" executable on the local
> machine. I gather it gives up and does what it is supposed to. Is that a
> bug?

It shouldn't. There is a clear directive to use plink on your local
machine, if you use a file name like
"/plink:username@machine|sshx:username@machine2:"

Have you tried sole "/plink:username@machine:"?

Do you use packages which keep information over Emacs sessions, like
recentf.el or desktop.el?

> Thanks,

Best regards, Michael.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issues with multi-hop in TRAMP
  2019-02-16  8:51     ` Michael Albinus
@ 2019-02-16 14:53       ` Jordan Wilson
  2019-02-16 16:20         ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Jordan Wilson @ 2019-02-16 14:53 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Hi Michael,

On 2019-02-16 (Sat) at 09:51 (+0100), Michael Albinus <michael.albinus@gmx.de> wrote:
> Have you tried sole "/plink:username@machine:"?
They work fine. No problems connecting to that machine with plink.

> Do you use packages which keep information over Emacs sessions, like
> recentf.el or desktop.el?
I use recentf.el. It can see in `recentf-open-files' files retrieved
using that multi-hop are labelled like
"/sshx:username@machine2:/home/jordan/hello.txt"

But even if that was somehow the cause, that doesn't
explain why this issue appears in "emacs -Q".

> Best regards, Michael.
Regards,
-- 
Jordan Wilson
    Sent from Gnus v5.13, GNU Emacs 26.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issues with multi-hop in TRAMP
  2019-02-16 14:53       ` Jordan Wilson
@ 2019-02-16 16:20         ` Michael Albinus
  2019-02-25 11:52           ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2019-02-16 16:20 UTC (permalink / raw)
  To: Jordan Wilson; +Cc: help-gnu-emacs

Jordan Wilson <jordan.t.wilson@gmx.com> writes:

> Hi Michael,

Hi Jordan,

> On 2019-02-16 (Sat) at 09:51 (+0100), Michael Albinus <michael.albinus@gmx.de> wrote:
>> Have you tried sole "/plink:username@machine:"?
> They work fine. No problems connecting to that machine with plink.

Fine.

>> Do you use packages which keep information over Emacs sessions, like
>> recentf.el or desktop.el?
> I use recentf.el. It can see in `recentf-open-files' files retrieved
> using that multi-hop are labelled like
> "/sshx:username@machine2:/home/jordan/hello.txt"

Well, that's the problem. Multi-hop remote files, as you use them, are
called "ad-hoc". The reason is that this syntax is intended for the
moment, and not suited to survive Emacs sessions. Tramp reduces the file
name "/method1:host1|method2:host2:" to "/method2:host2", just for
convenience. The needed hop for host2 is kept internally during the
Emacs session.

When you open a new Emacs session, and recentf reads its initial file
with the shortened file name, this information is lost.

So you shall either declare multi-hop by means of
`tramp-default-proxies-alist' (see the Tramp manual, node "Multi-hops"),
or you shall set `tramp-save-ad-hoc-proxies' to t (see the Tramp manual,
node "Ad-hoc multi-hops"), which stores that information persistently.

Anyway, it is an error in recentf to store such shortened remote file
name, missing the ad-hoc multi-hop information. I will check, whether
this could be fixed.

(Maybe you write an Emacs bug report about, in order not to forget? I
cannot promise that I will work on this just now.)

> But even if that was somehow the cause, that doesn't
> explain why this issue appears in "emacs -Q".

Indeed, I also don't know what's up with "emacs -Q" here. To be
investigated as well.

> Regards,

Best regards, Michael.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Issues with multi-hop in TRAMP
  2019-02-16 16:20         ` Michael Albinus
@ 2019-02-25 11:52           ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2019-02-25 11:52 UTC (permalink / raw)
  To: Jordan Wilson; +Cc: help-gnu-emacs

Michael Albinus <michael.albinus@gmx.de> writes:

> Hi Jordan,

Hi Jordan,

>> I use recentf.el. It can see in `recentf-open-files' files retrieved
>> using that multi-hop are labelled like
>> "/sshx:username@machine2:/home/jordan/hello.txt"
>
> Well, that's the problem. Multi-hop remote files, as you use them, are
> called "ad-hoc". The reason is that this syntax is intended for the
> moment, and not suited to survive Emacs sessions. Tramp reduces the file
> name "/method1:host1|method2:host2:" to "/method2:host2", just for
> convenience. The needed hop for host2 is kept internally during the
> Emacs session.
>
> When you open a new Emacs session, and recentf reads its initial file
> with the shortened file name, this information is lost.
>
> So you shall either declare multi-hop by means of
> `tramp-default-proxies-alist' (see the Tramp manual, node "Multi-hops"),
> or you shall set `tramp-save-ad-hoc-proxies' to t (see the Tramp manual,
> node "Ad-hoc multi-hops"), which stores that information persistently.
>
> Anyway, it is an error in recentf to store such shortened remote file
> name, missing the ad-hoc multi-hop information. I will check, whether
> this could be fixed.

Well, I've extended `tramp-cleanup-all-connections' such a way, that it
removes all remote files from recentf lists. This should help in such
cases, at least to get rid of reloading such files again and again.

Available in the Emacs master branch.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-02-25 11:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-14 19:48 Issues with multi-hop in TRAMP Jordan Wilson
2019-02-15  9:52 ` Michael Albinus
2019-02-16  0:10   ` Jordan Wilson
2019-02-16  8:51     ` Michael Albinus
2019-02-16 14:53       ` Jordan Wilson
2019-02-16 16:20         ` Michael Albinus
2019-02-25 11:52           ` Michael Albinus

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.