StackStorm / StackStorm/st2

ssh_config and proxycommands throw a traceback

Open
#3,527 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale status:to be verified
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

[ssh_runner]
remote_dir = /tmp
use_ssh_config = true
ssh_config_file_path = /home/eedgar/.ssh/config

config contains

Host na01_useast1
HostName bastion.test.com
ForwardAgent yes
Host 10.12.*
UserKnownHostsFile=/dev/null
StrictHostKeyChecking no
ProxyCommand ssh -q -W %h:%p na01_useast1
st2 run core.remote cmd=whoami hosts=10.12.29.240
2017-06-28 13:48:51,304 DEBUG [-] Runner dispatch produced result: {'traceback': ' File "/home/eedgar/st2/st2actions/st2actions/container/base.py", line 91, in _do_run\n runner.pre_run()\n File "/home/eedgar/st2/st2common/st2common/runners/paramiko_ssh_runner.py", line 145, in pre_run\n self._parallel_ssh_client = ParallelSSHClient(**client_kwargs)\n File "/home/eedgar/st2/st2common/st2common/runners/parallel_ssh.py", line 66, in init\n connect_results = self.connect(raise_on_any_error=raise_on_any_error)\n File "/home/eedgar/st2/st2common/st2common/runners/parallel_ssh.py", line 96, in connect\n raise NoHostsConnectedToException(msg)\n', 'error': 'Unable to connect to any one of the hosts: [u\'10.12.X.X\'].\n\n connect_errors={\n "10.12.X.X": {\n "failed": true, \n "traceback": "Traceback (most recent call last):\n File \"/home/eedgar/st2/st2common/st2common/runners/parallel_ssh.py\", line 248, in _connect\n client.connect()\n File \"/home/eedgar/st2/st2common/st2common/runners/paramiko_ssh.py\", line 138, in connect\n self.client = self._connect(host=self.hostname, socket=self.bastion_socket)\n File \"/home/eedgar/st2/st2common/st2common/runners/paramiko_ssh.py\", line 634, in _connect\n raise SSHException(msg)\nSSHException: Error connecting to host 10.12.X.X with connection parameters {\'username\': \'eedgar\', \'key_filename\': \'/home/eedgar/.ssh/id_rsa\', \'allow_agent\': False, \'hostname\': u\'10.12.X.X\', \'sock\': <paramiko.proxy.ProxyCommand object at 0x7f27b454be50>, \'look_for_keys\': False, \'timeout\': 60, \'port\': 22}.Paramiko error: \"ProxyCommand (ssh -q -W 10.12.X.X:22 na01_useast1)\" returned non-zero exit status: Broken pipe.\n", \n "timeout": false, \n "succeeded": false, \n "stdout": "", \n "stderr": "", \n "error": "Connection error. Error connecting to host 10.12.X.X with connection parameters {\'username\': \'eedgar\', \'key_filename\': \'/home/eedgar/.ssh/id_rsa\', \'allow_agent\': False, \'hostname\': u\'10.12.X.X\', \'sock\': <paramiko.proxy.ProxyCommand object at 0x7f27b454be50>, \'look_for_keys\': False, \'timeout\': 60, \'port\': 22}.Paramiko error: \"ProxyCommand (ssh -q -W 10.12.X.X:22 na01_useast1)\" returned non-zero exit status: Broken pipe.", \n "return_code": 255\n }\n}'}

we are just trying to setup a ssh jumphost and reuse the ssh_config for that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in st2common/st2common/runners/paramiko_ssh_runner.py at pre_run, then follow connection handling through parallel_ssh.py connect and paramiko_ssh.py _connect. Reproduce the supplied ssh_config and st2 run command, then verify that the jumphost ProxyCommand connects successfully without a traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.