djoos-cookbooks / newrelic

Development repository for the newrelic cookbook
https://supermarket.chef.io/cookbooks/newrelic
MIT License
143 stars 245 forks source link

Error on amazon linux newrelic-infra not known to chkconfig. #343

Closed swapnil-jaiswal closed 6 years ago

swapnil-jaiswal commented 6 years ago

On checking the system i found out that the newrelic infra agent installation via yum results in creation of upstrart service. But this recipe looks for /etc/init.d/newrelic-infra or service newrelic-infra. Same is not found since the newrelic infra uses intctl instead.

initctl status newrelic-infra newrelic-infra start/running, process 10609

Please advice. I am using the latest cookbook version '2.36.0'

Summary of error /newrelic/providers/agent_infrastructure.rb line 59) had an error: Chef::Exceptions::Service: service[newrelic-infra]: Service is not known to chkconfig.

Details of error logs

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

[2018-05-08T20:40:24+05:30] INFO: Running queued delayed notifications before re-raising exception
[2018-05-08T20:40:24+05:30] ERROR: Running exception handlers
[2018-05-08T20:40:24+05:30] ERROR: Exception handlers complete
[2018-05-08T20:40:24+05:30] FATAL: Stacktrace dumped to /var/chef/runs/cb3c8af0-03f1-4b3d-a428-d477b6228d6f/local-mode-cache/cache/chef-stacktrace.out
[2018-05-08T20:40:24+05:30] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-05-08T20:40:24+05:30] ERROR: newrelic_agent_infrastructure[Install] (newrelic_infra_activate::default line 10) had an error: Chef::Exceptions::MultipleFailures: Multiple failures occurred:
* Chef::Exceptions::Service occurred in chef run: service[newrelic-infra] (/var/chef/runs/cb3c8af0-03f1-4b3d-a428-d477b6228d6f/local-mode-cache/cache/cookbooks/newrelic/providers/agent_infrastructure.rb line 59) had an error: Chef::Exceptions::Service: service[newrelic-infra]: Service is not known to chkconfig.
* Chef::Exceptions::Service occurred in delayed notification: service[newrelic-infra] (/var/chef/runs/cb3c8af0-03f1-4b3d-a428-d477b6228d6f/local-mode-cache/cache/cookbooks/newrelic/providers/agent_infrastructure.rb line 59) had an error: Chef::Exceptions::Service: service[newrelic-infra]: No custom command for restart specified and unable to locate the init.d script!

[2018-05-08T20:40:24+05:30] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
djoos commented 6 years ago

Hi @swapnil-jaiswal,

hmmm, upstart should be used as per the fix in 2.36.0.

Any chance you could replicate the issue on a clean Amazon Linux instance and document the steps to replicate the issue?

Thanks in advance! David

swapnil-jaiswal commented 6 years ago

Hey @djoos The above issue was faced on a clean amazon image itself.

This error comes on simply invoking the recipe. newrelic::infrastructure_agent.

As stated earlier the newrelic infra got installed but on subsequent run the recipe gives error -- when it invokes restart of newrelic infra agent. Now it looks for init service & fails with error s

service[newrelic-infra]: No custom command for restart specified and unable to locate the init.d script! Details have been shared above.

Since this was affecting our production we switched to alternate recipe as a quick fix : newrelic-infra from supermarket. This is working fine.

djoos commented 6 years ago

Fixed by @JCapriotti in #362