Bug 1712345 - Safemode::NoMethodError: undefined method '#map' for String::Jail (String)
Summary: Safemode::NoMethodError: undefined method '#map' for String::Jail (String)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: SCAP Plugin
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.6.0
Assignee: Ondřej Pražák
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-21 11:30 UTC by Lukáš Hellebrandt
Modified: 2019-10-22 19:49 UTC (History)
5 users (show)

Fixed In Version: tfm-rubygem-foreman_openscap-1.0.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-22 19:49:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
foreman-tail (83.16 KB, text/plain)
2019-05-21 11:33 UTC, Lukáš Hellebrandt
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 27030 0 Normal Closed Safemode::NoMethodError: undefined method '#map' for String::Jail (String) 2020-10-20 15:54:43 UTC
Foreman Issue Tracker 27756 0 Normal Closed Handle a case when puppet class is not assigned when running scan via rex 2020-10-20 15:54:43 UTC

Description Lukáš Hellebrandt 2019-05-21 11:30:09 UTC
Description of problem:
When trying to run SCAP scan, scan fails and there is the following in the log (traceback attached): "Safemode::NoMethodError: undefined method '#map' for String::Jail (String)"

Version-Release number of selected component (if applicable):
Reproduced on Sat 6.6 snap 3

How reproducible:
Deterministic

Steps to Reproduce:
1. Setup SCAP policy
2. Hosts -> All Hosts -> <host> -> Schedule Remote Job -> Run OpenSCAP scan

Actual results:
Failure, traceback

Expected results:
Successful scan, no traceback

Additional info:
It is quite possible that there is something wrong in my configuration. However, a NoMethodError is a wrong result anyway.

Comment 3 Lukáš Hellebrandt 2019-05-21 11:33:13 UTC
Created attachment 1571587 [details]
foreman-tail

Comment 4 Lukáš Hellebrandt 2019-05-21 12:24:59 UTC
Just tested on 6.5 with the same setup and this is NOT a regression.

Comment 5 Lukáš Hellebrandt 2019-05-21 12:26:20 UTC
This blocks testing bug 1542844.

Comment 8 Ondřej Pražák 2019-06-04 07:15:17 UTC
I was able to reproduce, however my host was not configured properly. Additional steps I needed to take after creating a policy:

a. Assign policy to host: Hosts -> All hosts, 'Select action' dropdown -> Assign Compliance Policy, choose a policy in modal and confirm
b. Check the host edit page and make sure host has openscap capsule and puppet classes for foreman_scap_client assigned. If the puppet classes were previously not assigned, puppet must be run for configuration to propagate.
c. run openscap scan, no more safemode errors 

Does this remove the error? I agree we should not show the NoMethodError.

Comment 9 Lukáš Hellebrandt 2019-06-05 14:46:04 UTC
I tried and it didn't help. However, in both cases (with and without the "fix"), I am now getting a different error:

"Warning! error during rendering: undefined method '#map' for String::Jail (String)"

Comment 10 Ondřej Pražák 2019-06-12 13:17:09 UTC
Connecting redmine issue https://projects.theforeman.org/issues/27030 from this bug

Comment 12 Akshay Kapse 2019-07-03 13:18:36 UTC
Just tested on 6.4 with the same setup and got the same error.

Comment 14 Bryan Kearney 2019-07-23 12:04:22 UTC
Upstream bug assigned to oprazak

Comment 15 Bryan Kearney 2019-07-23 12:04:24 UTC
Upstream bug assigned to oprazak

Comment 16 Lukáš Hellebrandt 2019-08-28 11:56:03 UTC
FailedQE with Sat 6.6 snap 17.

1) Register a host, assign puppet class, assign policy
2) Run scan -> success
3) Unassign all policies -> success (I'd expect error: "Create and assign a policy to this host before proceeding")
4) Unassign all puppet classes -> fail
5) Assign a policy -> fail (I'd expect some error but not "Create and assign a policy to this host before proceeding")

Anyway, the "undefined method" error is not present anymore, this BZ just needs a bit polishing.

Comment 17 Ondřej Pražák 2019-09-02 11:07:42 UTC
Connecting redmine issue https://projects.theforeman.org/issues/27756 from this bug

Comment 18 Lukáš Hellebrandt 2019-09-19 10:07:22 UTC
Verified with Sat 6.6 snap 20.

When running a scan on a host without a policy, the error message is: "Create and assign a policy to this host before proceeding"
When running a scan on a host without the puppet classes or without both assigned, the error message is: "Cannot detect values for policies input, please make sure your host is properly configured for openscap".

Comment 19 Bryan Kearney 2019-10-22 19:49:07 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


Note You need to log in before you can comment on or make changes to this bug.