dockerpy fails with ssh if remote machine was not added to hosts
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
This could be avoided by doing ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) before as mentioned on https://github.com/onyxfish/relay/issues/11#issuecomment-26494294
INTERNALERROR> File "/root/rdo/ansible-role-container-registry/.tox/molecule/lib/python3.6/site-packages/docker/client.py", line 40, in __init__
INTERNALERROR> self.api = APIClient(*args, **kwargs)
INTERNALERROR> File "/root/rdo/ansible-role-container-registry/.tox/molecule/lib/python3.6/site-packages/docker/api/client.py", line 166, in __init__
INTERNALERROR> base_url, timeout, pool_connections=num_pools
INTERNALERROR> File "/root/rdo/ansible-role-container-registry/.tox/molecule/lib/python3.6/site-packages/docker/transport/sshconn.py", line 84, in __init__
INTERNALERROR> self._connect()
INTERNALERROR> File "/root/rdo/ansible-role-container-registry/.tox/molecule/lib/python3.6/site-packages/docker/transport/sshconn.py", line 94, in _connect
INTERNALERROR> parsed.hostname, parsed.port, parsed.username,
INTERNALERROR> File "/root/rdo/ansible-role-container-registry/.tox/molecule/lib/python3.6/site-packages/paramiko/client.py", line 416, in connect
INTERNALERROR> self, server_hostkey_name, server_key
INTERNALERROR> File "/root/rdo/ansible-role-container-registry/.tox/molecule/lib/python3.6/site-packages/paramiko/client.py", line 824, in missing_host_key
INTERNALERROR> "Server {!r} not found in known_hosts".format(hostname)
INTERNALERROR> paramiko.ssh_exception.SSHException: Server 'n0' not found in known_hosts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in docker/transport/sshconn.py at the _connect() call shown in the traceback, and review how the Paramiko client handles hosts absent from known_hosts. Compare the proposed missing-host-key behavior with the linked discussion and verify that SSH connections to an unregistered remote host complete without the reported exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100