Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New configuration: gem uninstall sensu-plugin is failing in 1.5.0 #318

Closed
brettswift opened this issue Feb 14, 2015 · 7 comments
Closed

Comments

@brettswift
Copy link

I have been building a vagrant box as my 'reference' configuration to learn sensu / grafana etc.

I haven't touched this since version 1.3.1. When I upgrade to 1.5.0, and build a clean vagrant box, the configuration I have isn't sufficient. Version 1.3.1 however does work with my vagrant box.

The sensu-plugin gem should be installed under /opt/sensu/embedded......, and it is.. however this script seems to want to uninstall it from the system ruby.. I'm not sure why?

I have had a quick peek at the sensu-puppet code and I don't see an ensure => absent.

To recreate

  1. clone this: https://github.com/brettswift/vagrant-sensu_example
  2. Upgrade the version of sensu in the Puppetfile
  3. run vagrant up sensuserver.

It may be my code, but nothing jumps out at me in the README documentation.

Is this a bug?

==> sensuserver: Error: /Stage[main]/Sensu::Package/Package[sensu-plugin]/ensure: change from 1.1.0 to absent failed: Execution of '/usr/bin/gem uninstall -x -a sensu-plugin' returned 1: ERROR:  While executing gem ... (Gem::InstallError)
==> sensuserver:     cannot uninstall, check `gem list -d sensu-plugin`
==> sensuserver:
==> sensuserver: Error: Execution of '/usr/bin/gem uninstall -x -a sensu-plugin' returned 1: ERROR:  While executing gem ... (Gem::InstallError)
==> sensuserver:     cannot uninstall, check `gem list -d sensu-plugin`
@pythianliappis
Copy link

+1. Also facing this issue on a real CentOS 6.5 installation using version 1.5.0 of the sensu puppet module.

Error: Execution of '/usr/bin/gem uninstall -x -a sensu-plugin' returned 1: ERROR:  While executing gem ... (Gem::InstallError)

@pythianliappis
Copy link

It appears the default value in init.pp for $sensu_plugin_version is absent:

$sensu_plugin_version     = 'absent',

So @brettswift just specify in your sensu server manifest file (or hiera conf) sensu_plugin_version => 'installed' and you should be ok.

The instructions for a basic installation on https://forge.puppetlabs.com/sensu/sensu need to be updated to reflect that as well.

@jamtur01
Copy link
Contributor

@pythianliappis We'd welcome a PR with a docs update and/or a fix! Thanks!

@pythianliappis
Copy link

@jamtur01 Will do James!

@brettswift
Copy link
Author

Yes I found the same thing... sorry I forgot to update this ticket. The reference repo at the above link works on the master branch. Thanks @pythianliappis

@queeno
Copy link
Contributor

queeno commented Mar 12, 2015

Hey folks,

I believe I found an issue in puppet resulting in the execution of /usr/bin/gem uninstall -x -a sensu-plugin rather than /opt/sensu/embedded/bin/gem uninstall -x -a sensu-plugin.

I have raised issue PUP-4191 in the puppet project and opened PR #3708 in puppetlabs/puppet.

I've also raised PR #332 in this project to work around this issue.

Could you please retest sensu/sensu-puppet with my workaround in place?

Thanks!

jlambert121 added a commit that referenced this issue Mar 20, 2015
Fix #318: Introducing custom uninstall in sensu_gem
whpearson pushed a commit to whpearson/sensu-puppet that referenced this issue Mar 20, 2015
sensu_gem inherits the methods from its parent, gem.rb.
The uninstall method in gem.rb contains a bug that prevents the right
gem command from being issued. (/usr/bin/gem uninstall -x -a
sensu-plugin is executed instead of /opt/sensu/embedded/bin/gem
uninstall -x -a sensu-plugin).

Issue PUP-4191 has been raised in the puppet project and PR #3708 has
been opened in puppetlabs/puppet.

As temporary workaround, we should overwrite the gem.rb uninstall
method to use the execute function, which then issues the right gem
command.
@ianjs
Copy link

ianjs commented Aug 10, 2015

I got bitten by this too, and it makes me wonder why it defaults to 'absent'?

I would have thought installing the sensu-plugin gem would have been the most likely use case, especially as excluding it means a newbie will be scratching their head as to why it doesn't Just Work.

jlambert121 added a commit that referenced this issue Sep 23, 2015
Chealion pushed a commit to cybera/sensu-puppet that referenced this issue Oct 29, 2015
* 'master' of https://github.com/sensu/sensu-puppet: (48 commits)
  Added subdue attribute to sensu_check type
  Adding option to manage the mutators dir
  add ttl to check provider
  Add functionality to configure mutators sensu#230
  update supported puppet versions
  Adding spec tests for manage_handlers param
  Adding option to manage the handlers dir
  set $pkg_requires to undef for the redhat osfamily as with it not set the run fails on centos/redhat when strict_variables is enabled
  version bump: 2.0.0
  set sysconfig parameters when defined
  allow setting of path
  Add require on apt::update for puppetlabs-apt 2.x
  Correcting issue sensu#318 - Changing the default value of sensu_plugin_version from absent to installed
  allow handle and handlers together
  Make the sensu enterprise dashboard not show up unbidden
  Move file_ensure out of conditional
  Add tests for sensu-plugins provider
  update apt module dep
  fix db type
  Fix Sensu Enterprise services when not using enterprise
  ...
salimane added a commit to MeltwaterArchive/sensu-puppet that referenced this issue Nov 2, 2015
* upstream/master: (286 commits)
  Added subdue attribute to sensu_check type
  Adding option to manage the mutators dir
  add ttl to check provider
  Add functionality to configure mutators sensu#230
  update supported puppet versions
  Adding spec tests for manage_handlers param
  Adding option to manage the handlers dir
  set $pkg_requires to undef for the redhat osfamily as with it not set the run fails on centos/redhat when strict_variables is enabled
  version bump: 2.0.0
  set sysconfig parameters when defined
  allow setting of path
  Add require on apt::update for puppetlabs-apt 2.x
  Correcting issue sensu#318 - Changing the default value of sensu_plugin_version from absent to installed
  allow handle and handlers together
  Make the sensu enterprise dashboard not show up unbidden
  Move file_ensure out of conditional
  Add tests for sensu-plugins provider
  update apt module dep
  fix db type
  Fix Sensu Enterprise services when not using enterprise
  ...
thanandorn pushed a commit to thanandorn/sensu-puppet that referenced this issue Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants