Open ff-pjha opened 6 years ago
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
restart
on resource 'service[restart rabbitmq-server]'service[restart rabbitmq-server]: No custom command for restart specified and unable to locate the init.d script!
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:
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
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
restart
on resource 'service[rabbitmq-server]'service[rabbitmq-server]: No custom command for restart specified and unable to locate the init.d script!
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
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
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.
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.
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.
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 notifications@github.com 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 .
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.
Recipe: sensu::rabbitmq
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?