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.
Created attachment 1571587 [details] foreman-tail
Just tested on 6.5 with the same setup and this is NOT a regression.
This blocks testing bug 1542844.
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.
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)"
Connecting redmine issue https://projects.theforeman.org/issues/27030 from this bug
Just tested on 6.4 with the same setup and got the same error.
Upstream bug assigned to oprazak
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.
Connecting redmine issue https://projects.theforeman.org/issues/27756 from this bug
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".
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