You can load the handler in the client.rb file so that it catches errors
during the convergence phase. However, after installing the stated
dependancies manually, and adding the necessary bits to the client.rb file,
nothing seems to happen after a chef-client run. I can’t see anything
indicating anything happens in the client.log file.
The document says:
“We recommend using the chef_handler_sns cookbook for easy installation.”
Well, if I use a cookbook to install it, how’s it going to catch any errors
during the convergence phase on the initial chef-client run? Will using the
cookbook allow it to catch errors during the convergence phase os
subsequent chef-client runs?
I think some of your questions are address here About Handlers, but the short version is that you register the handler very early on, and then it executes at the end of
the Chef run.
There is always a chance for failure before the handler is registered, so
you generally want to do those very early on in your run_list.
I'm not sure you will see any output from an exception handler if there are
no errors, but a good way to test this would be to enable this handler: GitHub - jtimberman/chef-handler-updated-resources: Simple Report Handler of Updated Resources. That will
produce visible output of which resources were changed during your Chef run
(while at the same time proving you registered a handler)
On Wed, Sep 23, 2015 at 12:37 PM, Doug Garstang doug@slice.com wrote:
I've tried a number of times to get chef handlers to work. Failed each
time. Thought I'd give it another shot.
You can load the handler in the client.rb file so that it catches errors
during the convergence phase. However, after installing the stated
dependancies manually, and adding the necessary bits to the client.rb file,
nothing seems to happen after a chef-client run. I can't see anything
indicating anything happens in the client.log file.
The document says:
"We recommend using the chef_handler_sns cookbook for easy installation."
Well, if I use a cookbook to install it, how's it going to catch any
errors during the convergence phase on the initial chef-client run? Will
using the cookbook allow it to catch errors during the convergence phase os
subsequent chef-client runs?
Thanks David. I'm going to have to dump it yet again. Nokogiri, which is a
dependency of the sns handler cookbook fails to build.
NoMethodError
chef_gem[chef-handler-sns]
(/var/chef/cache/cookbooks/chef_handler_sns/providers/default.rb line 93)
had an error: NoMethodError: undefined method `full_name' for nil:NilClass
I think some of your questions are address here About Handlers, but the short version is that you register the handler very early on, and then it executes at the end of
the Chef run.
There is always a chance for failure before the handler is registered, so
you generally want to do those very early on in your run_list.
I'm not sure you will see any output from an exception handler if there
are no errors, but a good way to test this would be to enable this handler: GitHub - jtimberman/chef-handler-updated-resources: Simple Report Handler of Updated Resources. That will
produce visible output of which resources were changed during your Chef run
(while at the same time proving you registered a handler)
On Wed, Sep 23, 2015 at 12:37 PM, Doug Garstang doug@slice.com wrote:
I've tried a number of times to get chef handlers to work. Failed each
time. Thought I'd give it another shot.
You can load the handler in the client.rb file so that it catches errors
during the convergence phase. However, after installing the stated
dependancies manually, and adding the necessary bits to the client.rb file,
nothing seems to happen after a chef-client run. I can't see anything
indicating anything happens in the client.log file.
The document says:
"We recommend using the chef_handler_sns cookbook for easy installation."
Well, if I use a cookbook to install it, how's it going to catch any
errors during the convergence phase on the initial chef-client run? Will
using the cookbook allow it to catch errors during the convergence phase os
subsequent chef-client runs?
Well, if I use a cookbook to install it, how's it going to catch any errors
during the convergence phase on the initial chef-client run? Will using the
cookbook allow it to catch errors during the convergence phase os
subsequent chef-client runs?
No, IIRC the cookbook does not catch convergence phase errors. The cookbook is
to install the gem and its dependencies easily. Then calls the chef_handler
resource with all its limitations:
It's pretty simple.
Nokogiri, which is a dependency of the sns handler cookbook fails to build.
NoMethodError
chef_gem[chef-handler-sns]
(/var/chef/cache/cookbooks/chef_handler_sns/providers/default.rb line 93)
had an error: NoMethodError: undefined method `full_name' for nil:NilClass
Please, open an issue here with all the information you can provide:
"This method will not catch errors before the convergence phase"
That won't cover convergence errors on the very first run, after my
bootstrap process adds the correct pieces to the client.rb file, but before
the cookbook installs all the dependancies for the very first time. Correct?
Doug.
On Wed, Sep 23, 2015 at 11:18 AM, Xabier de Zuazo xabier@zuazo.org wrote:
Hi Doug,
On 2015-09-23 09:37, Doug Garstang wrote:
Well, if I use a cookbook to install it, how's it going to catch any
errors
during the convergence phase on the initial chef-client run? Will using
the
cookbook allow it to catch errors during the convergence phase os
subsequent chef-client runs?
No, IIRC the cookbook does not catch convergence phase errors. The
cookbook is
to install the gem and its dependencies easily. Then calls the chef_handler
resource with all its limitations:
Nokogiri, which is a dependency of the sns handler cookbook fails to
build.
NoMethodError
chef_gem[chef-handler-sns]
(/var/chef/cache/cookbooks/chef_handler_sns/providers/default.rb line 93)
had an error: NoMethodError: undefined method `full_name' for
nil:NilClass
Please, open an issue here with all the information you can provide:
"This method will not catch errors before the convergence phase"
That won't cover convergence errors on the very first run, after my
bootstrap process adds the correct pieces to the client.rb file, but before
the cookbook installs all the dependancies for the very first time. Correct?
That's right. But you need to add that code to the client.rb yourself.
I think you left out the end of my reply:
On 2015-09-23 20:18, Xabier de Zuazo wrote:
Please, open an issue here with all the information you can provide: