sensu / sensu-chef

Sensu Chef cookbook.
https://supermarket.chef.io/cookbooks/sensu
Apache License 2.0
221 stars 280 forks source link

Sensu installation fails due to rabbitmq cookbook #628

Open rajiv-g opened 5 years ago

rajiv-g commented 5 years ago
Chef::Exceptions::ResourceNotFound
  ----------------------------------
  Cannot find a resource matching template[/etc/rabbitmq/rabbitmq.config] (did you define it first?)

  Cookbook Trace:
  ---------------
    /var/cache/chef/cookbooks/sensu/recipes/rabbitmq.rb:88:in `block in from_file'
    /var/cache/chef/cookbooks/sensu/recipes/rabbitmq.rb:85:in `from_file'
    /var/cache/chef/cookbooks/wrapper_sensu_cookbook/recipes/rabbitmq.rb:17:in `from_file'

  Relevant File Content:
  ----------------------
  /var/cache/chef/cookbooks/sensu/recipes/rabbitmq.rb:

   81:  
   82:  include_recipe "rabbitmq"
   83:  include_recipe "rabbitmq::mgmt_console"
   84:  
   85:  service "restart #{node["rabbitmq"]["service_name"]}" do
   86:    service_name node["rabbitmq"]["service_name"]
   87:    action :nothing
   88>>   subscribes :restart, resources("template[#{node['rabbitmq']['config_root']}/rabbitmq.config]"), :immediately
   89:  end
   90:  
   91:  rabbitmq = node["sensu"]["rabbitmq"].to_hash
   92:  
   93:  config_item = node["sensu"]["data_bag"]["config_item"]
   94:  sensu_config = Sensu::Helpers.data_bag_item(config_item, true, data_bag_name)
   95:  
   96:  if sensu_config && sensu_config["rabbitmq"].is_a?(Hash)
   97:    rabbitmq = Chef::Mixin::DeepMerge.merge(rabbitmq, sensu_config["rabbitmq"])

  Platform:
  ---------
  x86_64-linux

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment

majormoses commented 5 years ago

Hey I took a quick look at it looks to be caused by: https://github.com/rabbitmq/chef-cookbook/pull/505 I believe you should be able to pin the version of the rabbitmq cookbook in your wrapper to: 5.6.1 I have not had a chance to look at what a fix looks like as we need to be careful to not break any existing setups that use prior versions before this change happened. Since we loosely pin our versions there are likely people running multiple versions.

michaelklishin commented 5 years ago

Instead of pinning to 5.6.1, use 5.7.2 (or 5.7.3 which is about to be shipped) and configure RabbitMQ version to 3.7.13.

RabbitMQ 3.6.x has been out of support and RabbitMQ Chef cookbook 5.7.x is the last series that supports it in any capacity.

michaelklishin commented 5 years ago

This can be closed as a duplicate of https://github.com/rabbitmq/chef-cookbook/issues/506.