Bug 1594948

Summary: Enabled repo report saves cache even if remote server error occurs, resulting in invalid errata
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: Errata ManagementAssignee: Andrew Kofink <akofink>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.1CC: akofink, egolov, lhellebr
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-host-tools-3.3.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:29:25 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 Justin Sherrill 2018-06-25 19:50:58 UTC
Description of problem:

The enabled-repos-report, which is run on every yum transaction, will save the report in a cache file so to not re-submit the same information multiple times.  It appears that this cache gets saved regardless of whether the report upload was successful or not.  

If an error occurs, the cache would be saved, and it would never re-attempt to upload the report unless something actually changed.


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

How reproducible:
intermittent (with some difficulty). 

Steps to Reproduce:
1.  Enable/disable a repo on a client with sub-man repos
2.  Cause the enabled-repos-report to fail somehow
 

Actual results:
Note that the cache file is updated: /var/cache/katello-agent/enabled_repos.json

Expected results:
Cache is not updated, report is resubmitted with next yum command.

Additional info:

Comment 1 Justin Sherrill 2018-06-25 19:53:11 UTC
A workaround is to run  katello-enabled-repos-upload --force on each client

Comment 4 Andrew Kofink 2018-07-17 11:54:12 UTC
Created redmine issue https://projects.theforeman.org/issues/24270 from this bug

Comment 5 Brad Buckingham 2018-07-20 11:22:21 UTC
Moving to POST as the upstream PR is merged and redmine closed.

Comment 6 Lukáš Hellebrandt 2018-09-27 08:20:21 UTC
Verified with Sat 6.4 snap 22.

1) Have a System registered to Satellite
2) On the System, disable or enable some repo
3) # yum repolist
4) # ll /var/cache/katello-agent/enabled_repos.json
   => Time changed to current time
5) Disable or enable some repo again
6) On the Satellite, set firewall so that connection from the System fails
7) # yum repolist
8) # ll /var/cache/katello-agent/enabled_repos.json
   => Time stayed the same
9) Enable connections to Satellite, run 'yum repolist', check that the time has been set to current

Comment 7 Bryan Kearney 2018-10-16 19:29:25 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-2018:2927