Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2123439 - Once purged, there is no way to reenable puppet features successfully in Satellite 6.12
Summary: Once purged, there is no way to reenable puppet features successfully in Sate...
Keywords:
Status: CLOSED DUPLICATE of bug 2087067
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Puppet
Version: 6.12.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-01 17:28 UTC by Sayan Das
Modified: 2022-09-07 15:48 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-07 15:48:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sayan Das 2022-09-01 17:28:16 UTC
Description of problem:

After using "satellite-maintain" to purge the puppet data, There is no way we can enable it back using the installer-based steps from Puppet guide 

Version-Release number of selected component (if applicable):

Red Hat Satellite 6.12 
Red Hat Satellite 6.11

How reproducible:

Always


Steps to Reproduce:
1. Install a fresh Satellite 6.12

2. Enable puppet features

# satellite-installer --enable-foreman-plugin-puppet --enable-foreman-cli-puppet --foreman-proxy-puppet true --foreman-proxy-puppetca true --foreman-proxy-content-puppet true --enable-puppet --puppet-server true --puppet-server-foreman-ssl-ca /etc/pki/katello/puppet/puppet_client_ca.crt --puppet-server-foreman-ssl-cert /etc/pki/katello/puppet/puppet_client.crt --puppet-server-foreman-ssl-key /etc/pki/katello/puppet/puppet_client.key

3. Purge puppet data completely:

# satellite-maintain plugin purge-puppet --remove-all-data


4. Repeat step to enable back puppet features.


Actual results:

At Step 4, Installer fails on db:migrate step:

~~
2022-09-01 22:26:47 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-09-01 22:26:50 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-09-01 22:26:50 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
Package versions are locked. Continuing with unlock.
2022-09-01 22:27:00 [NOTICE] [configure] Starting system configuration.
2022-09-01 22:27:11 [NOTICE] [configure] 250 configuration steps out of 2132 steps complete.
2022-09-01 22:27:28 [NOTICE] [configure] 500 configuration steps out of 2132 steps complete.
2022-09-01 22:27:31 [NOTICE] [configure] 750 configuration steps out of 2136 steps complete.
2022-09-01 22:27:39 [NOTICE] [configure] 1000 configuration steps out of 2145 steps complete.
2022-09-01 22:27:47 [NOTICE] [configure] 1250 configuration steps out of 2149 steps complete.
2022-09-01 22:28:20 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-09-01 22:28:20 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-09-01 22:28:38 [NOTICE] [configure] 1500 configuration steps out of 2149 steps complete.
2022-09-01 22:28:40 [NOTICE] [configure] 1750 configuration steps out of 3000 steps complete.
2022-09-01 22:28:41 [NOTICE] [configure] 2000 configuration steps out of 3000 steps complete.
2022-09-01 22:28:41 [NOTICE] [configure] 2250 configuration steps out of 3000 steps complete.
2022-09-01 22:28:41 [NOTICE] [configure] 2500 configuration steps out of 3000 steps complete.
2022-09-01 22:29:00 [NOTICE] [configure] 2750 configuration steps out of 3000 steps complete.
2022-09-01 22:29:12 [NOTICE] [configure] System configuration has finished.
~~


db:migrate itself fails :

~~
2022-09-01 22:28:20 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns:
2022-09-01 22:28:20 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: == 20121018152459 CreateHostgro
upClasses: migrating ===========================
2022-09-01 22:28:20 [INFO  ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: -- rename_table(:hostgroups_pup
petclasses, :hostgroup_classes)
2022-09-01 22:28:20 [ERROR ] [configure] '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-09-01 22:28:20 [ERROR ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: change from 'notrun' to ['0'] failed: '/usr/sbin/foreman-rake db:migrate' returned 1 instead of one of [0]
2022-09-01 22:28:20 [DEBUG ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]: Evaluated in 33.49 seconds
~~


It happens as The migration code 20121018152459_create_hostgroup_classes.foreman_puppet.rb tries to rename hostgroups_puppetclasses relation to hostgroup_classes assuming the hostgroups_puppetclasses will exist but It does not exist at this point.


It's because the purge:puppet rake being executed as a part of step 3 and it drops those tables as can be seen in https://github.com/theforeman/foreman/blob/3.1-stable/lib/tasks/cleanup.rake#L19-L71 .


Expected results:

If we can disable puppet feature completely, then we should be able to enable it back as well. 


Additional info:

I tested later and the same issue can be reproduced in Satellite 6.11 as well.

And to add on, Manual execution of db:seed also fails:

~~~
# foreman-rake db:seed
rake aborted!
Foreman::PermissionMissingException: ERF73-0602 [Foreman::PermissionMissingException]: some permissions were not found: ["view_puppetclasses", "import_puppetclasses", "view_environments", "import_environments", "view_external_parameters", "create_external_parameters", "edit_external_parameters", "destroy_external_parameters"]
/usr/share/foreman/app/models/role.rb:336:in `permission_records'
/usr/share/foreman/app/models/role.rb:155:in `add_permissions'
/usr/share/foreman/app/models/role.rb:208:in `add_permissions!'
/usr/share/foreman/app/registries/foreman/plugin/rbac_support.rb:102:in `block (3 levels) in include_permissions_for_role'
/usr/share/foreman/app/models/concerns/authorizable.rb:103:in `skip_permission_check'
/usr/share/foreman/app/registries/foreman/plugin/rbac_support.rb:101:in `block (2 levels) in include_permissions_for_role'
/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:376:in `without_auditing'

~~~

Comment 1 Vladimír Sedmík 2022-09-02 07:00:52 UTC
This issue was reported against 6.11.0 already: https://bugzilla.redhat.com/show_bug.cgi?id=2087067

Keeping this BZ open for 6.12 fix and BZ#2087067 for 6.11.z cherrypick.

Comment 2 Brad Buckingham 2022-09-07 14:40:33 UTC
Sayan,

Do you agree that this is a duplicate of bug 2087067?  Thanks!

Comment 3 Sayan Das 2022-09-07 14:51:18 UTC
Hello 

Yes, this bug has the same request as bug 2087067 .

I haven't closed this one due to the proposal made in Comment 1 i.e. keep the new one for 6.12 and use the old one for 6.11.z.

But feel free to take the appropriate action as needed.


-- Sayan

Comment 4 Brad Buckingham 2022-09-07 15:48:43 UTC
Thanks Sayan!  I'll close as a duplicate and propose the other for both releases.  We prefer not to track multiple bugzillas for different releases, until the bugzilla is selected for a specific release.

*** This bug has been marked as a duplicate of bug 2087067 ***


Note You need to log in before you can comment on or make changes to this bug.