The best way to ensure we completely address this would be to just clear the File Sync cache. To do so:
-
On the master, shutdown the pe-puppetserver service:
service pe-puppetserver stop
-
On the master, delete all the files inside /etc/puppetlabs/code, and /etc/puppetlabs/code-staging including all hidden files, leaving only the production environment:
# find /etc/puppetlabs/code -mindepth 1 -delete
# mkdir -p /etc/puppetlabs/code/environments/production
# mv /etc/puppetlabs/code-staging /etc/puppetlabs/code-staging.old
# mkdir /etc/puppetlabs/code-staging
- On the master, delete File Sync's data-dir:
rm -rf /opt/puppetlabs/server/data/puppetserver/filesync
-
On the master, ensure permissions on /code and /code-staging are correct:
# chown -R pe-puppet:pe-puppet /etc/puppetlabs/code-staging # chown -R pe-puppet:pe-puppet /etc/puppetlabs/code
-
Ensure all environments are enabled on the PuppetDB node:
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';\""
-
Temporarily disable the environment cache on the Master node:
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 master, restart the pe-puppetserver service:
service pe-puppetserver start
-
Run a code deploy to confirm whether or not it is working.
-
If the code deploy is successful, reload the classes on the Console node by hitting the update-classes endpoint:
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)