sensu/sensu-chef

Error executing action `install` on resource 'gem_package[sensu-plugins-uptime-checks]'

Opened this issue · 2 comments

I am using the below code snippet in my recipe to create the sensu check definition

sensu_gem 'sensu-plugins-uptime-checks'
sensu_check 'check_uptime_metrics' do
command 'metrics-uptime.rb --scheme sensu_stats.:::name:::'
standalone true
type 'metric'
interval 30
handlers ['graphite']
end


I am getting the below error when running the chef client.

  • sensu_gem[sensu-plugins-uptime-checks] action install (up to date)
    • gem_package[sensu-plugins-uptime-checks] action install

      ================================================================================
      Error executing action install on resource 'gem_package[sensu-plugins-uptime-checks]'

      Mixlib::ShellOut::ShellCommandFailed

      Expected process to exit with [0], but received '2'
      ---- Begin output of /opt/sensu/embedded/bin/gem install "sensu-plugins-uptime-checks" -q --no-rdoc --no-ri ----
      STDOUT:
      STDERR: ERROR: Could not find a valid gem 'sensu-plugins-uptime-checks' (>= 0) in any repository
      ---- End output of /opt/sensu/embedded/bin/gem install "sensu-plugins-uptime-checks" -q --no-rdoc --no-ri ----
      Ran /opt/sensu/embedded/bin/gem install "sensu-plugins-uptime-checks" -q --no-rdoc --no-ri returned 2

      Resource Declaration:

      In /var/chef/cache/cookbooks/sensu/providers/gem.rb

      2: g = gem_package new_resource.name do
      3: gem_binary Sensu::Helpers.gem_binary
      4: version new_resource.version
      5: source new_resource.source
      6: options new_resource.options
      7: end
      8:

      Compiled Resource:

      Declared in /var/chef/cache/cookbooks/sensu/providers/gem.rb:2:in `block in class_from_file'

      gem_package("sensu-plugins-uptime-checks") do
      package_name "sensu-plugins-uptime-checks"
      action [:install]
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :gem_package
      cookbook_name "sensu_client"
      gem_binary "/opt/sensu/embedded/bin/gem"
      end

      Platform:

      x86_64-linux

Running handlers:
Running handlers complete
Chef Client failed. 2 resources updated in 28 seconds

Is there something i can get help on?

I dont think this is so much with your use of chef but something else going wrong. Can you try running this manually /opt/sensu/embedded/bin/gem install sensu-plugins-uptime-checks -v 1.0.0 and verify it has the same output as below. If that fails then could you open an issue on the plugin repo and ping me on it?

Try: sudo /usr/bin/gem install forward -q --no-document -v "1.1.7" and rerun chef script.