2

I'm getting an error on puppet runs which use puppetdb queries:

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `server_urls' for #<Puppet::Util::Puppetdb::Config:0x00000003cd66c8> at /etc/puppet/local-modules/monitoring/manifests/init.pp:14 on node hostname.goes.here
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

By running the puppetmaster with --verbose, I get a warning which looks helpful:

Warning: It looks like you are using a PuppetDB version < 3.0.
This version of puppetdbquery requires at least PuppetDB 3.0 to work.
Downgrade to puppetdbquery 1.x to use it with PuppetDB 2.x.

PuppetDB 3.0 isn't available on the machine in question, so I'm looking at downgrading puppetdbquery. However, I can't find where/how this is installed. So far I've checked dpkg (I'm running Debian Jessie), gem and librarian-puppet, but none of them appear to have installed puppetdbquery.
Is there anyway to find where it came from and how to downgrade it?

lucas
  • 200
  • 3
  • 10

2 Answers2

2

puppetdbquery is a puppet module, and even though it may not be in your Puppetfile, it may be installed as a dependency of one of your other modules.

Take a look in the directories listed in the modulepath on your puppet master.

The error message you quote is found in lib/puppetdb/connection.rb in that module.

ssm
  • 86
  • 5
  • I checked the directories in the modulepath and there was no sign of puppetdbquery. However, your link to connection.rb was very helpful and it prompted me to do a `find` for that file name and then grep the results for the error message. Thanks for the hint! – lucas Jan 12 '16 at 23:54
2

To track down the file (thanks to ssm's answer for the link the source), I did:

find / -name connection.rb

Then I grepped the results for those which included "It looks like you are using a PuppetDB version < 3.0.", I ended up with one file:

/var/lib/gems/2.1.0/gems/ruby-puppetdb-2.1.1/lib/puppetdb/connection.rb

At first this confused me, because it makes no mention of puppetdbquery, but on closer inspection of the repository, I saw that the gemspec it includes calls itself "ruby-puppetdb", not puppetdbquery. Therefore, the fix was to run:

gem uninstall ruby-puppetdb --version 2.1.1

I had older versions of the gem installed, so the system fell back to using those instead.

To summarise: When installed as a gem, puppetdbquery is called ruby-puppetdb

lucas
  • 200
  • 3
  • 10