Foreman and Puppetserver - failed to find facts from PuppetDB

Problem:

I am setting up a simple all-in-one environment of Foreman, puppetserver, puppet-agent, puppetdb and postgesql database on RHEL 7.4 server.

After the setup, puppet run failed to find facts from PuppetDB on ‘server_urls’: https://myhostname.example.com:8081

I first install Foreman using foreman-installer, mostly using the default values, except using Postgresql 9.6 instead of the default 9.2. After the Foreman installation finished, puppetserver and puppet-agent are also installed automatically. “puppet agent -t” works fine.

Then I “puppet module install puppetlabs-puppetdb” and “puppet agent -t” to have puppetdb installed and configured. It finished okay. “telnet myhostname.example.com 8081” is working fine. The file /etc/puppetlabs/puppet/puppetdb.conf looks like:

[main]
server_urls = https://myhostname.example.com:8081/
soft_write_failure = false

At the end, I use Foreman installer to install foreman::plugin::puppetdb. Then log on Foreman console, I go to Administer > Settings > PuppetDB and set puppetdb_address by
replacing “localhost” with my hostname’s FQDN:

puppetdb_address: https://myhostname.example.com:8081/pdb/cmd/v1
puppetdb_dashboard_address: http://myhostname.example.com:8080/pdb/dashboard
puppetdb_ssl_ca_file: /etc/puppetlabs/puppet/ssl/certs/ca.pem
puppetdb_ssl_certificate: /etc/puppetlabs/puppet/ssl/certs/myhostname.example.com.pem
puppetdb_ssl_private_key: /etc/puppetlabs/puppet/ssl/private_keys/myhostname.example.com.pem
puppetdb_api_version: '4'

Restart every component, but now “puppet agent -t” failed:

Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 500 on SERVER: Server Error: Could not retrieve facts for  myhostname.example.com: Failed to find facts from PuppetDB at  myhostname.example.com:8140: Failed to execute 
'/pdb/query/v4/nodes/myhostname.example.com/facts' on at least 1 of the following 'server_urls': https://myhostname.example.com:8081

Please advise which configuration is wrong or missing? Thanks a lot! I have been trying on this for one week and still can’t figure it out :frowning:

Expected outcome:
“puppet agent -t” should finish successfully.

Foreman and Proxy versions:
foreman-1.17.1-1.el7
foreman-proxy-1.17.1-1.el7

Foreman and Proxy plugin versions:
tfm-rubygem-puppetdb_foreman-4.0.0-1.fm1_17.el7

Other relevant data:
puppetserver-5.3.4-1.el7.noarch
puppet-agent-5.5.4-1.el7.x86_64
puppetdb-5.2.4-1.el7.noarch
puppetdb-termini-5.2.4-1.el7.noarch
postgresql96-9.6.9-1PGDG.rhel7.x86_64
katello-agent-3.1.0-2.el7sat.noarch
RHEL 7.4 with kernel 3.10.0-693.2.1.el7.x86_64

Hi,

We figured it out by replacing two java security jar:

/usr/java/jdk1.8.0_131/jre/lib/security/US_export_policy.jar and local_policy.jar

I got the hint from:

BTW, the new Foreman installer is very comprehensive. I like it.

Thanks,
Zaiwen

1 Like