Bug 1753313

Summary: "undefined method `policies' for nil:NilClass" when assigning a policy
Product: Red Hat Satellite Reporter: Lukáš Hellebrandt <lhellebr>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: akapse, alexandre.chanu, bkearney, gpadholi, jkrajice, jpasqual, ktordeur, mhulan, momran, oprazak, pcreech, susalvi
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:25:37 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:
Attachments:
Description Flags
screenshot.png none

Description Lukáš Hellebrandt 2019-09-18 14:57:15 UTC
Description of problem:
I don't know how I got to this state but when I try to assign a policy to some host, it fails with error "undefined method `policies' for nil:NilClass".

Version-Release number of selected component (if applicable):
Reproduced on Sat 6.6 snap 20

How reproducible:
Unknown

Steps to Reproduce:
1. ???
2. Hosts -> All Hosts
3. Select host
4. Select Action -> Assign Compliance Policy

Actual results:
undefined method `policies' for nil:NilClass

Expected results:
Compliance policy assigned

Comment 3 Lukáš Hellebrandt 2019-09-18 14:59:17 UTC
No traceback in production.log

Comment 4 Lukáš Hellebrandt 2019-09-19 09:35:05 UTC
It is bound to one certain policy. Operations involving it fail, e.g. assigning it to a host or changing the policy's hostgroup. Creating a new policy and using it instead, everything works.

Comment 9 Lukáš Hellebrandt 2019-09-26 09:49:28 UTC
Created attachment 1619440 [details]
screenshot.png

Comment 10 Ondřej Pražák 2019-09-30 08:38:29 UTC
Created redmine issue https://projects.theforeman.org/issues/27959 from this bug

Comment 11 Bryan Kearney 2019-09-30 14:04:02 UTC
Upstream bug assigned to oprazak

Comment 12 Bryan Kearney 2019-09-30 14:04:04 UTC
Upstream bug assigned to oprazak

Comment 13 Bryan Kearney 2019-10-01 12:04:07 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/27959 has been resolved.

Comment 14 Sanket Jagtap 2020-01-02 07:25:56 UTC
Build:Satellite 6.7 snap7

Steps:
1. Create a host with policy 
2. Generate arf reports for that policy and host
3. Delete the host
4. Assign the same policy to another host. 


The policy assignment was successful and no errors were observed

Comment 17 errata-xmlrpc 2020-04-14 13:25:37 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, 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-2020:1454

Comment 18 Oleh Fedorenko 2023-09-04 14:19:35 UTC
*** Bug 1819823 has been marked as a duplicate of this bug. ***