Chef Bootstrapping Node Error

Hello,
I am able to install chef on workstation (curl -L https://www.opscode.com/chef/install.sh | sudo bash)
this was success and when I try to bootstrap a node (knife bootstrap -x user -P password -N ) it show following error…

[root@yerollashyam4 cookbooks]# knife bootstrap yerollashyam5b.mylabserver.com -x user -P password -N Node
Creating new client for Node
Creating new node for Node
Connecting to yerollashyam5b.mylabserver.com
user@yerollashyam5b.mylabserver.com’s password:
yerollashyam5b.mylabserver.com -----> Installing Chef Omnibus (-v 12)

yerollashyam5b.mylabserver.com to file /tmp/install.sh.6067/install.sh
yerollashyam5b.mylabserver.com trying wget…
yerollashyam5b.mylabserver.com el 6 x86_64
yerollashyam5b.mylabserver.com Getting information for chef stable 12 for el…
yerollashyam5b.mylabserver.com to file /tmp/install.sh.6078/metadata.txt
yerollashyam5b.mylabserver.com trying wget…
yerollashyam5b.mylabserver.com sha1 22c01541188bf6b79d65f3f897a34d30581edf55
yerollashyam5b.mylabserver.com sha256 909a4f3e1738ceefc8ee8e16da2b4bd35f63d51a7854aea744c3caeb84d1ef29
yerollashyam5b.mylabserver.com version 12.12.13
yerollashyam5b.mylabserver.com downloaded metadata file looks valid…
yerollashyam5b.mylabserver.com downloading https://packages.chef.io/stable/el/6/chef-12.12.13-1.el6.x86_64.rpm
yerollashyam5b.mylabserver.com to file /tmp/install.sh.6078/chef-12.12.13-1.el6.x86_64.rpm
yerollashyam5b.mylabserver.com trying wget…
yerollashyam5b.mylabserver.com Comparing checksum with sha256sum…
yerollashyam5b.mylabserver.com Installing chef 12
yerollashyam5b.mylabserver.com installing with rpm…
yerollashyam5b.mylabserver.com warning: /tmp/install.sh.6078/chef-12.12.13-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
yerollashyam5b.mylabserver.com error: can’t create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
yerollashyam5b.mylabserver.com Installation failed
yerollashyam5b.mylabserver.com Version: 12
yerollashyam5b.mylabserver.com
yerollashyam5b.mylabserver.com Please file a Bug Report at
yerollashyam5b.mylabserver.com More Chef support resources can be found at
yerollashyam5b.mylabserver.com
yerollashyam5b.mylabserver.com Please include as many details about the problem as possible i.e., how to reproduce
yerollashyam5b.mylabserver.com the problem (if possible), type of the Operating System and its version, etc.,
yerollashyam5b.mylabserver.com and any other relevant details that might help us with troubleshooting.
yerollashyam5b.mylabserver.com
yerollashyam5b.mylabserver.com mkdir: cannot create directory /etc/chef’: Permission denied yerollashyam5b.mylabserver.com sh: line 178: /etc/chef/client.pem: No such file or directory yerollashyam5b.mylabserver.com chmod: cannot access/etc/chef/client.pem’: No such file or directory
yerollashyam5b.mylabserver.com sh: line 214: /etc/chef/client.rb: No such file or directory
yerollashyam5b.mylabserver.com sh: line 222: /etc/chef/first-boot.json: No such file or directory
yerollashyam5b.mylabserver.com Starting the first Chef Client run…

yerollashyam5b.mylabserver.com sh: line 229: chef-client: command not found

Before, I have started the bootstrap I have enabled the root permit login in node server(/etc/ssh/sshd_config & restarted the service sshd).

============================================================
I tried using
knife bootstrap yerollashyam5b.mylabserver.com -x user -P password -N Node --sudo

Error:-

[root@yerollashyam4 chef-repo]# knife bootstrap yerollashyam5b.mylabserver.com -x user -P password -N Node --sudo
Creating new client for Node
Creating new node for Node
Connecting to yerollashyam5b.mylabserver.com
user@yerollashyam5b.mylabserver.com’s password:
yerollashyam5b.mylabserver.com knife sudo password:
Enter your password:
yerollashyam5b.mylabserver.com
yerollashyam5b.mylabserver.com user is not in the sudoers file. This incident will be reported.

Then after I tired using --ssh-password and --use-sudo-password combinations. But Issue seems presistent.

Requesting all for solution.

You don't actually have sudo permissions on the target machine. Fix that :slight_smile:

@coderanger thanks fixed it.:slight_smile: