Bug 2160297

Summary: Satellite 6.12 upgrade fails with error ERF73-0602 [Foreman::PermissionMissingException]: some permissions were not found: ["view_puppetclasses", "view_environments", :view_environments, :view_puppetclasses] (Foreman::PermissionMissingException)
Product: Red Hat Satellite Reporter: Jayant Bhatia <jbhatia>
Component: Discovery PluginAssignee: Ron Lavi <rlavi>
Status: CLOSED ERRATA QA Contact: Gaurav Talreja <gtalreja>
Severity: medium Docs Contact:
Priority: high    
Version: 6.12.0CC: ahumbe, gtalreja, pcreech, rlavi
Target Milestone: 6.13.0Keywords: PrioBumpGSS, Triaged, Upgrades
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_discovery-21.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2161742 (view as bug list) Environment:
Last Closed: 2023-05-03 13:24:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jayant Bhatia 2023-01-12 01:31:43 UTC
Description of problem:

Upgrading Satellite server to version 6.12 fails with below error trace.

/usr/share/foreman/app/models/role.rb:337:in `permission_records': ERF73-0602 [Foreman::PermissionMissingException]: some permissions were not found: ["view_puppetclasses", "view_environments", :view_environments, :view_puppetclasses] (Foreman::PermissionMissingException)

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

Steps to Reproduce:
1. This issue is observed only with upgrade and not with the installation.
2. Upgrade Satellite RHEL OS from RHEL-7 to RHEL-8 on Satellite 6.11. Then try to upgrade Satellite 6.11 to version 6.12.

Actual results: Satellite upgrade fails with mentioned error trace.


Expected results: Satellite upgrade should be successful.

Comment 3 Ron Lavi 2023-01-16 11:46:21 UTC
Yeah, we missed that cherry-pick...
opened https://github.com/theforeman/foreman_discovery/pull/594
and I will do a release of rubygem-foreman_discovery-21.0.5

Comment 4 Ron Lavi 2023-01-16 20:36:04 UTC
packaging PR: https://github.com/theforeman/foreman-packaging/pull/8934
moving to POST

Comment 5 Gaurav Talreja 2023-02-02 18:09:49 UTC
Verified.

Tested upgrade from 6.12.2 to 6.13.0, which passed successfully w/o puppet permission errors

Steps to reproduce mentioned issue:
1. Setup 6.13.0 Snap9.0 with Discovery installed
2. Add Discovery Manager and Discovery Reader roles for the admin user.
3. Revert the following PRs which were included for this and 6.11 BZ 2104339
  https://github.com/theforeman/foreman_discovery/pull/554
  https://github.com/theforeman/foreman_discovery/pull/594
4. Run the satellite-installer, which passes but the following warning exists in the logs,
...
2023-02-01T09:14:03 [W|app|] Could not create role 'Discovery Manager': ERF73-0602 [Foreman::PermissionMissingException]: some permissions were not found: [:view_environments, :view_puppetclasses]
...

Comment 8 errata-xmlrpc 2023-05-03 13:24:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097