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

sensu installation fails due to rabbitmq cookbook

Open ff-pjha opened this issue 7 years ago • 5 comments

Recipe: sensu::rabbitmq * group[rabbitmq] action create - create group rabbitmq * directory[/etc/rabbitmq/ssl] action create - create new directory /etc/rabbitmq/ssl - change mode from '' to '0755' * file[/etc/rabbitmq/ssl/cacert.pem] action create - create new file /etc/rabbitmq/ssl/cacert.pem - update content in file /etc/rabbitmq/ssl/cacert.pem from none to 704c98 - suppressed sensitive resource - change mode from '' to '0640' - change group from '' to 'rabbitmq' * file[/etc/rabbitmq/ssl/cert.pem] action create - create new file /etc/rabbitmq/ssl/cert.pem - update content in file /etc/rabbitmq/ssl/cert.pem from none to 3d6db7 - suppressed sensitive resource - change mode from '' to '0640' - change group from '' to 'rabbitmq' * file[/etc/rabbitmq/ssl/key.pem] action create - create new file /etc/rabbitmq/ssl/key.pem - update content in file /etc/rabbitmq/ssl/key.pem from none to c79a15 - suppressed sensitive resource - change mode from '' to '0640' - change group from '' to 'rabbitmq' * directory[/etc/rabbitmq/ssl/client] action create - create new directory /etc/rabbitmq/ssl/client - change mode from '' to '0755' * file[/etc/rabbitmq/ssl/client/cert.pem] action create - create new file /etc/rabbitmq/ssl/client/cert.pem - update content in file /etc/rabbitmq/ssl/client/cert.pem from none to 4092c4 - suppressed sensitive resource - change mode from '' to '0640' - change group from '' to 'rabbitmq' * file[/etc/rabbitmq/ssl/client/key.pem] action create - create new file /etc/rabbitmq/ssl/client/key.pem - update content in file /etc/rabbitmq/ssl/client/key.pem from none to 53aa46 - suppressed sensitive resource - change mode from '' to '0640' - change group from '' to 'rabbitmq' Recipe: rabbitmq::default * directory[/var/lib/rabbitmq/mnesia] action create * cannot determine user id for 'rabbitmq', does the user exist on this system? ================================================================================ Error executing action create on resource 'directory[/var/lib/rabbitmq/mnesia]' ================================================================================

       Chef::Exceptions::UserIDNotFound
       --------------------------------
       cannot determine user id for 'rabbitmq', does the user exist on this system?
       
       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/rabbitmq/recipes/default.rb
       
       206: directory node['rabbitmq']['mnesiadir'] do
       207:   owner 'rabbitmq'
       208:   group 'rabbitmq'
       209:   mode '775'
       210:   recursive true
       211: end
       212: 
       
       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/rabbitmq/recipes/default.rb:206:in `from_file'
       
       directory("/var/lib/rabbitmq/mnesia") do
         action [:create]
         default_guard_interpreter :default
         path "/var/lib/rabbitmq/mnesia"
         recursive true
         declared_type :directory
         cookbook_name "rabbitmq"
         recipe_name "default"
         owner "rabbitmq"
         group "rabbitmq"
         mode "775"
       end
       
       System Info:
       ------------
       chef_version=13.6.0
       platform=amazon
       platform_version=2017.09
       ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
       program_name=chef-client worker: ppid=2938;start=05:36:48;
       executable=/opt/chef/bin/chef-client
       
   Recipe: sensu::default
     * ruby_block[sensu_service_trigger] action create
       - execute the ruby block sensu_service_trigger
   
   Running handlers:
   [2017-10-31T05:37:05+00:00] ERROR: Running exception handlers
   [2017-10-31T05:37:05+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2017-10-31T05:37:05+00:00] ERROR: Exception handlers complete
   [2017-10-31T05:37:05+00:00] ERROR: Exception handlers complete
   Chef Client failed. 28 resources updated in 16 seconds
   [2017-10-31T05:37:05+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2017-10-31T05:37:05+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2017-10-31T05:37:05+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-10-31T05:37:05+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-10-31T05:37:05+00:00] ERROR: directory[/var/lib/rabbitmq/mnesia] (rabbitmq::default line 206) had an error: Chef::Exceptions::UserIDNotFound: cannot determine user id for 'rabbitmq', does the user exist on this system?
   [2017-10-31T05:37:05+00:00] ERROR: directory[/var/lib/rabbitmq/mnesia] (rabbitmq::default line 206) had an error: Chef::Exceptions::UserIDNotFound: cannot determine user id for 'rabbitmq', does the user exist on this system?
   [2017-10-31T05:37:05+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
   [2017-10-31T05:37:05+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Do we need to pass the user explicitly from our recipe ? Why this is required?

ff-pjha avatar Oct 31 '17 05:10 ff-pjha

I am having a amazon machine which is equivalent to RHEL/Centos 6. In my own cookbook I have made the dependency of sensu cookbook for server and rabbitmq recipe. But then also it not compiling. Why we should explicitly pass any value or change any thing for user. If I add user explicitly as user "rabbitmq" from my cookbook, then its throws Recipe: sensu::rabbitmq * service[restart rabbitmq-server] action restart * service[restart rabbitmq-server]: No custom command for restart specified and unable to locate the init.d script! ================================================================================ Error executing action restart on resource 'service[restart rabbitmq-server]' ================================================================================

       Chef::Exceptions::Service
       -------------------------
       service[restart rabbitmq-server]: No custom command for restart specified and unable to locate the init.d script!
       
       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/sensu/recipes/rabbitmq.rb
       
        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: 
       
       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/sensu/recipes/rabbitmq.rb:85:in `from_file'
       
       service("restart rabbitmq-server") do
         action [:nothing]
         default_guard_interpreter :default
         service_name "rabbitmq-server"
         enabled nil
         running nil
         masked nil
         pattern "restart rabbitmq-server"
         declared_type :service
         cookbook_name "sensu"
         recipe_name "rabbitmq"
       end
       
       System Info:
       ------------
       chef_version=13.6.0
       platform=amazon
       platform_version=2017.09
       ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
       program_name=chef-client worker: ppid=2917;start=09:13:34;
       executable=/opt/chef/bin/chef-client
       
   Recipe: rabbitmq::default
     * service[rabbitmq-server] action restart
       * service[rabbitmq-server]: No custom command for restart specified and unable to locate the init.d script!
       ================================================================================
       Error executing action `restart` on resource 'service[rabbitmq-server]'
       ================================================================================
       
       Chef::Exceptions::Service
       -------------------------
       service[rabbitmq-server]: No custom command for restart specified and unable to locate the init.d script!
       
       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/rabbitmq/recipes/default.rb
       
       275:   service node['rabbitmq']['service_name'] do
       276:     retries node['rabbitmq']['retry']
       277:     retry_delay node['rabbitmq']['retry_delay']
       278:     action [:enable, :start]
       279:     supports :status => true, :restart => true
       280:     provider Chef::Provider::Service::Upstart if node['rabbitmq']['job_control'] == 'upstart'
       281:     provider Chef::Provider::Service::Init if node['rabbitmq']['job_control'] == 'init'
       282:   end
       283: else
       
       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/rabbitmq/recipes/default.rb:275:in `from_file'
       
       service("rabbitmq-server") do
         action [:enable, :start]
         default_guard_interpreter :default
         service_name "rabbitmq-server"
         enabled nil
         running nil
         masked nil
         pattern "rabbitmq-server"
         declared_type :service
         cookbook_name "rabbitmq"
         recipe_name "default"
         retries 0
         retry_delay 2
         supports {:status=>true, :restart=>true}
       end
       
       System Info:
       ------------
       chef_version=13.6.0
       platform=amazon
       platform_version=2017.09
       ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
       program_name=chef-client worker: ppid=2917;start=09:13:34;
       executable=/opt/chef/bin/chef-client
       
   
   Running handlers:
   [2017-10-31T09:13:41+00:00] ERROR: Running exception handlers
   [2017-10-31T09:13:41+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2017-10-31T09:13:41+00:00] ERROR: Exception handlers complete
   [2017-10-31T09:13:41+00:00] ERROR: Exception handlers complete
   Chef Client failed. 11 resources updated in 06 seconds
   [2017-10-31T09:13:41+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2017-10-31T09:13:41+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2017-10-31T09:13:41+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-10-31T09:13:41+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-10-31T09:13:41+00:00] ERROR: Chef::Exceptions::MultipleFailures
   [2017-10-31T09:13:41+00:00] ERROR: Chef::Exceptions::MultipleFailures
   [2017-10-31T09:13:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
   [2017-10-31T09:13:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Through chef its really becoming difficult.

ff-pjha avatar Oct 31 '17 09:10 ff-pjha

Amazon is a different distribution than RHEL-family. They have diverged enough that ohai, which provides Chef's platform detection, has amazon as a separate platform family than RHEL or Fedora.

Further, the rabbitmq cookbook does not list amazon as a specifically supported distribution meaning that testing is not done against it.

Sensu has a list of supported platforms in its cookbook metadata and you'll probably have more success using one of those platforms instead.

jtimberman avatar Oct 31 '17 22:10 jtimberman

As Josh points out the cookbook does not officially support Amazon Linux or Amazon Linux 2. I am open to adding support if you can provide a contribution here and in the upstream rabbitmq cookbook.

majormoses avatar Mar 25 '18 18:03 majormoses

Yes can you add support for Amazon Linux. May I know what are the steps I need to do ?

Regards Prakash

On Mon, Mar 26, 2018 at 12:29 AM, Ben Abrams [email protected] wrote:

As Josh points out the cookbook does not officially support Amazon Linux or Amazon Linux 2. I am open to adding support if you can provide a contribution here and in the upstream rabbitmq cookbook.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sensu/sensu-chef/issues/585#issuecomment-375994418, or mute the thread https://github.com/notifications/unsubscribe-auth/Acx7D9OsDFmFb2sP-5mQ71Tc4nClcCcNks5th-kOgaJpZM4QMPEb .

ff-pjha avatar Mar 28 '18 13:03 ff-pjha

May I know what are the steps I need to do ?

I don't run amazon linux so this is not currently a priority for me to do but essentially you need to figure out what is different from rhel families and amazon linux and add it in a case statement for the platform. For the sensu client, api, and server installer this would be here: https://github.com/sensu/sensu-chef/blob/v4.3.0/recipes/_linux.rb#L67-L91. For the rabbitmq cookbook changes it would need to happen either here or more likely needs to be addressed upstream in the rabbitmq cookbook I would probably start by raising an issue with the rabbitmq cookbook as I'd be willing to bet it will be needed to update the upstream cookbook from my quick review.

majormoses avatar Mar 28 '18 19:03 majormoses