chef-hipchat icon indicating copy to clipboard operation
chef-hipchat copied to clipboard

Issue with handler recipe with chef-client 12.7.2

Open akhan002 opened this issue 9 years ago • 0 comments

When converging a cookbook using the hipchat resource the converge fails with the error below. This is using chef-client 12.7.2. This doesn't seem to affect chef-client 12.6 or below. Tested using Vagrant with CentOS 6.6.

https://github.com/cwjohnston/chef-hipchat/blob/master/recipes/handler.rb#L38

Recipe: hipchat::handler (up to date) * cookbook_file[/tmp/kitchen/handlers/hipchat.rb] action create

       ================================================================================
       Error executing action `create` on resource 'cookbook_file[/tmp/kitchen/handlers/hipchat.rb]'
       ================================================================================

       TypeError
       ---------
       no implicit conversion of Chef::DelayedEvaluator into String

       Cookbook Trace:
       ---------------
       /tmp/kitchen/cache/cookbooks/hipchat/recipes/handler.rb:38:in `from_file'

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/hipchat/recipes/handler.rb

        32: cookbook_file handler_file do
        33:   source 'handler.rb'
        34:   owner 'root'
        35:   group 'root'
        36:   mode '644'
        37:   action :nothing
        38: end.run_action(:create)
        39:
        40: handler = node['hipchat']['handler']
        41: handler_options = {
        42:   :server_url => handler['server'],
        43:   :name => handler['name'],
        44:   :notify_users => handler['notify_users'],
        45:   :color => handler['color'],
        46:   :api_version => handler['api_version']
        47: }
        48:
        49: chef_handler 'HipChat::NotifyRoom' do
        50:   source handler_file
        51:   supports({:exception => true})
        52:   arguments [ handler['token'], handler['room'], handler_options ]
        53:   action :nothing
        54: end.run_action(node['hipchat']['handler']['enabled'] ? :enable : :disable)

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/hipchat/recipes/handler.rb:32:in `from_file'

       cookbook_file("/tmp/kitchen/handlers/hipchat.rb") do
         provider Chef::Provider::CookbookFile
         action [:nothing]
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         source "handler.rb"
         declared_type "cookbook_file"
         cookbook_name "hipchat"
         recipe_name "handler"
         owner "root"
         group "root"
         mode "644"
         atomic_update #<Chef::DelayedEvaluator:0x00000003984970@/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/resource/file.rb:52>
         path #<Chef::DelayedEvaluator:0x00000003985a50@/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/property.rb:177>
       end


     TypeError
     ---------
     cookbook_file[/tmp/kitchen/handlers/hipchat.rb] (hipchat::handler line 32) had an error: TypeError: no implicit conversion of Chef::DelayedEvaluator into String

     Cookbook Trace:
     ---------------
       /tmp/kitchen/cache/cookbooks/hipchat/recipes/handler.rb:38:in `from_file'

     Relevant File Content:
     ----------------------
     /tmp/kitchen/cache/cookbooks/hipchat/recipes/handler.rb:

      31:
      32:  cookbook_file handler_file do
      33:    source 'handler.rb'
      34:    owner 'root'
      35:    group 'root'
      36:    mode '644'
      37:    action :nothing
      38>> end.run_action(:create)
      39:
      40:  handler = node['hipchat']['handler']
      41:  handler_options = {
      42:    :server_url => handler['server'],
      43:    :name => handler['name'],
      44:    :notify_users => handler['notify_users'],
      45:    :color => handler['color'],
      46:    :api_version => handler['api_version']
      47:  }


     Running handlers:
   [2016-02-29T08:42:31+00:00] ERROR: Running exception handlers
     Running handlers complete
   [2016-02-29T08:42:31+00:00] ERROR: Exception handlers complete

akhan002 avatar Feb 29 '16 08:02 akhan002