Sadhan
Sadhan

Reputation: 15

Error: command 'chef-client -l info' exited with code 1

I am using chef to create a basic vm in vcenter. Its able to create the vm uisng chef provisioning driver, But the chef-client is throwing errors.

errors:

`Executing chef-client -l info on root@ipadddress

[Centos] [2015-08-04T11:21:54-04:00] INFO: Forking chef instance to converge...

              Starting Chef Client, version 12.4.1[0m

              [2015-08-04T11:21:54-04:00] INFO: *** Chef 12.4.1 ***

              [2015-08-04T11:21:54-04:00] INFO: Chef-client pid: 9394

              [2015-08-04T11:21:57-04:00] INFO: Run List is [recipe[vmware::machines]]

              [2015-08-04T11:21:57-04:00] INFO: Run List expands to [vmware::machines]

              [2015-08-04T11:21:57-04:00] INFO: Starting Chef Run for Centos

              [2015-08-04T11:21:57-04:00] INFO: Running start handlers

              [2015-08-04T11:21:57-04:00] INFO: Start handlers complete.

              [2015-08-04T11:21:57-04:00] INFO: HTTP Request Returned 404 Not Found : Object not found: /reports/nodes/Centos/runs

              resolving cookbooks for run list: ["vmware::machines"][0m

              [2015-08-04T11:22:02-04:00] INFO: Loading cookbooks [[email protected], [email protected], [email protected]]

              Synchronizing Cookbooks:[0m

                - vmware[0m

                - xyz-base-cookbook[0m

                - chef-sugar[0m

              Compiling Cookbooks...[0m

              [0m

              ================================================================================[0m

              [31mRecipe Compile Error[0m

              ================================================================================[0m



              [0mChef::Exceptions::RecipeNotFound[0m

              --------------------------------[0m

              could not find recipe machines for cookbook vmware[0m



              [0m[0m

              Running handlers:[0m

              [2015-08-04T11:22:03-04:00] ERROR: Running exception handlers

              Running handlers complete

              [0m[2015-08-04T11:22:03-04:00] ERROR: Exception handlers complete

              Chef Client failed. 0 resources updated in 8.948866571 seconds[0m

              [2015-08-04T11:22:03-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

              [2015-08-04T11:22:03-04:00] ERROR: could not find recipe machines for cookbook vmware

              [2015-08-04T11:22:03-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

[2015-08-04T10:22:03-05:00] INFO: Completed chef-client -l info on root@ipaddress: exit status 1

================================================================================
Error executing action `converge` on resource 'machine[Centos]'
================================================================================

RuntimeError
------------
Error: command 'chef-client -l info' exited with code 1.

Resource Declaration:
---------------------
# In C:/Users/xyz/.chef/local-mode-cache/cache/cookbooks/vmware-machines/recipes/machines.rb

 36: machine "Centos" do
 37:    #run_list ['vmware::machines']
 38: end

Compiled Resource:
------------------
# Declared in C:/Users/xyz/.chef/local-mode-cache/cache/cookbooks/vmware-machines/recipes/machines.rb:36:in `from_file'

machine("Centos") do
  action :converge
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  chef_server {:chef_server_url=>"chefzero://localhost:8889", :options=>{:client_name=>"chef-local", :signing_key_filename=>"C:\\eclipse\\xyz\\workspace\\xyz\\vmware\\target\\.chef\\dummy.pem"}}
  driver "vsphere://vcenter-01.xyz.xyz.com/sdk?use_ssl=true&insecure=true"
  machine_options {:bootstrap_options=>{:use_linked_clone=>true, :num_cpus=>2, :memory_mb=>4096, :network_name=>["VM Network"], :datacenter=>"Sandbox", :datastore=>"Datastore_Esx2", :resource_pool=>"Box-Cluster", :template_name=>"Template", :template_folder=>"Templates/", :customization_spec=>{:ipsettings=>{:dnsServerList=>["xyz"]}, :domain=>"xyz"}, :ssh=>{:user=>"root", :password=>"password", :paranoid=>false}}}
  declared_type :machine
  cookbook_name "vmware-machines"
  recipe_name "machines"
end

[2015-08-04T10:22:03-05:00] INFO: Running queued delayed notifications before re-raising exception `

Upvotes: 0

Views: 1295

Answers (1)

JackChance
JackChance

Reputation: 520

Ah, the error is actually that it can't find your recipe, machines. The public version contains a default and a tools recipe. If you have a local copy that you modified you need to make sure that it is uploaded to your chef-server so that the chef-client doesn't look at the public supermarket for the cookbook by the same name.

Or better yet prepend your organization name to the cookbook to make the difference more clear, such as

<yourorgname>_vmware

As a side note, -l info will only display information level logger output. You probably want to do either just chef-client or -l debug depending on how much information you want spat out at you.

Upvotes: 1

Related Questions