Error executing action `run` on resource 'bash[shutdown logstash]'

Noticed an error on logstash server while running chef-client.
Chef is failing due to this error "Error executing action run on resource 'bash[shutdown logstash]' "

` Recipe: tmo-logstash::default

  • bash[logstash_fix_perms] action run

    • execute "bash" "/tmp/chef-script20200409-21785-s4tiv3"
  • bash[shutdown logstash] action run
    [execute] kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

    ================================================================================
    Error executing action run on resource 'bash[shutdown logstash]'

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received '1'
    ---- Begin output of "bash" "/tmp/chef-script20200409-21785-wvayt7" ----
    STDOUT:
    STDERR: kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill - l [sigspec]
    ---- End output of "bash" "/tmp/chef-script20200409-21785-wvayt7" ----
    Ran "bash" "/tmp/chef-script20200409-21785-wvayt7" returned 1

    Cookbook Trace:

    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner .rb:78:in run_action' /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner .rb:106:in block (2 levels) in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner .rb:106:in each' /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner .rb:106:in block in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner .rb:105:in `converge'

    Resource Declaration:

    In /var/chef/cache/cookbooks/tmo-logstash/recipes/default.rb

    36: bash 'shutdown logstash' do
    37: action :run
    38: code "kill -9 $(pgrep -u logstash)"
    39: end
    40:

    Compiled Resource:

    Declared in /var/chef/cache/cookbooks/tmo-logstash/recipes/default.rb:36:in `from_file'

    bash("shutdown logstash") do
    action [:run]
    retries 0
    retry_delay 2
    default_guard_interpreter :default
    command "shutdown logstash"
    backup 5
    returns 0
    code "kill -9 $(pgrep -u logstash)"
    interpreter "bash"
    declared_type :bash
    cookbook_name "tmo-logstash"
    recipe_name "default"
    end

    Platform:

    x86_64-linux

Recipe: filebeat::config

  • service[filebeat] action start (up to date)

Running handlers:
Running handlers complete
Chef Client failed. 4 resources updated in 40 seconds
`

Can someone help me why this error is appearing.?

Thanks
Manoj Kumar`

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.