Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Issue with handler recipe with chef-client 12.7.2 #19

Open
akhan002 opened this issue Feb 29, 2016 · 0 comments
Open

Issue with handler recipe with chef-client 12.7.2 #19

akhan002 opened this issue Feb 29, 2016 · 0 comments

Comments

@akhan002
Copy link

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant