Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1599414

Summary: Run openscap scan on host error in "No template mapped to feature Run OpenSCAP scan"
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: SCAP PluginAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: inecas, mhulan, oprazak, pcreech, rabajaj, tbrisker
Target Milestone: 6.4.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman_openscap-0.10.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:13:04 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
screenshot of UI none

Description Nikhil Kathole 2018-07-09 17:28:52 UTC
Created attachment 1457556 [details]
screenshot of UI

Description of problem: Clicking on Run openscap scan on host error in "No template mapped to feature Run OpenSCAP scan". 


Version-Release number of selected component (if applicable):
Satellite 6.4 snap 11


How reproducible: always


Steps to Reproduce:
1. Navigate to Hosts -> All hosts
2. Click on any host to see details.
3. Click on Run OpenSCAP scan from dropdown near "schedule remote job"

Actual results:
Error on UI showing Oops, we're sorry but something went wrong ERF42-5962 [Foreman::Exception]: No template mapped to feature Run OpenSCAP scan

and production.log showed

2018-07-09T13:21:40 [W|app|b8014] Action failed
Foreman::Exception: ERF42-5962 [Foreman::Exception]: No template mapped to feature Run OpenSCAP scan
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.5.3/app/models/job_invocation_composer.rb:285:in `job_template'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.5.3/app/models/job_invocation_composer.rb:246:in `params'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.5.3/app/models/job_invocation_composer.rb:326:in `for_feature'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.5.3/app/controllers/job_invocations_controller.rb:138:in `prepare_composer'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-1.5.3/app/controllers/job_invocations_controller.rb:42:in `create'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:186:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'



Expected results: Run openscap scan on host should work.


Additional info:

Comment 3 Marek Hulan 2018-07-13 10:24:53 UTC
The simple workaround is to make the job template "Run OpenSCAP scans" available in all orgs and locs, should not block any testing. This also does not happen under admin user. I'm working on the proper fix.

Comment 4 Marek Hulan 2018-07-13 10:25:56 UTC
Created redmine issue https://projects.theforeman.org/issues/24248 from this bug

Comment 5 Marek Hulan 2018-07-13 10:27:57 UTC
given the workaround and the fact this is generic misconfiguration that we can avoid by assigning the template to all default orgs/locs, I'm removing blocker suggestion, please assign back if you disagree

Comment 7 Satellite Program 2018-07-17 10:04:09 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/24248 has been resolved.

Comment 8 Nikhil Kathole 2018-07-23 08:35:20 UTC
VERIFIED

Version tested:
Satellite 6.4 snap 13

2018-07-23T04:33:38 [I|app|] Started POST "/job_invocations?feature=foreman_openscap_run_scans&host_ids%5B%5D=2" for IP at 2018-07-23 04:33:38 -0400
2018-07-23T04:33:38 [I|app|b9f09] Processing by JobInvocationsController#create as HTML
2018-07-23T04:33:38 [I|app|b9f09]   Parameters: {"authenticity_token"=>"mnO1KRIep+r+/jJm8PHkrwj5hm1Q29DcM70edvE3fNe1vMV6GaN/KXfO0XCE8qao7a1efvo7Fhd+n0fPcPe2sQ==", "feature"=>"foreman_openscap_run_scans", "host_ids"=>["2"]}
2018-07-23T04:33:38 [I|app|b9f09] Current user: admin (administrator)
2018-07-23T04:33:38 [I|aud|b9f09] create event for JobInvocation with id 5
2018-07-23T04:33:38 [I|app|b9f09] Current user: admin (administrator)
2018-07-23T04:33:38 [I|app|b9f09] Current user: admin (administrator)
2018-07-23T04:33:38 [I|app|b9f09] Current user: admin (administrator)
2018-07-23T04:33:38 [I|app|b9f09] Redirected to https://satellite/job_invocations/5

Comment 9 Bryan Kearney 2018-10-16 19:13:04 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