Bug 1710241

Summary: creating host with openscap capsule fails with ISE when org/loc is not properly selected for a capsule
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Peter Dragun <pdragun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: aruzicka, inecas, mhulan, oprazak, pcreech, pdragun, rplevka
Target Milestone: 6.6.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_openscap-1.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 19:51:02 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
traceback none

Description Jan Hutař 2019-05-15 07:32:20 UTC
Description of problem:
Creating host with openscap capsule fails with ISE when org/loc is not properly selected for a capsule


Version-Release number of selected component (if applicable):
satellite-6.6.0-4.beta.el7sat.noarch


How reproducible:
always


Steps to Reproduce:
1. # hammer -v -u admin -p changeme --output=csv host create --architecture-id="1" --domain-id="4" --ip="95.253.203.135" --location-id="1" --mac="c4:28:04:a8:20:bb" --medium-id="12" --name="QBtbElRVyA" --operatingsystem-id="1" --openscap-proxy-id="1" --organization-id="7" --partition-table-id="104" --root-password="RLxtKubz"


Actual results:
Could not create the host:
  Internal Server Error: the server was unable to finish the request. This may be caused by unavailability of some required service, incorrect API call or a server-side bug. There may be more information in the server's logs.


Expected results:
Should not print ISE, but some reasonable error message


Additional info:
When I have fixed org/loc assignment in the capsule, same command worked.

Comment 3 Jan Hutař 2019-05-15 07:34:28 UTC
Created attachment 1568828 [details]
traceback

Comment 4 Ondřej Pražák 2019-06-04 07:59:10 UTC
Created redmine issue http://projects.theforeman.org/issues/26940 from this bug

Comment 5 Bryan Kearney 2019-06-04 10:02:38 UTC
Upstream bug assigned to oprazak

Comment 6 Bryan Kearney 2019-06-04 10:02:39 UTC
Upstream bug assigned to oprazak

Comment 7 Bryan Kearney 2019-06-07 16:03:15 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26940 has been resolved.

Comment 8 Peter Dragun 2019-07-17 13:37:46 UTC
Failed QA. Host is created even if organization of capsule is different as organization of created host.

#hammer organization list
---|----------------------|----------------------|-------------|---------------------
ID | TITLE                | NAME                 | DESCRIPTION | LABEL               
---|----------------------|----------------------|-------------|---------------------
1  | Default Organization | Default Organization |             | Default_Organization
3  | mABVbH               | mABVbH               |             | mABVbH              

# hammer capsule info --id="1"
.
.
.
Locations:     
    BcqKxJ2xQr
Organizations: 
    mABVbH

# hammer -v -u admin -p changeme --output=csv host create --architecture-id="1" --domain-id="1" --ip="95.253.203.135" --location-id="2" --mac="c4:28:04:a8:20:bb" --medium-id="12" --name="QBtbElRVyA2" --operatingsystem-id="1" --openscap-proxy-id="1" --organization-id="1" --partition-table-id="106" --root-password="RLxtKubz"
Message,Id,Name
Host created.,4,qbtbelrvya2.lab.eng.brq.redhat.com

Comment 9 Peter Dragun 2019-07-17 13:40:50 UTC
OpenSCAP capsule is really assigned from another organization.
# hammer host info --id="4"
Id:                       4
Name:                     qbtbelrvya2.lab.eng.brq.redhat.com
Organization:             Default Organization
Location:                 Default Location
Cert name:                qbtbelrvya2.lab.eng.brq.redhat.com
...
OpenSCAP Proxy:           1
...

Comment 10 Bryan Kearney 2019-07-17 14:02:30 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26940 has been resolved.

Comment 13 Peter Dragun 2019-08-19 10:36:08 UTC
Verified on Sat 6.6 snap 16. When creating host with OpenSCAP with different organizations, error message is shown as expected. Same applies to locations.

Comment 14 Bryan Kearney 2019-10-22 19:51:02 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-2019:3172