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

DNS issues with HostName in SSH config #619

Closed
yuvadm opened this issue Apr 16, 2012 · 5 comments
Closed

DNS issues with HostName in SSH config #619

yuvadm opened this issue Apr 16, 2012 · 5 comments

Comments

@yuvadm
Copy link

yuvadm commented Apr 16, 2012

Very simple scenario:

env.use_ssh_config = True

@hosts(['example'])
def test():
    run('uname')

and with the following SSH config:

Host example
  HostName example.com

I'm getting this:

$ fab test
[example] Executing task 'test'
[example] run: uname

Fatal error: Name lookup failed for example.com 

Underlying exception:
    nodename nor servname provided, or not known

Aborting.

# BUT!

$ ssh example uname
Linux

Any idea what's going on?

@yuvadm
Copy link
Author

yuvadm commented Apr 16, 2012

I just found out I had HostName example.com_ (underscore is an accidental trailing whitespace) in the SSH config.

Looks like #305 all over again?

@bitprophet
Copy link
Member

I think this needs to be done on the ssh side since the actual matching of input (Fabric asking for host "example") with the ssh config key, which is what needs stripping ("example ") is performed in SSHConfig.lookup. I'll make a reference there.

@bitprophet
Copy link
Member

See ssh #23

@atomos
Copy link

atomos commented Aug 6, 2014

Thanks @yuvadm - extra space got me too

@styts
Copy link

styts commented Nov 17, 2015

Got bitten by the extra whitespace bug too, posting this here for future searchers:
The error I was getting was Fatal error: Name lookup failed for hosts - since we were using the dictionary-based env.roledefs definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants