Unable to run puppet agent --test in client machine - Red Hat Satellite

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.3.5
  • Puppet server - 4.10.9

Issue

  • Unable to run puppet agent --test in Client machine, ( i.e. Red Hat Capsule ) which is being installed with the custom SSL certificates.
  • Find the error message below
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 500 on SERVER: Server Error: Could not find a directory environment named 'KT_Test_21' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
Info: Retrieving pluginfacts
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Failed when searching for node client.example.com: Could not find a directory environment named 'KT_Test_21' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist?
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Resolution

  • Make sure the puppet environment mentioned in the configuration file and assigned to the client on UI is available on the master (Satellite or Capsule which is serving as the master for the client).

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

  • The puppet environment assigned to the client in the /etc/puppetlabs/puppet/puppet.conf file not available on the master.

Diagnostic Steps

  • Check the environment assigned to the client:
# grep -i environment /etc/puppetlabs/puppet/puppet.conf
  • List the environment available on master(Satellite or Capsule):
# ls -l /etc/puppetlabs/code/environments/
SBR
Product(s)
Components
Category

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.