Reputation: 6681
While running chef-client using knife, there is an error message that the recipe cannot be found. The command I use is
knife ssh myserver 'sudo chef-client' --manual-list -ssh-user myuser
Synchronize and compile of cookbooks is successful but then it fails with message
myserver [2015-01-08T13:54:06+01:00] ERROR: could not find recipe file /home/myuser/myuser
So it seems that the chef client is looking for the recipe in location /home/myuser/myuser but that is not where the recipes are stored.
I think that chef should look for these in /var/chef/cache. I'm not sure. Why is Chef unable to find my cookbooks? Why is Chef looking in the wrong location?
Upvotes: 1
Views: 1579
Reputation: 997
You are missing a hyphen in your command on the ssh user
knife ssh myserver 'sudo chef-client' --manual-list --ssh-user myuser
Did you provide any configuration to the server that changes it's cookbook repo? go on the server itself and check it's client.rb
It's also possible the cookbook is not on your chef server. Make sure it's uploaded there before you continue. If you are running chef solo make sure you've defined the correct cookbook repo in your knife.rb so chef knows where to find your cookbooks.
Upvotes: 1