Error with puppet on new foreman/katello install

Problem: I get this error when i restart puppet or do anything with the agent:

[root@cm ~]# /opt/puppetlabs/bin/puppet agent --test
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Facter: error while resolving custom facts in /opt/puppetlabs/puppet/cache/lib/facter/root_home.rb: /opt/puppetlabs/puppet/cache/lib/facter/root_home.rb:43: syntax error, unexpected '.'
    str&.split("\n")&.each do |line|
/opt/puppetlabs/puppet/cache/lib/facter/root_home.rb:43: syntax error, unexpected '.'
    str&.split("\n")&.each do |line|
Info: Caching catalog for
Info: Applying configuration version '1618845875'
Notice: Applied catalog in 0.15 seconds

Expected outcome:
Fix the error or understand it can be ignored

Foreman and Proxy versions:

Foreman and Proxy plugin versions:
how do i get this?

Distribution and version:
CentOS Linux release 7.9.2009 (Core)

Other relevant data:

A snip from root_home.rb including like 43:

Facter.add(:root_home) do
  confine kernel: :aix
  root_home = nil
  setcode do
    str = Facter::Util::Resolution.exec('lsuser -c -a home root')
    str&.split("\n")&.each do |line|
      next if %r{^#}.match?(line)
      root_home = line.split(%r{:})[1]

This is a relatively new install. I have a few repos setup, 1 non-working test client. I used the below to install:

foreman-installer --scenario katello --foreman-admin-username “fadmin” --katello-proxy-port 3128 --katello-proxy-url http://x.x.x.x --foreman-proxy-bind-host ‘*’

I started to setup custom certs and noticed the error. I rolled back to before and still have the error.

Thank you for any help!

root_home.rb is a file from puppetlabs stdlib module. You seem to have a broken stdlib. Update the module on your puppetmaster.

I didn’t have puppetlabs-stdlib installed (nothing required it as a dependency). I just installed it and restarted services and still have the same error.


here’s your problem. You’re on Puppet 4 which uses Ruby 2.1. That doesn’t support the safe navigator that was introduced in Ruby. IIRC in 2.4 so Puppet 5 should be safe. However, puppetlabs/stdlib 7 only declares compatibility with Puppet 6 or newer.

You should either downgrade the module or upgrade your Puppet. Given Puppet 4 is EOL (and so is Puppet 5 by now), I’d recommend upgrading. 4 to 5 (and 6) has been mostly painless in my experience.

1 Like

That makes sense! Thank you!

I was following a guide from a year ago

When i started my research at the beginning of the year some parts were not fully supported on centos8 yet. Hopefully everything is not supported and I can just reinstall with centos8 and try this setup all over again (with newer versions).

You should also use a supported Foreman version. Foreman 1.20 is old now. Currently 2.3 and 2.4 are supported with 2.5 release candidate is planned for next week.