FATAL - Chef - Exceptions - ChildConvergeError


#1

Hi,

My chef code below

===============================================================================
execute “create directory BESClient” do
command “mkdir /etc/opt/BESClient && chmod 777 /etc/opt/BESClient”
end

remote_file ‘Download Remote File’ do
path ‘/etc/opt/BESClient/BESAgent-9.5.4.38-rhe5.x86_64.rpm’
source ‘ftp://9.0.0.0/pub/bigfix/BESAgent-9.5.4.38-rhe5.x86_64.rpm
mode ‘0644’
action :create
end

execute “rpm -i /etc/opt/BESClient/BESAgent-9.5.4.38-rhe5.x86_64.rpm” do
command “bash -c ‘rpm -i /etc/opt/BESClient/BESAgent-9.5.4.38-rhe5.x86_64.rpm’”
end

remote_file ‘Download Remote File’ do
path ‘/etc/opt/BESClient/ActionSite.afxm’
source ‘ftp://9.0.0.0/pub/bigfix/ActionSite.afxm
mode ‘0644’
action :create
end

execute “/etc/init.d/besclient start” do
command “bash -c ‘/etc/init.d/besclient start’”
end

Executing syntax

execute “/etc/init.d/besclient start” do
command “bash -c ‘/etc/init.d/besclient start’”
end

Error:

[2018-06-08T00:17:12-05:00] ERROR: execute[/etc/init.d/besclient start] (bigfix::Rhel-bigfix line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of bash -c ‘/etc/init.d/besclient start’ ----
STDOUT: Starting IBM BigFix: BESClient: [FAILED]
STDERR:
---- End output of bash -c ‘/etc/init.d/besclient start’ ----
Ran bash -c ‘/etc/init.d/besclient start’ returned 1
[2018-06-08T00:17:12-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

when starting the besclient start getting error as above PLEASE ADVICE.

Thanks


#2

@venkatraj you can try with service definition.

service ‘besclient’ do
action :start
end


#3

Getting error :
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/recipes/Rhel-bigfix.rb in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/recipes/Ubuntu-bigfix.rb in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/chefignore in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/recipes/default.rb in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/LICENSE in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/Berksfile in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/metadata.rb in the cache.
[2018-06-08T02:56:50-05:00] INFO: Storing updated cookbooks/bigfix/README.md in the cache.
[2018-06-08T02:56:50-05:00] ERROR: Running exception handlers
[2018-06-08T02:56:50-05:00] ERROR: Exception handlers complete
[2018-06-08T02:56:50-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-06-08T02:56:50-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-06-08T02:56:50-05:00] ERROR: No resource, method, or local variable named ‘besclient’' forChef::Recipe “Rhel-bigfix”’
[2018-06-08T02:56:50-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit cod


#4

As per the chef instruction nun of the files are created


#5

Just make sure you are creating service file at /etc/init.d/besclient.

You can also try
service ‘besclient’ do
action :nothing
end

and then notify from the block where you are creating /etc/init.d/besclient.
ex.
notifies :restart, “service[besclient]”, :immediately


#6

Redeployed again its working good

Thanks Suthir