Running "satellite-maintain packages update gofer" on Red Hat Capsule server 6.x results in: Procedures::Installer::Upgrade: Could not get default values, check log file at /var/log/foreman-installer/capsule.log for more information.

Solution Verified - Updated

Environment

  • Red Hat Capsule 6.8.6-1

Issue

Running "satellite-maintain packages update gofer" on Red Hat Satellite 6.x Capsule server results in:

Procedures::Installer::Upgrade: Could not get default values, check log file at /var/log/foreman-installer/capsule.log for more information
                                      [FAIL]
Failed executing LANG=en_US.utf-8 foreman-installer  --disable-system-checks, exit status 25
--------------------------------------------------------------------------------
Scenario [update packages in unlocked session] failed.

The following steps ended up in failing state:

  [installer-upgrade]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="installer-upgrade"

Resolution

  • Follow the steps outlined in the Diagnostic Steps section of this solution.

  • If the offending puppet module module_xyz is included in the puppet environment which the affected Capsule capsule.example.com is using, then:

  1. Create a new puppet environment and assign it to the affected capsule.
  2. Run the following commands on the Satellite server:
# mkdir -p /etc/puppetlabs/code/environments/capsule
# chown -R apache:root /etc/puppetlabs/code/environments/capsule/
  1. In Satellite's Web UI, Configure -> Puppet -> Environments -> Import environments from satellite
  2. Run the following command on the Satellite server:
# hammer host update --name 'capsule.example.com' --puppet-environment 'capsule'
  1. Run the following commands on the affected Capsule:
# mkdir -p /etc/puppetlabs/code/environments/capsule
# chown -R apache:root /etc/puppetlabs/code/environments/capsule/
# rm -rf /opt/puppetlabs/puppet/cache/lib/*
# puppet agent -t

For more KB articles/solutions related to Red Hat Satellite 6.x Puppet Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Puppet Issues

Root Cause

A puppet module, which is creating and using ref1_file puppet type, is included in the puppet environment which the affected Capsule is using.

Note:
The ref1_file puppet type and module_xyz puppet module are just examples. These could be any abc puppet type, and any xyz puppet module that creates and uses the abc puppet type.

Diagnostic Steps

  • Check for a similar error in /var/log/foreman-installer/capsule.log:
' | RUBYLIB=/opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0.1/lib/kafo/../..//modules: /opt/puppetlabs/bin/puppet apply --config=/tmp/kafo_installation20220321-21217-v6slqz/puppet.conf 
[ERROR 2022-03-21T16:20:56 main] Error: Could not autoload puppet/type/ref1_file: uninitialized constant Puppet::Util::MethodHelper
Error: Could not autoload puppet/type/file: Could not autoload puppet/type/ref1_file: uninitialized constant Puppet::Util::MethodHelper
Error: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: Could not autoload puppet/type/file: Could not autoload puppet/type/ref1_file: uninitialized constant Puppet::Util::MethodHelper
Error: Could not prepare for execution: Could not create resources for managing Puppet's files and directories in sections [:main, :agent, :ssl]: Could not autoload puppet/type/file: Could not autoload puppet/type/ref1_file: uninitialized constant Puppet::Util::MethodHelper
Could not autoload puppet/type/file: Could not autoload puppet/type/ref1_file: uninitialized constant Puppet::Util::MethodHelper

[ERROR 2022-03-21T16:20:56 main] Could not get default values, cannot continue
  • Run the following commands on the affected Capsule server and examine the output:
# cd /etc/puppetlabs/code/
# grep -rnw . -e 'ref1_file'

Look for an output that looks like:

./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/checksums.json:62:  "lib/puppet/provider/ref1_file/posix.rb": "0a823e87594555c1d7be64c763fe1d7a",
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/checksums.json:63:  "lib/puppet/provider/ref1_file/windows.rb": "b9b098dc070a8209a55875d45d7d07e4",
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/checksums.json:78:  "lib/puppet/type/ref1_file.rb": "3d581afa71d1cce23a7641b93f23f776",
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/lib/puppet/provider/ref1_file/posix.rb:1:Puppet::Type.type(:ref1_file).provide :posix do
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/lib/puppet/provider/ref1_file/windows.rb:1:Puppet::Type.type(:ref1_file).provide :windows do
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/lib/puppet/provider/ref1_file/windows.rb:89:  attr_reader :ref1_file
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/lib/puppet/type/file/content.rb:10:  Puppet::Type.type(:ref1_file).newproperty(:content) do
./environments-orig/KT_abc_Development_Puppet_Modules_10/modules/module_xyz/lib/puppet/type/file/mtime.rb:2:  Puppet::Type.type(:ref1_file).newproperty(:mtime) do
.
.
./environments-orig/KT_abc_Test_Puppet_Modules_10/pulp32Jv24/module_xyz/checksums.json:62:  "lib/puppet/provider/ref1_file/posix.rb": "0a823e87594555c1d7be64c763fe1d7a",
./environments-orig/KT_abc_Test_Puppet_Modules_10/pulp32Jv24/module_xyz/checksums.json:63:  "lib/puppet/provider/ref1_file/windows.rb": "b9b098dc070a8209a55875d45d7d07e4",
./environments-orig/KT_abc_Test_Puppet_Modules_10/pulp32Jv24/module_xyz/checksums.json:78:  "lib/puppet/type/ref1_file.rb": "3d581afa71d1cce23a7641b93f23f776",
./environments-orig/KT_abc_Test_Puppet_Modules_10/pulp32Jv24/module_xyz/lib/puppet/provider/ref1_file/posix.rb:1:Puppet::Type.type(:ref1_file).provide :posix do
.
.

The output indicates that a module_xyz puppet module is creating and using ref1_file puppet type.

  • Check on the Satellite server if puppet module module_xyz is included in the puppet environment which the affected Capsule capsule.example.com is using:
# hammer host info --name 'capsule.example.com' | grep -e ^Name -e "^Puppet Environment"
# hammer puppet-environment info --name '<environment from previous command>'
SBR
Product(s)
Components

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.