maestro-ng icon indicating copy to clipboard operation
maestro-ng copied to clipboard

ssh tunnel fails with 'stdin: is not a tty' exception

Open lbielski opened this issue 10 years ago • 3 comments

Hi guys! If I set up an ssh_tunnel in my configuration like this:

ssh_tunnel:
  user: root
  key: {{ env.HOME }}/.ssh/id_rsa
  port: 22

and I get this exception:

Starting tunnel with command: /usr/bin/ssh -o BatchMode=yes -i /home/leonti/.ssh/id_rsa -T -p 22 -L 127.0.0.1:40744:127.0.0.1:2375 [email protected] (most recent call last):
  File "/home/leonti/development/maestro-ng/maestro-ng/maestro/__main__.py", line 203, in main
    c = maestro.Conductor(config)
  File "maestro/maestro.py", line 34, in __init__
    .from_config(config).ships())
  File "maestro/shipproviders.py", line 84, in from_config
    return ShipsProviderFactory.PROVIDERS[provider](config)
  File "maestro/shipproviders.py", line 56, in __init__
    for k, v in self._config['ships'].items())
  File "maestro/shipproviders.py", line 56, in <genexpr>
    for k, v in self._config['ships'].items())
  File "maestro/entities.py", line 103, in __init__
    identity_file=ssh_tunnel['key'])
  File "maestro/bgtunnel.py", line 393, in open
    raise SSHTunnelError(t.stderr)
SSHTunnelError: stdin: is not a tty

Any clues how I can fix it?

lbielski avatar Dec 18 '14 18:12 lbielski

I was experiencing this when using vagrant+ubuntu14.04

found a few workarounds, and decided to go with this one:

# hack around "stdin" errs with ubuntu+vagrant
# see https://github.com/mitchellh/vagrant/issues/1673
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

binary1230 avatar Jun 12 '15 13:06 binary1230

Is this something that needs to be done on the target host, or local?

mpetazzoni avatar Jun 12 '15 15:06 mpetazzoni

I did this on the vagrant host (ubuntu) where I was running 'maestro'. Come to think of it though, I might have run these commands for something else that was doing a different SSH thing, but this definitely fixed some kind of 'stdin not a tty' issue

binary1230 avatar Jun 12 '15 17:06 binary1230