I committed code to our Puppet code directory. At the top of each node group's page in the PE console, I see the message: Some of the classes or parameters
in this group have been removed from Puppet.
Classes are crossed out. How do I recover my classes?
Error messages
Some of the classes or parameters in this group have been removed from Puppet. These classes and parameters still appear in the list but they are crossed out.
Version and installation information
PE version: All supported versions
Solution
This issue often occurs when initially implementing Code Manager or file sync.
When the production environment is deleted or inaccessible, the environment is marked as deleted in the classifier database, and associated classes are unavailable. Even when the production environment is restored, the classes remain unavailable.
Before completing these steps, ensure the production environment directory has the correct permissions. On the primary server, run:
puppet apply -e 'file {"${::settings::environmentpath}/production": ensure => directory, owner => $::settings::user, group => $::settings::group, mode => "0750" }'
-
Ensure that no environments are marked as deleted. On the PuppetDB node, set the value of the
deleted
field for all environments to false by running:sudo su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/bin/psql -d 'pe-classifier' -c \"UPDATE environments SET deleted = 'f' WHERE deleted = 't';\""
-
On the primary server, stop Puppet agent service:
puppet resource service puppet ensure=stopped
-
Disable the environment cache setting. On the primary server, run:
puppet apply -e "pe_hocon_setting { 'cache': ensure => present, path => '/etc/puppetlabs/puppetserver/conf.d/pe-puppet-server.conf', setting => 'jruby-puppet.environment-class-cache-enabled', value => false }"
-
On the primary server, restart the
pe-puppetserver
service:puppet resource service pe-puppetserver ensure=stopped ; puppet resource service pe-puppetserver ensure=running
-
Update classes in the PE console. On the console node, run:
curl -X POST https://$(hostname -f):4433/classifier-api/v1/update-classes --cert $(puppet config print hostcert) --key $(puppet config print hostprivkey) --cacert $(puppet config print localcacert)
-
On the primary server, restart the Puppet agent service:
puppet resource service puppet ensure=running
- If you are logged in to the console, log out. Then, log back in and check that the classes are no longer marked as deleted.
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles