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: 2016.2, 2016.4 and 2017.1 to 2019.0
Note: In some cases, upgrading to 2016.4.2 fixes the issue due to a resolved issue in Code Manager.
Installation type: Monolithic, split
Solution
Many times, this issue 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 not available. Even when the production environment is restored, the classes remain unavailable.
Before completing these steps, ensure the production environment directory exists with the correct permissions. On the Puppet master, 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, the master in a monolithic installation, 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 Puppet master, stop Puppet agent service:
puppet resource service puppet ensure=stopped
-
Disable the environment cache setting. On the Puppet master, 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 Puppet master, 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, the master in a monolithic installation, 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 Puppet master, restart the Puppet agent service:
puppet resource service puppet ensure=running
- If you are logged in to the console, log out. Log back in and check that the classes are no longer marked as deleted.
Comments
0 comments
Please sign in to leave a comment.