Bug 1696969

Summary: Unable to upload arf report on rhel 6 client: unexpected '.', expecting kEND (SyntaxError)
Product: Red Hat Satellite 6 Reporter: Nikhil Kathole <nkathole>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: mhulan, oprazak, zhunting
Target Milestone: 6.5.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_scap_client-0.4.5,rubygem-foreman_scap_client-0.4.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:40:38 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:

Description Nikhil Kathole 2019-04-06 18:17:27 UTC
Description of problem:

Trying to upload scap report on rhel 6 client gives error

# foreman_scap_client 2
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/lib/foreman_scap_client/client.rb:61: syntax error, unexpected '.', expecting kEND (SyntaxError)
                      .select { |item| item.start_wit...
                       ^
/usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/lib/foreman_scap_client/client.rb:62: syntax error, unexpected '.', expecting kEND
                      .join("\n")
                       ^
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/lib/foreman_scap_client.rb:2
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/bin/foreman_scap_client:3
	from /usr/bin/foreman_scap_client:19:in `load'
	from /usr/bin/foreman_scap_client:19



Version-Release number of selected component (if applicable): 
Satellite 6.5 snap 23

rubygem-foreman_scap_client-0.4.4-1.el6sat.noarch


How reproducible: always


Steps to Reproduce:
1. Register rhel 6 client to satellite
2. Assign scap policy
3. Try to upload report to satellite

Actual results:
# foreman_scap_client 2
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/lib/foreman_scap_client/client.rb:61: syntax error, unexpected '.', expecting kEND (SyntaxError)
                      .select { |item| item.start_wit...
                       ^
/usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/lib/foreman_scap_client/client.rb:62: syntax error, unexpected '.', expecting kEND
                      .join("\n")
                       ^
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/lib/foreman_scap_client.rb:2
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.4.4/bin/foreman_scap_client:3
	from /usr/bin/foreman_scap_client:19:in `load'
	from /usr/bin/foreman_scap_client:19



Expected results: Successful upload of arf reports.


Additional info:

/etc/foreman_scap_client/config.yaml has correct configurations.

# policy (key is id as in Foreman)

2:
  :profile: 'xccdf_org.ssgproject.content_profile_standard'
  :content_path: '/var/lib/openscap/content/6298742afc45309f86ac467c0c9a3e433ff505dd3d237dd8cbf72be1a02937bb.xml'
  # Download path
  # A path to download SCAP content from proxy
  :download_path: '/compliance/policies/2/content/6298742afc45309f86ac467c0c9a3e433ff505dd3d237dd8cbf72be1a02937bb'
  :tailoring_path: ''
  :tailoring_download_path: ''

Comment 4 Ondřej Pražák 2019-04-08 09:23:28 UTC
Created redmine issue http://projects.theforeman.org/issues/26556 from this bug

Comment 5 Bryan Kearney 2019-04-08 14:07:10 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 7 Nikhil Kathole 2019-04-16 06:01:32 UTC
VERIFIED

Version tested:
Satellite 6.5 snap 24

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-RHEL6.xml.bz2 file which is referenced from XCCDF content

File /var/lib/openscap/content/6298742afc45309f86ac467c0c9a3e433ff505dd3d237dd8cbf72be1a02937bb.xml is missing. Downloading it from proxy.
Download SCAP content xml from: https://satellite.example.com:9090/compliance/policies/2/content/6298742afc45309f86ac467c0c9a3e433ff505dd3d237dd8cbf72be1a02937bb
DEBUG: running: oscap xccdf eval  --profile xccdf_org.ssgproject.content_profile_standard  --results-arf /tmp/d20190416-8474-quv5xh/results.xml /var/lib/openscap/content/6298742afc45309f86ac467c0c9a3e433ff505dd3d237dd8cbf72be1a02937bb.xml
DEBUG: running: /usr/bin/env bzip2 /tmp/d20190416-8474-quv5xh/results.xml
Uploading results to https://satellite.example.com:9090/compliance/arf/2
Report uploaded, report id: 194

Exit status: 0

Comment 9 errata-xmlrpc 2019-05-14 12:40:38 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:1222