Lost puppet classes after foreman update

Problem:
We have puppet classes they were pinned to some hosts and host groups. After a while we’ve recognised that some puppet classes has no host and host groups. The trigger could be the foreman update to 3.12 because of the time we can reconstruct the problem.

What is unusual, however, is that changes to puppet classes at the file level still arrive at some hosts even though the class is no longer assigned.

Does anyone have an idea what is going wrong or how we can analyze this problem?

Expected outcome:

Foreman and Proxy versions:
Version 3.12.1

Foreman and Proxy plugin versions:
foreman-tasks 9.2.3
foreman_ansible 14.2.1
foreman_puppet 7.0.0
foreman_remote_execution 13.2.5

Distribution and version:
Red Hat Enterprise Linux release 8.10 (Ootpa)

Other relevant data:
No errors or something like this in the logs.

Hi Andreas,
are the puppet modules/classes still on the disk?
Does ‘puppet module list’ still give the right paths?
Cheers, ulrich

Hi Urlich,

the puppet modules/classes are still existing but we lost the assignment to some hosts and host groups after upgrade.
The list of the module shows us the following:

/etc/puppetlabs/code/environments/production/modules (no modules installed)
/etc/puppetlabs/code/environments/common (no modules installed)
/etc/puppetlabs/code/modules
├── global (???)
└── puppetlabs-stdlib (v8.5.0)
/opt/puppetlabs/puppet/modules (no modules installed)
/usr/share/puppet/modules (no modules installed)

But we have also a lot of modules within the environments. Should they also posted in this output?

Hi Andreas,
sorry for the late answer.
It seems nothing was deleted.
Did you already try to migrate the database:
foreman-rake db:migrate
?
Were there errors or warnings coming up?
Cheers, ulrich

Hi Ulrich,

no errors or warnings:
[root@server] ~ # foreman-rake db:migrate
[root@server] ~ # echo $?
0

The module list is the same after the db migration.

Regards,
Andi

Dear Andi,
i am now out of ideas.
You write about “some”. Perhaps it could be easier to insert the missing things with the hammer cli command (write a script which does it for you).
I hope somebody with more knowledge than me can help you.
Cheeres, ulrich