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

Facter error on older distributions (Ubuntu Trusty) #142

Closed
vladgh opened this issue Jan 9, 2018 · 6 comments
Closed

Facter error on older distributions (Ubuntu Trusty) #142

vladgh opened this issue Jan 9, 2018 · 6 comments
Labels
bug Something isn't working

Comments

@vladgh
Copy link

vladgh commented Jan 9, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.3.3
  • Ruby: ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux] (/opt/puppetlabs/puppet/bin/ruby)
  • Distribution: Ubuntu 14.04.5 LTS
  • Module version: 4.0.0

How to reproduce (e.g Puppet code you use)

vlad@mini:~ $ /opt/puppetlabs/bin/puppet module install puppet-prometheus --version 4.0.0

vlad@mini:~ $ /opt/puppetlabs/bin/puppet apply --noop -e 'class { "prometheus::node_exporter": version => "0.15.2", }'

What are you seeing

Error: Facter: error while resolving custom fact "prometheus_alert_manager_running": Could not find init script or upstart conf file for 'alert_manager'

What behaviour did you expect instead

No error

Output log

vlad@mini:~ $ /opt/puppetlabs/bin/puppet module install puppet-prometheus --version 4.0.0
Notice: Preparing to install into /home/vlad/.puppetlabs/etc/code/modules ...
Notice: Created target directory /home/vlad/.puppetlabs/etc/code/modules
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/home/vlad/.puppetlabs/etc/code/modules
└─┬ puppet-prometheus (v4.0.0)
  ├── camptocamp-systemd (v1.1.1)
  └─┬ puppet-archive (v2.2.0)
    └── puppetlabs-stdlib (v4.24.0)
vlad@mini:~ $ /opt/puppetlabs/bin/puppet apply --noop -e 'class { "prometheus::node_exporter": version => "0.15.2", }'
Error: Facter: error while resolving custom fact "prometheus_alert_manager_running": Could not find init script or upstart conf file for 'alert_manager'
Notice: Compiled catalog for mini in environment production in 1.17 seconds
Notice: Applied catalog in 0.50 seconds

Any additional information you'd like to impart

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Jan 10, 2018
@tuxmea
Copy link
Member

tuxmea commented Jan 10, 2018

Many thanks for reporting the issue. Can you please run the following command: puppet resource service alert_manager --debug.
For comparision it would be nice to also have the output of the command for an existing service like puppet resource service ssh --debug (replace ssh with the name of the ssh service).

@tuxmea
Copy link
Member

tuxmea commented Jan 10, 2018

Many thanks.
Seems as if alert_manager is not really usable on your system:

Debug: /Service[alert_manager]: Provider upstart does not support features flaggable; not managing attribute flags
Debug: Service[alert_manager](provider=upstart): Could not find alert_manager.conf in /etc/init
Debug: Service[alert_manager](provider=upstart): Could not find alert_manager.conf in /etc/init.d
Debug: Service[alert_manager](provider=upstart): Could not find alert_manager in /etc/init
Debug: Service[alert_manager](provider=upstart): Could not find alert_manager in /etc/init.d
Debug: Service[alert_manager](provider=upstart): Could not find alert_manager.sh in /etc/init
Debug: Service[alert_manager](provider=upstart): Could not find alert_manager.sh in /etc/init.d
Error: Could not run: Could not find init script or upstart conf file for 'alert_manager'

Is alert_manager installed and running? or not installed at all?

@vladgh
Copy link
Author

vladgh commented Jan 10, 2018

It shouldn't be installed at all; I just installed node exporter:

  class { 'prometheus::node_exporter':
    version => '0.15.2',
  }

Meanwhile I did some more testing and I think it's more of a puppet issue than the module itself.

Running the same command for a service that should not exist:
/opt/puppetlabs/bin/puppet resource service madeupservice --debug

on a Trusty (non-systemd) fails:

Debug: /Service[madeupservice]: Provider upstart does not support features flaggable; not managing attribute flags
Debug: Service[madeupservice](provider=upstart): Could not find madeupservice.conf in /etc/init
Debug: Service[madeupservice](provider=upstart): Could not find madeupservice.conf in /etc/init.d
Debug: Service[madeupservice](provider=upstart): Could not find madeupservice in /etc/init
Debug: Service[madeupservice](provider=upstart): Could not find madeupservice in /etc/init.d
Debug: Service[madeupservice](provider=upstart): Could not find madeupservice.sh in /etc/init
Debug: Service[madeupservice](provider=upstart): Could not find madeupservice.sh in /etc/init.d
Error: Could not run: Could not find init script or upstart conf file for 'madeupservice'

while on Xenial returns the correct values:

Debug: Executing: '/bin/systemctl is-active madeupservice'
Debug: Executing: '/bin/systemctl is-enabled madeupservice'
service { 'madeupservice':
  ensure => 'stopped',
  enable => 'false',
}

@tuxmea
Copy link
Member

tuxmea commented Jan 10, 2018

That is great information. We can easily check in the fact for an error from puppet resource command. I can work on that within the next few days.

@vladgh
Copy link
Author

vladgh commented Jan 10, 2018

Thank you. I appreciate all your help.

vladgh added a commit to vladgh/puppet-prometheus that referenced this issue Jan 10, 2018
@tuxmea tuxmea closed this as completed Jan 11, 2018
cegeka-jenkins pushed a commit to cegeka/puppet-prometheus that referenced this issue Aug 28, 2019
Rovanion pushed a commit to Rovanion/puppet-prometheus that referenced this issue May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants