matschaffer / knife-solo

DEPRECATED: Please consider using https://knife-zero.github.io/, ansible, or visit https://www.chef.io/ for other ideas
MIT License
787 stars 213 forks source link

Error: No chef-client >= 0.10.0 found #318

Open holms opened 10 years ago

holms commented 10 years ago

This issue is quite hilarious, but I believe it's producible. And I'm not sure if it's knife-solo fault, or it's chef-solo itself..

So first of all, I've forgot to add cookbooks to Berksfile, and I've ran knife solo prepare myhost, chef-client installed smoothly. Then I've ran knife solo cook myhost and of course it's failed with message that my cookbook is not found (that one which I've specified in role, and forgot to add in Berksfile).

Now try to re-run knife solo prepare myhost && knife solo cook myhost and you'll get a really strange behavior. First of all my /opt/chef directory is gone, although links to chef-client binary is left in /usr/bin/. Second, even if you'd add cookbooks to Berksfile, cookbooks are not updated (when you run prepare command) anymore. And after you run cook command, it will crash with message that no chef-client is found.

Not sure if this supposed to happen like this and is it knife-solo fault, or chef-solo itself. Would be nice if somebody would reproduce this on CentOs. It's only affecting centos. Hadn't had any issues with ubuntu for 2 weeks, while I've been reinstalling my chef-server zillion of times. Or maybe I've never had Berksfile empty, who knows..

After I've rebuilded vm, and with added cookbook to Berksfile, problem is gone.

Update: oh no, i've trying to reinstall chef-server, and I have this problem again =(

 Bootstraping chef-server ...

knife solo prepare root@chef.chibi.lt
Bootstrapping Chef...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101  6790  101  6790    0     0   8911      0 --:--:-- --:--:-- --:--:-- 25719
Downloading Chef 11.8.0 for el...
Installing Chef 11.8.0
warning: /tmp/tmp.I7qNFxPG/chef-11.8.0.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
Preparing...                ########################################### [100%]
    package chef-11.8.0-1.el6.x86_64 is already installed

 Cooking chef-server ...

knife solo cook root@chef.chibi.lt
Running Chef on chef.chibi.lt...
Checking Chef version...
ERROR: RuntimeError: Couldn't find Chef >=0.10.4 on chef.chibi.lt. Please run `knife solo prepare root@chef.chibi.lt` to ensure Chef is installed and up to date.

UPDATE: This seems to be fixed an issue rpm -evrpm -q chef`

tmatilai commented 10 years ago

My assumption is that an old Chef version is installed on the node either via distro package or more probably via rubygems directly. And then PATH picks up that version before the omnibus package. What do sudo which chef and sudo chef-solo --version print?

If /opt/chef already existed but then vanished that would probably mean that the omnibus "chef" package has been replaced with other (distro's?) chef package.

I'm sorry but I think there is some key information missing here. You can get the debug output of the knife commands by adding -VV option to them.

stevemcquaid commented 10 years ago

I have this same issue. knife solo prepare ; knife solo cook ; provides: " Checking Chef version... ERROR: RuntimeError: Couldn't find Chef >=0.10.4 on IPADDRESS. Please run knife solo prepare root@IPADDRESS to ensure Chef is installed and up to date. "

Then: knife solo bootstrap ; provides: " Running Chef... /usr/local/bin/chef-solo: line 23: /opt/ruby/bin/chef-solo: No such file or directory ERROR: RuntimeError: chef-solo failed. See output above. "

matschaffer commented 10 years ago

@stevemcquaid providing the -VV output should help clear up the source of the issue.