knife zero converge - SocketError: getaddrinfo: Name or service not known

455 Views Asked by At

After successful bootstrap with

bundle exec knife zero bootstrap [email protected]

I'm trying to apply my cookbooks to remote using

bundle exec knife zero converge "name:ily"

but getting

WARNING: Failed to connect to ily.localdomain -- SocketError: getaddrinfo: Name or service not known
ERROR: NoMethodErrorundefined method `forward' for nil:NilClass
ERROR: /home/razor/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/knife-zero-1.16.0/lib/knife-zero/bootstrap_ssh.rb:32:in `block in ssh_command'

My node config looks like:

{
  "name": "ily",
  "normal": {
    "knife_zero": {
      "host": "139.59.210.225"
    },
    "tags": [

    ]
  },
  "automatic": {
    "knife_zero": {
      "host": "139.59.210.225"
    },

    "hostname": "ily",
    "machinename": "ily",
    "fqdn": "ily.localdomain",
    "domain": "localdomain",
    "current_user": "root",
    ... other attributes
  }
}

I'm using digital ocean instance and don't have real hostname , I guess, fqdn name is generated during bootstrap. Which domain shall I use if I have only ip?

1

There are 1 best solutions below

0
On

I had this issue and here is how to solve it:

Update your knife.rb file from your chef repository with the following line:

# Use host IP address instead of FQDN to connect via SSH?
knife[:ssh_attribute] = 'knife_zero.host'

And then knife zero will use the IP address from your node instead of trying to resolve its name.