Page MenuHomePhabricator

Puppet fails with "Could not find init script for 'postgresql@9.4-main'" on maps / labs server
Closed, ResolvedPublic

Description

The puppet-postgresql module fails with:

Error: /Stage[main]/Postgresql::Server/Service[postgresql@9.4-main]: Could not evaluate: Could not find init script for 'postgresql@9.4-main'

when run on maps-cleartables.maps-team.eqiad.wmflabs. This indicates that the service type is trying to use the traditional init.d script instead of systemd. This could be fixed by adding provider => systemd to the service definition, but it seems odd that the code works on the current production servers and fails on a labs instance.

Differences / similarities observed:

maps2001maps-cleartables
facter -p initsystemsystemdsystemd
facter -p operatingsystemDebianDebian
facter -p operatingsystemmajrelease88
puppet --version3.7.23.7.5
cat /etc/debian_version8.48.7

Documentation indicates that systemd should be the default for operatingsystem == debian and operatingsystemmajrelease == 8

Event Timeline

The simplest possible test I can think of is sudo puppet apply -e "service {'postgresql@9.4-main': ensure => running }", and it fails. So this does not seem to be related to the rest of our puppet code.

It looks like puppet is using systemctl('list-unit-files', '--type', 'service', '--full', '--all', '--no-pager') to get a list of systemd units. Postgresql uses templates, so that list returns postgresql@.service but not the expected postgresql@9.4-main. This code is the same on maps-cleartables (failing) and maps-test2001 (working). So probably not the issue.

A few other strange things:

  • puppet --version says 3.7.5, but dkpg -l indicates that 3.8.5 is installed (puppet 3.8 is pulled as maps-cleartables is a standalone puppetmaster)
  • the debian service provider on maps-cleartables looks very different than the one in the puppetlabs repo

Something is rotten in the state of maps-cleartables

akosiaris@maps-cleartables:~$ which puppet
/usr/local/bin/puppet
akosiaris@maps-cleartables:~$ /usr/local/bin/puppet --version
3.7.5
akosiaris@maps-cleartables:~$ /usr/bin/puppet --version
3.8.5

Somehow I am inclined to says this is probably related to all the rest of your woes. Depending on your appetite and free time, you can debug this or just reinstall the VM in a clean state.

@akosiaris Thanks for looking into this! How did I end up with puppet isntalled as a Ruby Gem...?

Ok, let's do a reinstall and see if it works better...

Gehel claimed this task.

Some other trouble, but this specific issue is solved.