[Satellite6] Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Type-Name, Could not autoload puppet/type
Environment
Red Hat Satellite 6.3
Issue
When puppetserver is restarted, the following error can be seen on the first run of the puppet agent: "Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Type-Name"
Resolution
Make sure that the /etc/puppetlabs/environments folder is symlinked into /etc/puppet/environments, and first backup environments to be sure:
mkdir ~/environments_backup
cd ~/environments_backup
mv /etc/puppetlabs/code/environments ~/environments_backup/
ln -s /etc/puppet/environments /etc/puppetlabs/code/
systemctl restart puppet.service
Run the below command to let puppet generate custom types
for i in $(ls /etc/puppetlabs/code/environments/); do puppet generate types --environment ${i}; done
Be sure that the module directory has got the correct rights:
chmod 775 /etc/puppetlabs/code/environments/<environment>/modules/<module>
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
Custom facts weren't mapped by puppetserver after a restart, they will be mapped on the second run of the puppet agent.
Diagnostic Steps
When puppet agent -t is executed, you can see the following error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Type-Name, Could not autoload puppet/type/disk_label: Could not autoload puppet/provider/disk_label/linux: no such file to load -- puppet/type/disk_label at /etc/puppetlabs/code/environments/production/modules/disk_labels/manifests/init.pp:24:3 on node puppetclient.example.local
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.