Bug 1854397

Summary: Compliance reports are not being uploaded to satellite.
Product: Red Hat Satellite Reporter: Jameer Pathan <jpathan>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8.0CC: ehelms, mhulan, oprazak
Target Milestone: 6.8.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_openscap-4.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 13:03:56 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 Jameer Pathan 2020-07-07 12:04:34 UTC
Description of problem:
Compliance reports are not being uploaded to satellite. 

Version-Release number of selected component (if applicable):
- Satellite 6.8.0 snap 7

How reproducible:
- Always

Steps to Reproduce:
1. Register a host to Satellite.
2. Assign OpenSCAP Capsule, theforeman.foreman_scap_client ansible role and compliance policy to host.
3. Run ansible roles for hosts.

Actual results:
Report not uploaded from proxy to Foreman server, cause: Failed to upload to Foreman, saving in spool. Failed with: 500 "Internal Server Error"


Expected results:
Reports are uploaded to Satellite server.

Additional info:
In /var/log/foreman/production.log:

error (ActiveRecord::RecordNotUnique): PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_scaptimony_asset_policies_on_asset_id_and_policy_id"
DETAIL:  Key (asset_id, policy_id)=(2, 3) already exists.

Comment 2 Ondřej Pražák 2020-07-09 10:30:27 UTC
Created redmine issue https://projects.theforeman.org/issues/30353 from this bug

Comment 3 Bryan Kearney 2020-07-09 12:03:01 UTC
Upstream bug assigned to oprazak

Comment 4 Jameer Pathan 2020-07-23 10:24:19 UTC
Verified

Verified with:
- Satellite 6.8.0 snap 9
- tfm-rubygem-foreman_openscap-4.0.1-1.fm2_1.el7sat.noarch

Test steps:
1. Register a host to Satellite.
2. Assign OpenSCAP Capsule, theforeman.foreman_scap_client ansible role and compliance policy to host.
3. Run ansible roles for hosts.
4. Run OpenScap scan

Observations:
- Reports were successfully uploaded to Satellite server.

Comment 7 errata-xmlrpc 2020-10-27 13:03:56 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.8 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-2020:4366