Warnings about puppetclass cache disabled (1.15.x, 1.16.x - but not 1.14.x). Should it be activated or not?!

Hi together,

there is one topic that confuses me.

I began to integrate and work with foreman on version 1.14.x. Everything works fine, the logs are clean.
After upgrade to 1.15.x or 16.0 - even if i make a fresh installation on a new machine - i get every 3-5 minutes the warning:

Puppet server classes cache is disabled, classes retrieval can be slow.

Because it causes on upgrade and fresh installation, i first think its a bug. But when 1.16.0 is released, i also got this message. I “solve this” with setting “environment-class-cache-enabled: true” at the puppetserver.conf in /etc/puppetlabs/puppetserver/conf.d

What im wondering is, that on my Foreman 1.14.3 VM’s i never got this warning, even the environment-class-cache-enabled is set to false by default.

So my question is, did i do sth. wrong with the upgrade/fresh installation that i retrieve this warning or is it “work by design” that it causes on higher versions and not at 1.14.x ?

Thank you for your help

best regards


Nobody who can say 1-2 sentences to this topic?
I think everybody should have this after installation with foreman-installer …

Indeed, and the fact that I’ve not heard of this before suggests it’s something else.

You’ll need to give us a little more information:

  • Which log file are you seeing the errors in?
  • Does it happen in response to an action (like class import) or is it time based?
  • What are the package versions of the proxy and puppetserver involved?
  • Did the puppetserver get upgraded when you went from 1.14 to 1.16?

Thanks for your reply,

  • i see the warning (not an error) in the smart proxy log over the foreman interface.
  • it seems time based
  • it happens on all versions after 1.14.3 - so 1.15.x and 1.16.0
  • it happen after a upgrade and a fresh installation of foreman 1.15.x and 1.16.0 over the foreman-installer. I tryed it multiple times in different environments at home and work. I follow the whole installation guide in the foreman documentation.

So what i can say is:

it seems the puppet class cache is always disabled by default at foreman-installer installation. So the warning seems right. Iam wondering why it does not pull the warning at foreman 1.14.3 … whatever… i have upgrade alredy. Seems it must be answered by the dev’s if they want or dont want to enable the puppet class cache by default.

Iam pretty sure now everybody get this warning who do not configure this explicity after a fresh installation via. foreman-installer.

This warning is an attempt to make the system’s administrator aware of a potential slowdown and a way to resolve it.

Smart-proxy’s puppet module was updated to use puppet environment classes api in version 1.15. The a[i call that retrieves classes is much faster with classes cache enabled, which is why the warning has been added (and the reason why it wasn’t there in previous versions).

1 Like

Looks to me like the default in the installer is for caching classes to be true:

@ekohl am I reading that right? @aironstey do you have an override for $puppet_use_cache in your installer answers file?

When you reinstalled, did you generate a new answer file, or recycle your old answer file? If you used your answer file from 1.14 on 1.16, you will want to regenerate that. A lot has changed.

1 Like

It looks like by default we don’t set the use_cache option since it defaults to undef. That setting is only used by the legacy plugin while the warning is only used in the puppet api provider.

It looks like this warning is emitted if the environment doesn’t show up in the etag cache. That means the puppet server isn’t sending etags.

Per https://docs.puppet.com/puppetserver/2.3/puppet-api/v3/environment_classes.html#changes-class-information-caching-behavior it means the puppet setting server_environment_class_cache_enabled needs to be enabled. It’s off by default.

The solution right now would be to rerun the installer with --puppet-server-environment-class-cache-enabled true but I don’t know the exact impact of that change. It might make sense to enable it by default if that’s safe.

1 Like

the impact of that change is that the “import from environments” button at “puppet classes” in foreman-ui does not refresh the class cache. So changing, adding or deleting of a puppet class needs a reboot of the master server. Not very smart at all.

Thanks for the answer! That explains a lot.
The Problem is now that the import of new, deleteted or changed classes via. foreman-ui does not work properly when the class cache is enabled, because no changes are recocnized. It seems the import button does not refresh the masters class cache. So you have always to reboot for reload the cache.

That might be the reason we disable it by default. You can flush the cache of environments via the API and can be scripted in your deplyoment steps. Right now I don’t now of tools that already do this but there’s https://puppet.com/docs/puppetserver/5.1/admin-api/v1/environment-cache.html#delete-puppet-admin-apiv1environment-cache which has a nice curl example.