pssh error

1,966 views
Skip to first unread message

Mateusz Harasymczuk

unread,
Aug 18, 2011, 10:41:56 AM8/18/11
to parall...@googlegroups.com
How to avoid this error msg while using --send-input option?

Stderr: Pseudo-terminal will not be allocated because stdin is not a terminal.


I have tried -x "-t -t" wchich should work
and 2>/dev/null

Andrew McNabb

unread,
Aug 18, 2011, 11:20:41 AM8/18/11
to parall...@googlegroups.com
This is a warning message from ssh rather than a real error. Is it
causing any particular problems? If the problem is the error message,
then the adding -x "-t -t" as you described should work--is it working
for you?

--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868

Mateusz Harasymczuk

unread,
Aug 19, 2011, 2:45:28 AM8/19/11
to parall...@googlegroups.com
The problem is, that when I use -x "-t -t" option, pssh seems to hang up, and even "echo foo" does not ends.

Why this bothers me?
shortly after prompting a success message as a result of executing a shell command remotely it pops up with an error.
Which may be confusing to end users.

Thanks in advance.

Andrew McNabb

unread,
Aug 19, 2011, 1:01:25 PM8/19/11
to parall...@googlegroups.com
On Thu, Aug 18, 2011 at 11:45:28PM -0700, Mateusz Harasymczuk wrote:
> The problem is, that when I use -x "-t -t" option, pssh seems to hang up,
> and even "echo foo" does not ends.

Could you provide any more information about how to reproduce this? I
just did the following:

pssh -i -x "-t -t" -H localhost echo hi

but it didn't hang for me. Are there any other options that I should
add to reproduce the problem?

Mateusz Harasymczuk

unread,
Aug 22, 2011, 8:45:22 AM8/22/11
to parall...@googlegroups.com
[user@host ~]$ pssh -x "-t -t" -H 127.0.0.1 -i echo 'asd'
[1] 14:40:31 [SUCCESS] 127.0.0.1
asd
Stderr: tcgetattr: Invalid argument

[user@host ~]$ echo 'echo foo' > bar.sh
[user@host ~]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh

it will hang up, and after two ctrl-c (exact paste with PS1)

[user@host _haras]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
[1] 14:42:21 [FAILURE] 127.0.0.1 Interrupted
Last login: Mon Aug 22 14:42:03 2011 from localhost
[user@host ~]$ foo
[user@host ~]$ Stderr: tcgetattr: Invalid argument

Andrew McNabb

unread,
Aug 22, 2011, 10:36:55 AM8/22/11
to parall...@googlegroups.com
On Mon, Aug 22, 2011 at 05:45:22AM -0700, Mateusz Harasymczuk wrote:
> [user@host ~]$ pssh -x "-t -t" -H 127.0.0.1 -i echo 'asd'
> [1] 14:40:31 [SUCCESS] 127.0.0.1
> asd
> Stderr: tcgetattr: Invalid argument
>

So, it looks like this first worked correctly, though ssh apparently got
a little confused about terminal settings or something.

> [user@host ~]$ echo 'echo foo' > bar.sh
> [user@host ~]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
>
> it will hang up, and after two ctrl-c (exact paste with PS1)
>
> [user@host _haras]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
> [1] 14:42:21 [FAILURE] 127.0.0.1 Interrupted
> Last login: Mon Aug 22 14:42:03 2011 from localhost
> [user@host ~]$ foo
> [user@host ~]$ Stderr: tcgetattr: Invalid argument

I think that the stuff from standard error is what made it hard to see
what was going on. If I trim this, it's a little easier to see what
happened:

[user@host _haras]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
[1] 14:42:21 [FAILURE] 127.0.0.1 Interrupted
Last login: Mon Aug 22 14:42:03 2011 from localhost
[user@host ~]$ foo
[user@host ~]$

[user@host _haras]$

So, since ssh has a pseudo-terminal allocated (because of "-t -t"), it's
running an interactive shell instead of just running a single command.
The reason it's hanging is that the shell is asking for more input. :)
A quick and easy way to fix this is to add "exit" to the end of the
script.

However, I don't think that you really need a full pseudoterminal
allocated, so you might be better off just removing the "-t -t". I'm
not quite sure why ssh would be giving you warning messages about not
being to allocate a pseudo-terminal if you're not passing in "-t -t".
If this still seems to be a problem, could you share some more detail
about what's happening?

Mateusz Harasymczuk

unread,
Aug 23, 2011, 1:52:55 AM8/23/11
to parall...@googlegroups.com
[user@host _haras]$ cat asd.sh
#!/bin/sh
echo "asdasd"
exit
[user@host _haras]$ pssh -H 127.0.0.1 -x"-t -t" -i -I < asd.sh
[1] 07:49:33 [SUCCESS] 127.0.0.1
Last login: Tue Aug 23 07:48:25 2011 from localhost
[user@host ~]$ [user@host ~]$ [user@host ~]$ asdasd
[user@host ~]$ logout
Stderr: tcgetattr: Invalid argument
[user@host _haras]$


Once again exact terminal output.

BTW. Thanks for helping me out :}
pssh and prsync are great tools!


--
Matt Harasymczuk
www.matt.harasymczuk.pl

Andrew McNabb

unread,
Aug 23, 2011, 3:47:19 PM8/23/11
to parall...@googlegroups.com

Just to make sure: this was the correct behavior this time, right?

Mateusz Harasymczuk

unread,
Aug 24, 2011, 3:42:41 AM8/24/11
to parall...@googlegroups.com
I am not quite sure.
Error pops out, moreover remote command with prompt appeared on my local machine.
Same problem when switching from 127.0.0.1 to any other host :\

Andrew McNabb

unread,
Aug 24, 2011, 1:33:37 PM8/24/11
to parall...@googlegroups.com

The error occurs because it's forcing pseudoterminal allocation without
having a terminal. It's a legitimate error. I guess I'm still not
quite sure why the "-t -t" was needed in the first place.

Mateusz Harasymczuk

unread,
Aug 26, 2011, 2:07:25 AM8/26/11
to parall...@googlegroups.com
I am not sure whether it is good or not, however -x "-T" solves the problem.
Stderr... pops up no longer.

--
Matt Harasymczuk
www.matt.harasymczuk.pl

Gershom Malkiel

unread,
Oct 31, 2017, 2:50:53 PM10/31/17
to parallel-ssh
Picking up an old thread but this is the top result on the Googs when searching for "pssh Stderr: Invalid multiplex command." In my case, I'm on macos X, freshly installed pssh from Homebrew, and followed the manpage's advice on passing arguments to ssh for ignoring hosts/strict host checking, &c: 

Run a command without checking or saving host keys:

    pssh -i -H host1 -H host2 -x "-O StrictHostKeyChecking=no -O UserKnownHostsFile=/dev/null -O GlobalKnownHostsFile=/dev/null" echo hi


On macos, however (and other BSDs, I would guess), the -O option sets up various multiplexing scenarios, just as the error suggests.  Simply replacing the -Os with -o fixes the problem. 


HTH

Reply all
Reply to author
Forward
0 new messages