-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chef_zero provisioner fails to load data into chef-zero server #6159
Comments
Hi Tim, What are the contents of your |
The roles directory contains the ruby role definitions (ex: Additionally, here's the layout of where Vagrant places all of the mounted files when using the given Vagrantfile:
|
Hi @drags The Chef Zero provisioner does not support Ruby roles. It never has 😄 - that's your issue. There's at least a few open tickets on the Chef tracker. |
Thanks, that got me going. Pardon the noise |
@sethvargo I've been using the chef-zero provisioner successfully with a ruby role for months, this doesn't seem so plausible. If it never has, why has it been working for me? It's only since Vagrant 1.7.4 and VirtualBox 5 that it breaks. |
there's also nothing obvious on https://github.com/chef/chef/issues?utf8=%E2%9C%93&q=roles+chef-zero+ |
@joelbernstein aside from the fact that I used to work on Chef Zero and many other Chef tools 😄 there are a number of places on the Internet:
Depending on how far down the rabbit hole you go, the issue isn't actually Chef Zero, it's a dependency of zero called ChefFS (Chef File System) that takes files on disk and turns them into a Chef Server. Chef Zero uses this to create a fake Chef Server in memory and then use the disk for persistence. Now, the reason this used to work is that Vagrant was not using Chef Zero before. You can see more information in #5072 and #5619, but basically we were running Chef Solo for the Chef Zero integration since the initial launch. This was fixed in 4b1847a. So, the reason it's been working for you for the past few months is that you weren't actually running Chef Zero. I realize this can be confusing and I apologize for the back-and-forth. |
@sethvargo thank you for the patient response! It hadn't sunk in before but a journey down the rabbit hole (thanks for the very useful links) has been informative. I guess, then, if my Chef code has been working fine for the last few months with the chef-zero provisioner, it must be because it works fine with chef-solo. So I should continue using that, at least until I rewrite my roles as json? |
@joelbernstein it depends on your use case. IMO, you should rewrite them as JSON because they are static data (has nothing to do with Vagrant). That being said, if you want to continue using Ruby, just switch to Solo. If your recipes worked in Vagrant 1.7.3, they don't actually need Chef Zero to run. |
Thanks @sethvargo, that makes good sense. For now I've switched back to -solo but I'd rather be using -zero and will make time to rewrite the roles. Cheers. |
Hey @joelbernstein, I had the same issue, but one thing I found for a quick fixup is:
This will cause knife to "upload" the roles to the local chef-zero server, and the result is that in whatever directory you run the Hope this helps |
Split out of #5339:
I am experiencing issues with the provisioner not loading data into the
chef-zero
server, here's a paste of the (non debug) log output to give some context:If I attempt to run
curl -H "Accept: application/json" localhost:8889/roles
on the box during thechef-client -z
run then I get this output:If I attempt to run
curl -H "Accept: application/json" localhost:8889/cookbooks
during thechef-client -z
run then I get a 0 length response.I was trying to debug from the chef-zero side, and I'm unclear on how this is supposed to work (especially with the
chef_zero
provisioner accepting an array of cookbook paths). From what I can tell chef-zero will allow either 1) serving from a directory which it expects to be a server repo directory (with./roles
../cookbooks
, etc), or 2) act as a local listener whereknife <subcommand> -z
is used to upload items to thechef-zero
server.For reference I've put a full
vagrant up --provision --debug
output here: https://gist.github.com/drags/d6d4c0a7e8b3e13b8bca (oh goodness, I almost posted my AWS keys since vagrant debug output includes fullenv
.. that is.. not a safe default)I've tried both with latest chef as well as 11.18
My Vagrantfile:
I'm running into roadblocks on all fronts trying to debug, all pointers/suggestions greatly appreciated.
Thanks,
Tim
The text was updated successfully, but these errors were encountered: