Why does Tramp hang when sending Perl scripts to the remote host?

I know that this is not directly programming related, but I’m stumped, and since Emacs is my main programming tool…

I am trying to set up Tramp to connect to my testing host. I’m invoking it either using /ssh:host:.bashrc or /scp:host:.bashrc but both of these run into the same problem, sooner or later.

They get only as far as the first attempt to send a perl script before the process wedges and I’m forced to kill the ssh session from a client.

For example:

tramp: Opening connection for username@host using scp...
tramp: Waiting 60s for local shell to come up...
tramp: Sending command `ssh host -l username  -e none || exit'
tramp: Waiting for prompts from remote shell
tramp: Waiting 60s for prompt from remote shell on host host
tramp: Found remote shell prompt on `host'
tramp: Waiting 30s for remote `/bin/sh' to come up...
tramp: Setting up remote shell environment
tramp: Determining coding system
tramp: Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'
tramp: Waiting 30s for `set +o vi +o emacs'
tramp: Waiting 30s for `unset MAIL MAILCHECK MAILPATH'
tramp: Waiting 30s for `unset CDPATH'
tramp: Setting shell prompt
tramp: Remote `/bin/sh' groks tilde expansion, good
tramp: Finding command to check if file exists
tramp: Finding a suitable `ls' command
tramp: Checking remote `/bin/ls' command for `-n' option
tramp: Testing remote command `/bin/ls' for -n...okay
tramp: Using remote command `/bin/ls' for getting directory listings
tramp: Sending the Perl script `tramp_file_attributes'...
tramp-wait-for-output: Process has died

This trace is using the scp method. The ssh method looks like this:

tramp: Opening connection for username@host using ssh...
tramp: Waiting 60s for local shell to come up...
tramp: Sending command `ssh host -l username  -e none || exit'
tramp: Waiting for prompts from remote shell
tramp: Waiting 60s for prompt from remote shell on host host
tramp: Found remote shell prompt on `host'
tramp: Waiting 30s for remote `/bin/sh' to come up...
tramp: Setting up remote shell environment
tramp: Determining coding system
tramp: Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'
tramp: Waiting 30s for `set +o vi +o emacs'
tramp: Waiting 30s for `unset MAIL MAILCHECK MAILPATH'
tramp: Waiting 30s for `unset CDPATH'
tramp: Setting shell prompt
tramp: Remote `/bin/sh' groks tilde expansion, good
tramp: Finding command to check if file exists
tramp: Finding a suitable `ls' command
tramp: Checking remote `/bin/ls' command for `-n' option
tramp: Testing remote command `/bin/ls' for -n...okay
tramp: Using remote command `/bin/ls' for getting directory listings
tramp: Sending the Perl `mime-encode' implementations.
tramp-wait-for-output: Process has died

As you can see, the last thing that happens is trying to send the Perl script. The process is dying because I’m killing it in another shell, otherwise emacs never comes back from this.

I’m connecting to FreeBSD 6.2-RELEASE-p5 from OSX 10.5.7, if it makes any difference, using Tramp 2.0.58-pre in the Carbon Emacs 22.3.1 build.

Answer

Perhaps strace on the pid of sshd on the receiving end (the FreeBSD server) will show you where it is locking up. You are going to need to follow child processes with -f. If the pid of sshd is 3125:

sudo strace -vfp 3125 -o sshdStraceDump.txt

Attribution
Source : Link , Question Author : Chris R , Answer Author : Kyle Brandt

Leave a Comment