One host hanging on connect

2008-05-11 Thread yary
I have tramp working via plink, but there's one host it fails to
connect with. The messages say:

Tramp: Opening connection for [EMAIL PROTECTED] using plink...
Tramp: Waiting 60s for local shell to come up...
Tramp: Sending command `plink yary.ack.org -l yary  -ssh && exit || exit'
Tramp: Waiting for prompts from remote shell
Tramp: Found remote shell prompt on `yary.ack.org'

and at that point hangs. I turned on debug-on-quit/C-g, and the stack
trace at that point is at the end of the message. It made me wonder if
that host has a problem with uname, so I ran it:

-bash-2.05b$ echo "`uname -sr`" 2> /dev/null ; echo tramp_exit_status $?
OpenBSD 3.9
tramp_exit_status 0

Any idea how to fix this hanging? thanks in advance...

here's the backtrace:

Debugger entered--Lisp error: (quit)
  accept-process-output(# 1 nil)
  byte-code(" (binary garbage) " [timeout with-timeout-tag
with-timeout-timer with-timeout-timers proc timeout-msecs
run-with-timer 1 nil with-timeout-handler accept-process-output
with-timeout-value] 6)
  tramp-accept-process-output(# 1)
  tramp-wait-for-regexp(# nil "
?\n///a69fd6265c573004a0ca40f01152bf33
?\n")
  tramp-wait-for-output(#)
  tramp-send-command(["plink" "yary" "host.asite.org" ""] "echo
\\\"`uname -sr`\\\" 2>/dev/null; echo tramp_exit_status $? ")
  tramp-send-command-and-check(["plink" "yary" "host.asite.org" ""]
"echo \\\"`uname -sr`\\\"")
  tramp-barf-unless-okay(["plink" "yary" "host.asite.org" ""] "echo
\\\"`uname -sr`\\\"" "`%s' returns with error" "echo \\\"`uname
-sr`\\\"")
  tramp-send-command-and-read(["plink" "yary" "host.asite.org" ""]
"echo \\\"`uname -sr`\\\"")
  tramp-open-connection-setup-interactive-shell(# ["plink" "yary" "host.asite.org" ""])
  tramp-maybe-open-connection(["plink" "yary" "host.asite.org" ""])
  tramp-send-command(["plink" "yary" "host.asite.org" ""] "cd ~; pwd")
  tramp-handle-expand-file-name("/[EMAIL PROTECTED]:" nil)
  apply(tramp-handle-expand-file-name ("/[EMAIL PROTECTED]:" nil))
  tramp-sh-file-name-handler(expand-file-name "/[EMAIL PROTECTED]:" nil)
  apply(tramp-sh-file-name-handler expand-file-name
("/[EMAIL PROTECTED]:" nil))
  tramp-file-name-handler(expand-file-name "/[EMAIL PROTECTED]:" nil)
  expand-file-name("/[EMAIL PROTECTED]:")
  find-file-noselect("/[EMAIL PROTECTED]:" nil nil t)
  find-file("/[EMAIL PROTECTED]:" t)
  call-interactively(find-file)


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-12 Thread yary
Forgot to mention versions for my "one host hanging" issue-

tramp-version 2.1.13

GNU Emacs 22.0.990.1 (i386-mingw-nt5.1.2600) of 2007-05-23

using plink (with pagent) from windows xp to connect to an OpenBSD 3.9 client


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-13 Thread Michael Albinus
yary <[EMAIL PROTECTED]> writes:

> I have tramp working via plink, but there's one host it fails to
> connect with.

Could you, please, set tramp-verbose to 10, and present us both buffers
*tramp/plink host.asite.org* and *debug tramp/plink host.asite.org*?

> Any idea how to fix this hanging? thanks in advance...

Best regards, Michael.



___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-13 Thread yary
here are my verbose buffers-  *tramp/plink host.asite.org*

"OpenBSD 3.9"
tramp_exit_status 0

///4faf1ee001e7616f9c20e0faf80cbe0f



==
*debug tramp/plink yary at host asite org *

08:46:00 tramp-maybe-open-connection (3) # Opening connection for
[EMAIL PROTECTED] using plink...
08:46:00 tramp-get-connection-property (7) # process-name nil
08:46:00 tramp-get-connection-property (7) # process-buffer nil
08:46:00 tramp-maybe-open-connection (6) # C:\WINDOWS\system32\cmd.exe
08:46:00 tramp-maybe-open-connection (3) # Waiting 60s for local shell
to come up...
08:46:00 tramp-get-connection-property (7) # check-remote-echo nil
08:46:00 tramp-get-connection-property (7) # check-remote-echo nil
08:46:00 tramp-accept-process-output (10) # *tramp/plink
[EMAIL PROTECTED] run
08:46:01 tramp-accept-process-output (10) #
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\DOCUME~1\STEPHE~1\LOCALS~1\Temp>
08:46:01 tramp-get-connection-property (7) # check-remote-echo nil
08:46:01 tramp-get-connection-property (7) # check-remote-echo nil
08:46:01 tramp-wait-for-regexp (6) #
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\DOCUME~1\STEPHE~1\LOCALS~1\Temp>
08:46:01 tramp-get-file-property (8) #  gateway nil
08:46:01 tramp-set-connection-property (7) # temp-file
c:/DOCUME~1/STEPHE~1/LOCALS~1/Temp/tramp.5172vJc
08:46:01 tramp-maybe-open-connection (3) # Sending command `plink
host.asite.org -l yary  -ssh && exit || exit'
08:46:01 tramp-get-connection-property (7) # process-name nil
08:46:01 tramp-get-connection-property (7) # remote-echo nil
08:46:01 tramp-send-command (6) # plink host.asite.org -l yary  -ssh
&& exit || exit
08:46:01 tramp-get-connection-property (7) # process-name nil
08:46:01 tramp-get-connection-property (7) # chunksize nil
08:46:01 tramp-set-connection-property (7) # last-cmd-time (18473 47033 171000)
08:46:01 tramp-send-string (10) # plink host.asite.org -l yary  -ssh
&& exit || exit
08:46:01 tramp-get-connection-property (7) # process-buffer nil
08:46:01 tramp-process-actions (3) # Waiting for prompts from remote shell
08:46:01 tramp-accept-process-output (10) # *tramp/plink
[EMAIL PROTECTED] run
08:46:01 tramp-accept-process-output (10) #
plink host.asite.org -l yary  -ssh && exit || exit
08:46:01 tramp-process-one-action (5) # Looking for regexp ".*ogin\(
.*\)?: *\'" from remote shell
08:46:01 tramp-get-connection-property (7) # check-remote-echo nil
08:46:01 tramp-get-connection-property (7) # check-remote-echo nil
08:46:01 tramp-process-one-action (5) # Looking for regexp
"^.*\([pP]assword\|[pP]assphrase\).*:


===

Interesting. What if I remove the key from pagent?
Then tramp asks me for a password, and it still hangs after. Here are
the buffers without pagent keys:

*tramp/plink host.asite.org*
"OpenBSD 3.9"
tramp_exit_status 0

///4faf1ee001e7616f9c20e0faf80cbe0f



*debug tramp/plink yary at host asite org *

08:54:57 tramp-flush-file-property (8) # /
08:54:59 tramp-maybe-open-connection (3) # Opening connection for
[EMAIL PROTECTED] using plink...
08:54:59 tramp-get-connection-property (7) # process-name nil
08:54:59 tramp-get-connection-property (7) # process-buffer nil
08:54:59 tramp-maybe-open-connection (6) # C:\WINDOWS\system32\cmd.exe
08:54:59 tramp-maybe-open-connection (3) # Waiting 60s for local shell
to come up...
08:54:59 tramp-get-connection-property (7) # check-remote-echo nil
08:54:59 tramp-get-connection-property (7) # check-remote-echo nil
08:54:59 tramp-accept-process-output (10) # *tramp/plink
[EMAIL PROTECTED] run
08:55:00 tramp-accept-process-output (10) #
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\DOCUME~1\STEPHE~1\LOCALS~1\Temp>
08:55:00 tramp-get-connection-property (7) # check-remote-echo nil
08:55:00 tramp-get-connection-property (7) # check-remote-echo nil
08:55:00 tramp-wait-for-regexp (6) #
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\DOCUME~1\STEPHE~1\LOCALS~1\Temp>
08:55:00 tramp-get-file-property (8) #  gateway nil
08:55:00 tramp-set-connection-property (7) # temp-file
c:/DOCUME~1/STEPHE~1/LOCALS~1/Temp/tramp.51728Ti
08:55:00 tramp-maybe-open-connection (3) # Sending command `plink
host.asite.org -l yary  -ssh && exit || exit'
08:55:00 tramp-get-connection-property (7) # process-name nil
08:55:00 tramp-get-connection-property (7) # remote-echo nil
08:55:00 tramp-send-command (6) # plink host.asite.org -l yary  -ssh
&& exit || exit
08:55:00 tramp-get-connection-property (7) # process-name nil
08:55:00 tramp-get-connection-property (7) # chunksize nil
08:55:00 tramp-set-connection-property (7) # last-cmd-time (18473 47572 14)
08:55:00 tramp-send-string (10) # plink host.asite.org -l yary  -ssh
&& exit || exit
08:55:00 tramp-get-connection-property (7) # process-buffer nil
08:55:00 tramp-process-actions (3) # Waiting for prompts from remote shell
08:55:00 tramp-accept-process-output (10) # *tramp/plink
[EM

Re: One host hanging on connect

2008-05-13 Thread Michael Albinus
yary <[EMAIL PROTECTED]> writes:

> here are my verbose buffers-  *tramp/plink host.asite.org*
>
> "OpenBSD 3.9"
> tramp_exit_status 0
>
> ///4faf1ee001e7616f9c20e0faf80cbe0f

That is definitiely strange. This output shall be seen only after
several commands; none of them I have seen in the debug buffer.

Could you, please, rerun the test *after* starting up a fresh, clean Emacs?

Best regards, Michael.



___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-13 Thread yary
On Tue, May 13, 2008 at 9:23 AM, Michael Albinus <[EMAIL PROTECTED]> wrote:
...
>
> Could you, please, rerun the test *after* starting up a fresh, clean Emacs?

here it is, after (setq tramp-verbose 10) and nothing else... the
debug log has some NULs in it (C-@) which I've replaced with "^@". The
previous message was probably truncated at the first NUL.

*tramp/plink [EMAIL PROTECTED]
"OpenBSD 3.9"
tramp_exit_status 0

///b799e8ae826fe51395cca1b11f83abee


==
*debug tramp/plink [EMAIL PROTECTED]
15:35:04 tramp-maybe-open-connection (3) # Opening connection for
[EMAIL PROTECTED] using plink...
15:35:04 tramp-get-connection-property (7) # process-name nil
15:35:04 tramp-get-connection-property (7) # process-buffer nil
15:35:04 tramp-maybe-open-connection (6) # C:\WINDOWS\system32\cmd.exe
15:35:04 tramp-maybe-open-connection (3) # Waiting 60s for local shell
to come up...
15:35:04 tramp-get-connection-property (7) # check-remote-echo nil
15:35:04 tramp-get-connection-property (7) # check-remote-echo nil
15:35:04 tramp-accept-process-output (10) # *tramp/plink
[EMAIL PROTECTED] run
15:35:04 tramp-accept-process-output (10) #
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\DOCUME~1\STEPHE~1\LOCALS~1\Temp>
15:35:04 tramp-get-connection-property (7) # check-remote-echo nil
15:35:04 tramp-get-connection-property (7) # check-remote-echo nil
15:35:04 tramp-wait-for-regexp (6) #
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\DOCUME~1\STEPHE~1\LOCALS~1\Temp>
15:35:04 tramp-get-file-property (8) #  gateway nil
15:35:04 tramp-set-connection-property (7) # temp-file
c:/DOCUME~1/STEPHE~1/LOCALS~1/Temp/tramp.2720INp
15:35:04 tramp-maybe-open-connection (3) # Sending command `plink
host.asite.org -l yary  -ssh && exit || exit'
15:35:04 tramp-get-connection-property (7) # process-name nil
15:35:04 tramp-get-connection-property (7) # remote-echo nil
15:35:04 tramp-send-command (6) # plink host.asite.org -l yary  -ssh
&& exit || exit
15:35:04 tramp-get-connection-property (7) # process-name nil
15:35:04 tramp-get-connection-property (7) # chunksize nil
15:35:04 tramp-set-connection-property (7) # last-cmd-time (18474 6040 953000)
15:35:04 tramp-send-string (10) # plink host.asite.org -l yary  -ssh
&& exit || exit
15:35:04 tramp-get-connection-property (7) # process-buffer nil
15:35:04 tramp-process-actions (3) # Waiting for prompts from remote shell
15:35:04 tramp-accept-process-output (10) # *tramp/plink
[EMAIL PROTECTED] run
15:35:05 tramp-accept-process-output (10) #
plink host.asite.org -l yary  -ssh && exit || exit
15:35:05 tramp-process-one-action (5) # Looking for regexp ".*ogin\(
.*\)?: *\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp
"^.*\([pP]assword\|[pP]assphrase\).*:[EMAIL PROTECTED] *\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp
"^.*\(Connection \(?:\(?:clo\|refu\)sed\)\|Host key verification
failed\.\|Login \(?:[Ii]ncorrect\)\|N\(?:ame or service not known\|o
supported authentication methods left to try!\)\|Permission
denied\|Sorry, try again\.\|Tramp connection closed\).*\|^.*\(Received
signal [0-9]+\).*\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp "^[^#$%>
]*[#$%>] *\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp "^[^#$%>
]*[#$%>] *\(\[[0-9;]*[a-zA-Z] *\)*\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp "\(Are you
sure you want to continue connecting (yes/no)\?\)\s-*\'" from remote
shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp
"\(\(?:Store key in cache\? (y/\|Update cached key\? (y/n, Return
cancels connectio\)n)\)\s-*\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5) # Looking for regexp "\(TERM =
(.*)\|Terminal type\? \[.*\]\)\s-*\'" from remote shell
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-get-connection-property (7) # check-remote-echo nil
15:35:05 tramp-process-one-action (5)

Re: One host hanging on connect

2008-05-14 Thread Michael Albinus
yary <[EMAIL PROTECTED]> writes:

Hit,

Thanks for the debug output, it did explain what happened. But it is
still strange, I don't understand _why_ it happens.

Here Tramp tries to unset the echo via "stty -echo".

> 15:35:13 tramp-send-command (6) # stty -inlcr -echo kill '^U' erase '^H'

Now it checks whether this was successful.

> 15:35:14 tramp-send-command (6) # echo foo

No. The echo is still visible.

> 15:35:14 tramp-wait-for-regexp (6) #
> echo foo
>
> foo
> $
> 15:35:14 tramp-set-connection-property (7) # remote-echo t
> 15:35:14 tramp-open-connection-setup-interactive-shell (5) # Remote
> echo still on. Ok.

>From now on, Tramp has enabled a mechanism to suppress the echo. This
works fine for some commands like this.

> 15:35:14 tramp-send-command (6) # _echostty icanon erase ^H cols
> 32767_echo
> 15:35:14 tramp-accept-process-output (10) #
> _echo     stty icanon erase ^H cols 32767_echo     
>
> $
> 15:35:14 tramp-wait-for-regexp (6) #
> $

But then, surprisingly, the echo isn't visible any longer. Tramp becomes
confused.

> 15:35:16 tramp-send-command (6) # _echoecho \"`uname -sr`\"
> 2>/dev/null; echo tramp_exit_status $? _echo
> 15:35:16 tramp-accept-process-output (10) #
> "OpenBSD 3.9"
> tramp_exit_status 0
>
> ///b799e8ae826fe51395cca1b11f83abee

I have no idea why this happens.

Anyway, the appended patch tries to handle even this case. Could you,
please, check, whether it works for you?

Thanks, and best regards, Michael.

*** /usr/local/src/tramp/lisp/tramp.el.~1~	Mon May  5 11:15:23 2008
--- /usr/local/src/tramp/lisp/tramp.el	Wed May 14 17:14:02 2008
***
*** 851,856 
--- 851,859 
   (tramp-set-completion-function
"fcp" tramp-completion-function-alist-ssh)))
  
+ (defconst tramp-echo-mark-marker "_echo"
+   "String mark to be transmitted around shell commands.")
+ 
  (defconst tramp-echo-mark "_echo\b\b\b\b\b"
"String mark to be transmitted around shell commands.
  Used to separate their echo from the output they produce.  This
***
*** 5641,5648 
  	  (forward-line)
  	  (delete-region begin (point))
  	  (goto-char (point-min)
! ;; No echo to be handled, now we can look for the regexp.
! (when (not (tramp-get-connection-property proc "check-remote-echo" nil))
(re-search-forward regexp nil t
  
  (defun tramp-wait-for-regexp (proc timeout regexp)
--- 5644,5655 
  	  (forward-line)
  	  (delete-region begin (point))
  	  (goto-char (point-min)
! (when (or
! 	   ;; No echo to be handled, now we can look for the regexp.
! 	   (not (tramp-get-connection-property proc "check-remote-echo" nil))
! 	   ;; Sometimes the echo is invisible.
! 	   (not (re-search-forward tramp-echo-mark-marker nil t)))
!   (goto-char (point-min))
(re-search-forward regexp nil t
  
  (defun tramp-wait-for-regexp (proc timeout regexp)
___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-14 Thread yary
That patch works like a charm, thanks!


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel


Re: One host hanging on connect

2008-05-14 Thread Michael Albinus
yary <[EMAIL PROTECTED]> writes:

> That patch works like a charm, thanks!

Thanks for the test. I've committed the patch to CVS.

Best regards, Michael.


___
Tramp-devel mailing list
Tramp-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/tramp-devel