[chef] Re: Re: Re: Re: Re: Supervisor missing templates


Chronological Thread 
  • From: Liam Kirsher < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Supervisor missing templates
  • Date: Tue, 22 Jul 2014 03:26:26 -0700
  • Openpgp: id=7011F7B7; url=http://liam.numenet.com/pgp/

Yes, that's true.  I'm pretty sure the reason it won't start is because the file does not get created from the template.  Could be wrong, but...
Looking at the code, the providers/service.rb line 72 is where the problem is in the traceback, so the current_resource.state value is 'UNAVAILABLE'.
The :enable action has been called, and it calls enable_service, which is where the template lwrp is.  It references program.conf.erb.  Since that doesn't seem to exist anywhere (I was expecting it in /var/chef/cache/cookbooks/supervisor/templates/) I don't see how supervisor can start.   This would seem to explain it -- but leaves the question, why is the template not available?

Don't know if this is relevant, but...  this is my code:
attributes
default[:main][:jobs] = %w[
  job_activity_search
  job_user_call_log
]

In recipe
app_name = 'main'
app_node = node[app_name]
jobs = app_node[:jobs]
<snip>

jobs.each do |job|
  supervisor_service "#{job}" do
    command "#{virtual_env_dir}/bin/python #{virtual_env_dir}/#{jobs_path}/#{job}.py"
    process_name "#{job}-%(process_num)s"
    action [:enable, :restart]
    autostart true
    autorestart true
    user "root"
    numprocs 1
  end



On 07/21/2014 07:32 PM, AJ Christensen wrote:
" type="cite">
The stack-trace in OP is not a template resource.

"Supervisor service job_activity_search cannot be restarted because it
does not exist"

Perhaps :create needs to be called before :enable/:restart. I'm not
familiar with the supervisor cookbook.

111:     action [:enable, :restart]

One might anticipate :enable to call :create, but  would have to dig
into the supervisor (L|H)WRP itself, to find out!

Cheers,

AJ

On Tue, Jul 22, 2014 at 2:30 PM, Ben Bytheway 
 
 "><
 > wrote:
Yes, the chef run fails with an error that the template cannot be found, even when specifying the cookbook where the template is located in the resource call.

On Jul 21, 2014, at 8:09 PM, Daniel DeLeo 
 
 "><
 > wrote:

On Monday, July 21, 2014 at 6:59 PM, Ben Bytheway wrote:
I have also seen this behavior, but haven't gotten to the bottom of it. If I knife download my cookbook, the template is there, but chef-client doesn't get it. Isn't in /var/chef/cache at all.

Templates are downloaded on demand, as they are used by resources. If you never use them, then chef doesn’t download them. If I remember correctly, there might also be a small bug where templates that are used can be removed at the end of a chef-client run (but they’re downloaded the next time so it’s just wasting a bit of IO). Have you seen a cookbook fail to execute for this reason?

Also, if you just don’t like this behavior, you can configure `no_lazy_load true` to make chef-client fetch all templates (and cookbook files, which have the same behavior) eagerly.

FWIW, eager load will be the default in Chef 12 since the URLs to fetch the files are time-limited and on long chef-client runs (an hour or more), the URLs expire and cause errors.

--
Daniel DeLeo


    

-- 
Liam Kirsher
PGP: http://liam.numenet.com/pgp/



Archive powered by MHonArc 2.6.16.

§