'Unable to bootstrap a node from chef workstation

I've an issue with chef , when i try to bootstrap a node .I installed a server and a workstation after i tried to bootstrap a node but it's impossible i got this error message: enter image description here

Before bootstrapping i generated a knife.rb for the client with knife configure client .

Thanks,



Solution 1:[1]

You're getting a HTTP 401 error, meaning you are failing to authenticate against the chef server.

To test my knife.rb file I always run a simple command like:

knife client list

I would expect that fails for you? You need a functioning chef workstation before attempting to bootstrap new nodes.

Solution 2:[2]

Below command for bootstrapping ubuntu linux machine works fine for me.

/home/ubuntu/chef-repo/.chef# sudo knife bootstrap -i <.pem_file_of_client_machine> <pubic_IPV4_Address/DNS_of_client_machine> -x ubuntu --node-name <node_name> --sudo --run-list "recipe[<cookbook_name>]"

where,

pem_file_of_client_machine --> private key to connect with client node

pubic_IPV4_IP/DNS_of_client_machine --> Public IP address/ DNS of the client machine

node_name --> String representing node name

cookbook_name --> Cookbook that we want to execute on client machine

  • Verify Username/Password you are providing or you can try providing private key(.pem file). User should have root permissions on machine.

  • Make sure boostraping steps you are performing from ~/chef-repo/.chef directory where you have private keys of chef server and trusted certs. You can download chef server cert with below command

    /home/ubuntu/chef-repo# knife ssl fetch
    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mark O'Connor
Solution 2