[chef] Re: Re: ERROR: No socketless chef-zero server


Chronological Thread 
  • From: Christine Draper < >
  • To:
  • Subject: [chef] Re: Re: ERROR: No socketless chef-zero server
  • Date: Mon, 4 May 2015 14:41:21 -0500

Daniel,

I don't think there's a bug. Just user error. I finally figured it out.

The way I typically run is I spin up one or more VMs on a private network in VirtualBox with IPs like 10.0.5.x, and then I run chef-zero on that private network e.g. using chef-zero -H10.0.5.1 

I then run knife bootstrap 10.0.5.x --sudo -xuser -Ppassword

So I am NOT using local mode and do need sockets.

What happened was I accidentally put a server URL of https://10.0.5.1:8899 rather than http://10.0.5.1:8899

I then got into SSL validation problems, which of course I couldnt solve using 'knife ssh fetch' because chef-zero doesn't do certificates. I wrongly latched onto 'chef-zero.enabled true' as the answer, not realizing that it overrode my server URL and ran in local mode. Which of course meant the bootstrap didnt work (or at least, the chef client run as part of the bootstrap didnt). As an aside: is there a way to do bootstrap from knife in local mode?

Anyway,when I fixed the server URL to "http://10.0.5.1:8899" and removed 'chef-zero.enabled true',  its all fine again.

Regards,
Christine

On Mon, May 4, 2015 at 12:36 PM, Daniel DeLeo < " target="_blank"> > wrote:


On Saturday, May 2, 2015 at 2:41 PM, Christine Draper wrote:

> I'm getting the following using chef-client 12.3 with chef-zero 4.2.1:
>
> ERROR: No socketless chef-zero server on given port 8889
First, a bit of background on the socketless Chef Zero stuff. In any version of Chef with local mode, when you run `chef-client -z` or `knife -z`, it runs some code that asks Chef Zero to start, and then asks Chef Zero what URL to use to connect to it. It then sets `Chef::Config[:chef_server_url]` to the given URL. Before Chef 12.3, this URL would be http://localhost:8889 (usually). In Chef 12.3, socketless mode was introduced. Chef Zero still runs in a background thread and listens for connections on localhost:8889 by default (unless you use the `—no-listen` option), but internally chef/knife will ask Chef Zero for a “socktless mode URL”, which will be something like “chefzero://localhost:8889”. When Chef/knife makes an HTTP request, it checks the URL scheme, and if it’s “chefzero” then it follows a different code path to make the “request” just by calling ruby code and not actually using HTTP.

>
> I have a centos VM running under Vagrant, on a private network. I then run chef-zero on the same private network:
>
> chef-zero -H 10.0.5.1
>
> And use knife to bootstrap. The run fails when trying to create the client with the following stacktrace:
>
> ChefZero::ServerNotFound: No socketless chef-zero server on given port 8889
What are the exact arguments you’re using with `knife bootstrap` ? Based on the behavior you’re seeing, it does seem like you’re running `knife bootstrap` with local mode enabled. But then I am confused about how this would have worked before, since the chef_server_url for knife would have to have been http://localhost:8889. But that doesn’t make sense because then how would chef-client on the bootstrap machine talk to the other chef-zero you’re spinning up?

> /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.2.1/lib/chef_zero/socketless_server_map.rb:78:in `request'
> /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-zero-4.2.1/lib/chef_zero/socketless_server_map.rb:33:in `request'
> /opt/chef/embedded/apps/chef/lib/chef/http/socketless_chef_zero_client.rb:153:in `request'
> <snip>
>
> I tried running chef-client with both --no-listen and --listen, but got the same error in both cases.
>
> Any ideas?
>
> Thanks,
> Christine Draper

Since the socketless operation is a new feature, it’s definitely possible there’s a bug here, but I’ll need to know more about your configuration to see how things are supposed to be working.

Thanks,

--
Daniel DeLeo







Archive powered by MHonArc 2.6.16.

§