Bug 1941096

Summary: Report Templates Host - Applied Errata report is empty.
Product: Red Hat Satellite Reporter: Bharati Kailas Shahu <bshahu>
Component: Errata ManagementAssignee: Waldirio M Pinheiro <wpinheir>
Status: CLOSED ERRATA QA Contact: Tasos Papaioannou <tpapaioa>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8.0CC: ahumbe, akaiser, arahaman, dmatoule, ehelms, hyu, janarula, kdeshpan, mhulan, mmccune, myoder, oprazak, rkarimpa, wpinheir
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1973369 (view as bug list) Environment:
Last Closed: 2021-11-16 14:10:29 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 Bharati Kailas Shahu 2021-03-19 22:54:01 UTC
Description of problem:

Report Templates Host - Applied Errata report showing no data.

While generating Report Templates "Host - Applied Errata report" file is empty.

~~~~~~~~~
Login to Satellite WEB UI >  Monitor > Report Templates > Host - Applied Errata 
~~~~~~~~

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

How reproducible:      
100%

Steps to Reproduce:
1. // Generate Report: 

~~~~~~~~~
Login to Satellite WEB UI >  Monitor > Report Templates > Generate report for "Host - Applied Errata"  

2. Generated report is empty.

3. Checked task "Actions::Katello::Host::Erratum::Install" for generated for applied errata on Satellite server but this task is also empty.

~~~~~~~~~
 [root@satellite ~]# hammer task list --search="label = Actions::Katello::Host::Erratum::Install"
---|--------|-------|--------|------------|----------|-------|------------
ID | ACTION | STATE | RESULT | STARTED AT | ENDED AT | OWNER | TASK ERRORS
---|--------|-------|--------|------------|----------|-------|------------
~~~~~~~~~

4. Noticed task "Actions::Katello::Host::Erratum::ApplicableErrataInstall" is generated for applied errata.

~~~~~~~~~
[root@satellite ~]# hammer task list --search="label = Actions::Katello::Host::Erratum::ApplicableErrataInstall"
-------------------------------------|-----------------------------------------------------------|---------|---------|---------------------|---------------------|---------|---------------------------------------------------------------------------------
ID                                   | ACTION                                                    | STATE   | RESULT  | STARTED AT          | ENDED AT            | OWNER   | TASK ERRORS                                                                     
-------------------------------------|-----------------------------------------------------------|---------|---------|---------------------|---------------------|---------|---------------------------------------------------------------------------------
1111xaxa-8e70-xaxa-8bd9-23f091xxxxxx | Install Applicable Errata on Host1-example.com      | stopped | success | 2021/03/20 10:47:15 | 2021/03/20 10:51:15 | admin |                                                                                 

3333xaxa-9945-2d5a-xaxa-1c8693xxxxxx | Install Applicable Errata on Host2-example.com        | stopped | success | 2021/03/20 07:51:20 | 2021/03/20 07:56:20 | admin |                                                                                 

5555xbxb-dxxb-5e9a-xbxb-dz50b7xxxxxx | Install Applicable Errata on Host3-example.com         | stopped | success | 2021/03/20 07:51:06 | 2021/03/20 07:50:06 | admin | 
-------------------------------------|-----------------------------------------------------------|---------|---------|---------------------|---------------------|---------|---------------------------------------------------------------------------------
[root@satellite ~]#
~~~~~~~~~

5. Report is only consider task label "Actions::Katello::Host::Erratum::Install" where as report do not consider the task label "Actions::Katello::Host::Erratum::ApplicableErrataInstall" 

~~~~~~~~
https://github.com/Katello/katello/blob/53e9d86ba155a175fb2efeec00e84c20702b6ca4/app/lib/katello/concerns/base_template_scope_extensions.rb#L110
~~~~~~~~



Actual results:

It does not contain any errata information in the Applied Errata report.


Expected results:
  Host - Applied Errata report should contain the errata information.

Comment 1 Marek Hulan 2021-03-22 08:20:51 UTC
Moving to Errata management, has this changed recently? If so, it needs to changed at https://github.com/Katello/katello/blob/b16e577c23c431bea930e86df27144ecac0e113c/app/lib/katello/concerns/base_template_scope_extensions.rb#L98-L165

Comment 5 Marek Hulan 2021-03-30 08:54:20 UTC
I took a look into the codebase and it seems Actions::Katello::Host::Erratum::ApplicableErrataInstall is a wrapper around Actions::Katello::Host::Erratum::Install. The wrapper looks whether there's at least some applicable errata and if it's not, it does nothing. If there's is some, it will create Actions::Katello::Host::Erratum::Install for that.

In this case, customer may see many Actions::Katello::Host::Erratum::ApplicableErrataInstall because they are regularly applying applicable erratas while there are no applicable errata to be applied. Therefore there's no Actions::Katello::Host::Erratum::Install to report on. Could that be the case? Did they see any applicable errata for the host prior applying?

Comment 7 Bryan Kearney 2021-04-15 10:45:07 UTC
Upstream bug assigned to wpinheir

Comment 8 Bryan Kearney 2021-04-15 10:45:10 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32312 has been resolved.

Comment 16 Marek Hulan 2021-04-23 09:48:29 UTC
Resetting the state since additional fix has been sent for the review.

Comment 19 Bryan Kearney 2021-05-15 22:38:32 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32312 has been resolved.

Comment 20 Tasos Papaioannou 2021-06-02 14:28:09 UTC
Verified on 6.10.0 snap 2.0.

Steps:

1. Sync Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server repo.

2. Register a RHEL 7.9 content host and apply applicable errata:
Hosts > Content Hosts > click on content host > Errata tab > select errata > Apply Selected > Apply.

3. Generate a report from the Applied Errata report template:
Monitor > Report Templates > click Generate for 'Host - Applied Errata'.

Fill fields:

Filter Errata Type: all
Include Last Reboot: no
Status: success

and click Submit.

4. Open the generated CSV file, and verify that the applied errata are listed.

Comment 22 Justin Sherrill 2021-06-10 17:48:58 UTC
*** Bug 1939538 has been marked as a duplicate of this bug. ***

Comment 23 wclark 2021-06-16 15:28:31 UTC
*** Bug 1965379 has been marked as a duplicate of this bug. ***

Comment 26 errata-xmlrpc 2021-11-16 14:10:29 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 (Moderate: Satellite 6.10 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-2021:4702