chef / chef-zero

Simple, easy-run, fast-start in-memory Chef server for testing and solo purposes
Apache License 2.0
532 stars 98 forks source link

Unable to connect to chef-zero #246

Closed snehitgajjar closed 7 years ago

snehitgajjar commented 8 years ago

System: Ubuntu1404

chef_config_file:

chef_server_url   'http://127.0.0.1:4000'
node_name         'bcr-node'
client_key        '/etc/chef/client.pem'
validation_key '/etc/chef/validator.pem'

Code snippet:

def self.set_up_server(chef_objects)
  require 'chef_zero/server'
  require 'ridley'
    @server = ChefZero::Server.new({host: ['127.0.0.1'], port: 4000})
    @server.start_background

    # create the chef server objects in the chef zero server
    fixture_dir = File.expand_path('..', File.dirname(__FILE__))

    puts "======#{fixture_dir}"
    chef_config_file = '/etc/chef/client.rb'

    puts "=====#{File.readlines('/etc/chef/client.rb')}"
    ridley = Ridley.from_chef_config(chef_config_file)

    chef_objects['environments'].each { |env| ridley.environment.create env }

    chef_objects['nodes'].each { |node| ridley.node.create node }

    puts "========#{@server.running?}"
  end

Error message:

ERROR: Connection refused connecting to http://127.0.0.1:4000/search/node?q=*:*&sort=X_CHEF_id_CHEF_X%20asc&start=0, retry 1/5
thommay commented 7 years ago

Thanks for filing a GitHub Issue.

At Chef, we use GitHub Issues to track bugs and feature requests. Questions like "How do I .... with Chef?" are better answered by our awesome community on the Chef mailing lists, or on StackOverflow. (Please pick only one place to ask your question, however, as it's considered impolite to post the same question to multiple forums.)

You can find information about joining and asking questions on our mailing lists here. On StackOverflow, please tag your question with the "chef" label so that it shows up in this list.

We will be closing your issue. Please get in touch with the community via the above mechanisms in order to find a solution to your problem.