[chef] Re: Re: Re: Re: "chef-client -z" can not find my node


Chronological Thread 
  • From: John Ewart < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: "chef-client -z" can not find my node
  • Date: Thu, 18 Sep 2014 14:54:40 -0700

I believe the issue you are encountering now is that your role file is named was_v85_role.rb. As Lamont suggested, it should be was_v85_role.json and contain JSON data.

-John

On Thu, Sep 18, 2014 at 1:59 PM, DV < "> > wrote:
>
> I never used chef-zero, but you named the role file was_v85_role.rb, I guess it should be named was_v85.rb
>
> On Thu, Sep 18, 2014 at 1:03 PM, Roberto Ferreira Junior < "> > wrote:
>>
>> Hi Lamont, I already have this role created on the file system, the error still the same.
>>
>> chef]# cat roles/was_v85_role.rb
>> run_list("recipe[was_v85]")
>>
>> The command that I mentioned is a call of an application, I can't change the structure for a while.
>>
>> chef]# chef-client --local-mode -c client.rb -j  nodes/was_v85_node.json -N was_v85
>>
>> I need to change this command from chef-solo to chef-zero to apply the ssl features that are not included on chef solo.
>>
>>
>>
>> chef]# chef-client --local-mode -c client.rb -j nodes/was_v85_node.json -N was_v85
>> [2014-09-18T15:55:34-04:00] INFO: Starting chef-zero on host localhost, port 8889 with repository at repository at /devops/common/chef
>>   One version per cookbook
>>   roles at /devops/commom/chef/roles
>>
>> [2014-09-18T15:55:34-04:00] INFO: Forking chef instance to converge...
>> Starting Chef Client, version 11.14.2
>> [2014-09-18T15:55:34-04:00] INFO: *** Chef 11.14.2 ***
>> [2014-09-18T15:55:34-04:00] INFO: Chef-client pid: 3910
>> [2014-09-18T15:55:38-04:00] INFO: Setting the run_list to ["role[was_v85_role]"] from CLI options
>> [2014-09-18T15:55:38-04:00] INFO: HTTP Request Returned 404 Not Found : Object not found: http://localhost:8889/roles/was_v85_role
>>
>> ================================================================================
>> Error expanding the run_list:
>> ================================================================================
>>
>> Unexpected API Request Failure:
>> -------------------------------
>> Object not found: http://localhost:8889/roles/was_v85_role
>>
>> [2014-09-18T15:55:38-04:00] FATAL: Stacktrace dumped to /tmp/chef-client/chef-stacktrace.out
>> Chef Client failed. 0 resources updated in 3.728979373 seconds
>> [2014-09-18T15:55:38-04:00] ERROR: 404 "Not Found "
>> [2014-09-18T15:55:38-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>
>>    
>>
>> Muito obrigado,
>>
>> --
>> Roberto Ferreira Junior
>> ">
>> + 55 11 952335115
>>
>> On Thu, Sep 18, 2014 at 4:08 PM, Lamont Granquist < "> > wrote:
>>>
>>>
>>> chef-client -z gets data from the file system via the chef-zero server that gets spun up on localhost:8889.  the behavior you are seeing is working as designed.
>>>
>>> you need to add a roles/was_v85_role.json file and then your run will converge.
>>>
>>> you also don't have to pass the -j option on the command line.  you might, however, want to create a separate dna.json file and invoke it with "-j dna.json" which has the same contents.  the chef-zero server will then create the nodes/was_v85_node.json file and save the updated node there at the end of the run_list.   if you don't want chef-zero to overwrite your json file with the updated node contents, then use "-j dna.json" instead.
>>>
>>>
>>> On 9/18/14, 10:53 AM, Roberto Ferreira Junior wrote:
>>>
>>> Hi,
>>>
>>>      I have tried to execute my cookbook using this command:
>>>    
>>>         chef]# chef-client --local-mode -c client.rb -j  nodes/was_v85_node.json -N was_v85
>>>
>>>      This is my node declaration called by the chef execution:
>>>
>>>         {"run_list":["role[was_v85_role]"]}
>>>
>>>      I have received this message:
>>>
>>>          [2014-09-18T13:14:30-04:00] INFO: Forking chef instance to converge...
>>>         Starting Chef Client, version 11.14.2
>>>         [2014-09-18T13:14:30-04:00] INFO: *** Chef 11.14.2 ***
>>>         [2014-09-18T13:14:30-04:00] INFO: Chef-client pid: 2040
>>>         [2014-09-18T13:14:33-04:00] INFO: Setting the run_list to ["role[was_v85_role]"] from CLI options
>>>         [2014-09-18T13:14:33-04:00] INFO: HTTP Request Returned 404 Not Found : Object not found: http://localhost:8889/roles/was_v85_role
>>>
>>>         ==============================
>>> ==================================================
>>>         Error expanding the run_list:
>>>         ================================================================================
>>>
>>>         Unexpected API Request Failure:
>>>         -------------------------------
>>>         Object not found: http://localhost:8889/roles/was_v85_role  ( I REALLY DON'T NEED THIS DATA COMING FROM THE API I JUST TO GET THE NODE FROM DE FS)
>>>
>>>         [2014-09-18T13:14:33-04:00] FATAL: Stacktrace dumped to /tmp/chef-client/chef-stacktrace.out
>>>         Chef Client failed. 0 resources updated in 3.514151 seconds
>>>         [2014-09-18T13:14:33-04:00] ERROR: 404 "Not Found "
>>>         [2014-09-18T13:14:33-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>
>>>     I would like figure out why my role declaration inside my node isn't working
>>>        
>>>         Here's my client.rb declaration:
>>>
>>>         chef]# cat client.rb
>>>         CHEF_DIR = File.expand_path(File.dirname(__FILE__))
>>>         file_cache_path "/tmp/chef-client"
>>>         role_path "/devops/commom/chef/roles"
>>>         #role_path CHEF_DIR + "/devops/commom/chef/roles"
>>>         environment_path CHEF_DIR + "/environments"
>>>         data_bag_path CHEF_DIR + "/data_bags"
>>>         cookbook_path CHEF_DIR + "/cookbooks"
>>>
>>>         ssl_client_cert CHEF_DIR + "/.ssl/client.crt"
>>>         ssl_client_key  CHEF_DIR + "/.ssl/client.key"
>>>         ssl_verify_mode :verify_peer
>>>
>>>         #LOG
>>>         log_level:info
>>>    
>>>  
>>>     It works pretty well with chef solo, but not with "chef-client -local--mode", any suggestion?
>>>
>>> Muito obrigado,
>>>
>>> --
>>> Roberto Ferreira Junior
>>> ">
>>> + 55 11 952335115
>>>
>>>
>>
>
>
>
> --
> Best regards, Dmitriy V.




Archive powered by MHonArc 2.6.16.

§