Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH connection errors are unclear #11041

Closed
shawnferry opened this issue May 20, 2015 · 5 comments
Closed

SSH connection errors are unclear #11041

shawnferry opened this issue May 20, 2015 · 5 comments
Labels
bug This issue/PR relates to a bug.

Comments

@shawnferry
Copy link

Issue Type:

Bug Report

Ansible Version:

ansible 1.9 (devel ede94dd) last updated 2015/03/29 14:04:17 (GMT -400)
lib/ansible/modules/core: (detached HEAD de4c7f8) last updated 2015/05/19 12:48:28 (GMT -400)
lib/ansible/modules/extras: (detached HEAD cb848fc) last updated 2015/04/03 15:14:36 (GMT -400)
v2/ansible/modules/core: (detached HEAD 34784b7a61) last updated 2015/02/26 12:26:47 (GMT -400)
v2/ansible/modules/extras: (detached HEAD 46e316a) last updated 2015/04/03 15:14:36 (GMT -400)
configured module search path = None

Ansible Configuration:

Nothing of note

Environment:

NA

Summary:

Hosts without name resolution result in failures with unclear ssh connection errors.

Steps To Reproduce:

Attempt to connect to a host in inventory which does not have name resolution.

Expected Results:

Ansible with ssh errors more clearly indicates the reason for failure

ansible paramiko
fatal: [hostA] => {'msg': 'FAILED: [Errno 8] nodename nor servname provided, or not known', 'failed': True}
command line ssh
ssh hostA
ssh: Could not resolve hostname hostA: nodename nor servname provided, or not known
Actual Results:

Ansible with ssh errors are unclear

ansible ssh
fatal: [hostA] => SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
Example

If I have hundreds or thousands of hosts some of which need to be bootstrapped in a specific way. I can't tell from the ssh errors if they need to be bootstrapped or if there is some other error which needs to be addressed separately. In the simple case this forces me to fall back to paramiko and bootstrap them all again which is slow.

@bcoca
Copy link
Member

bcoca commented Jun 1, 2015

so in 1.9.1 iirc, we added passing more data from the ssh command line to the ssh errors, please try this with the 1.9 stable version or current devel (2.0), you seem to have an older checkout of devel.

@shawnferry
Copy link
Author

Updated I'm reporting
ansible 2.0.0 (devel 5658ddf) last updated 2015/05/31 18:48:20 (GMT -400)
lib/ansible/modules/core: (detached HEAD f8d8af1) last updated 2015/05/31 18:53:16 (GMT -400)
lib/ansible/modules/extras: (detached HEAD 1276420) last updated 2015/05/31 18:53:16 (GMT -400)
v2/ansible/modules/core: (detached HEAD 85c8a892c8) last updated 2015/05/31 18:53:17 (GMT -400)
v2/ansible/modules/extras: (detached HEAD 70ea058) last updated 2015/05/31 18:53:17 (GMT -400)
configured module search path = None

I'm still seeing
SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh
when ssh returns
ssh: Could not resolve hostname foo: nodename nor servname provided, or not known

Notably now my version is returning 2.0.0 when sourced from hacking/env-setup did I miss something here?

@bcoca
Copy link
Member

bcoca commented Jun 1, 2015

no, my surprise was that it was returning 1.9 from devel

@shawnferry
Copy link
Author

Finding a slightly different behavior in the most recent commits

{"msg": "ERROR! SSH encountered an unknown error. The output was:\n", "failed": true}

ssh foo
ssh: Could not resolve hostname foo: nodename nor servname provided, or not known

ansible 2.0.0 (devel 1c85270) last updated 2015/06/03 14:38:43 (GMT -400)
lib/ansible/modules/core: (detached HEAD b138411) last updated 2015/06/03 11:55:57 (GMT -400)
lib/ansible/modules/extras: (detached HEAD 1276420) last updated 2015/06/03 11:56:08 (GMT -400)
v1/ansible/modules/core: (detached HEAD f8d8af1) last updated 2015/06/03 11:56:18 (GMT -400)
v1/ansible/modules/extras: (detached HEAD 495ad45) last updated 2015/06/03 11:56:29 (GMT -400)
configured module search path = None

@bcoca bcoca closed this as completed in bdba807 Jun 6, 2015
@bcoca
Copy link
Member

bcoca commented Jun 6, 2015

fixed via bdba807, which restores the previous behavior

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants