Bug 1533424

Summary: smart_proxy_openscap does not rescue Errno::ECONNREFUSED
Product: Red Hat Satellite Reporter: Ondřej Pražák <oprazak>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, ehelms, mhulan, oprazak, sjagtap
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: smart_proxy_openscap-0.6.9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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
proxy error none

Description Ondřej Pražák 2018-01-11 10:15:35 UTC
Created attachment 1379937 [details]
proxy error

Description of problem:
We do not rescue from Errno::ECONNREFUSED exception on proxy, so when proxy tries to upload Arf report to server, connection is refused and exception is raised, which is not handled gracefully.


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

How reproducible:
always

Steps to Reproduce:
1. Stop satellite server: systemctl stop httpd
2. generate a report by running foreman_scap_client manually, proxy should save it to spool since server is not available
3. Observe the error

Actual results:
Error from proxy gets printed as a response to client, see the attachment


Expected results:
No error gets printed on stdout, proxy saves the report to spool

Additional info:

Comment 1 Ondřej Pražák 2018-01-11 10:17:22 UTC
Created redmine issue http://projects.theforeman.org/issues/22245 from this bug

Comment 2 Satellite Program 2018-01-11 11:24:28 UTC
Upstream bug assigned to oprazak

Comment 3 Satellite Program 2018-01-11 11:24:31 UTC
Upstream bug assigned to oprazak

Comment 10 Satellite Program 2018-01-16 17:26:25 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/22245 has been resolved.

Comment 11 Sanket Jagtap 2018-01-31 14:59:34 UTC
Build: Satellite 6.3.0 snap 33


[root@sjagtap-qe-capsule openscap]# rpm -qa | grep scap
rubygem-openscap-0.4.7-1.el7sat.noarch
openscap-1.2.14-2.el7.x86_64
rubygem-smart_proxy_openscap-0.6.9-1.el7sat.noarch
puppet-foreman_scap_client-0.3.16-1.el7sat.noarch
perl-Pod-Escapes-1.04-292.el7.noarch

Steps to Reproduce:
1. Stop satellite server: systemctl stop httpd
2. generate a report by running foreman_scap_client manually, proxy should save it to spool since server is not available

No error , arf was sent to spool dir


root@qe-capsule-feature-rhel6 ~]# systemctl stop httpd

[root@bkr-hv03-guest17 ~]# foreman_scap_client 1
DEBUG: running: oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_standard  --results-arf /tmp/d20180131-32194-1ias1c7/results.xml /var/lib/openscap/content/96c2a9d5278d5da905221bbb2dc61d0ace7ee3d97f021fccac994d26296d986d.xml
WARNING: This content points out to the remote resources. Use `--fetch-remote-resources' option to download them.
WARNING: Skipping https://www.redhat.com/security/data/oval/com.redhat.rhsa-RHEL7.xml.bz2 file which is referenced from XCCDF content
DEBUG: running: /usr/bin/bzip2 /tmp/d20180131-32194-1ias1c7/results.xml
Uploading results to https://capsule:9090/compliance/arf/1

[root@sjagtap-qe-capsule openscap]# ls
arf
[root@sjagtap-qe-capsule openscap]# pwd
/var/spool/foreman-proxy/openscap

Comment 12 Satellite Program 2018-02-21 16:54:17 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:0336