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 1634223

Summary: /usr/bin/smart-proxy-openscap-send script is broken and never run.
Product: Red Hat Satellite Reporter: Hao Chang Yu <hyu>
Component: SCAP PluginAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.3CC: mhulan, oprazak
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-02 08:16:59 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:

Description Hao Chang Yu 2018-09-29 05:10:05 UTC
Description of problem:

Run "/usr/bin/smart-proxy-openscap-send" manually and it will exit immediately without doing anything.

The log file is empty and last update since Feb.
# ls -lrt /var/log/foreman-proxy/openscap-send.log
-rw-r--r--. 1 foreman-proxy foreman-proxy 0 Feb 16  2017 /var/log/foreman-proxy/openscap-send.log

When debugging the script, I found that the plugin settings are not loaded.

1) Edit "/usr/bin/smart-proxy-openscap-send"

puts "Plugin settings: #{Proxy::OpenSCAP::Plugin.settings.to_h}" <==== add this line

# Don't run if OpenSCAP plugin is disabled.
exit unless Proxy::OpenSCAP::Plugin.settings.enabled == true  <===== Script will exit here if enabled is not true

2) Run it again

# /usr/bin/smart-proxy-openscap-send
Plugin settings: {}          <=========== Setting is empty

Tested in Satellite 6.2.15 too and it works.

I found that in Satellite 6.2, the module will autoload the settings if not loaded, but in Satellite 6.3 it will just assign an empty OpenStruct object.

3) Edit /usr/share/foreman-proxy/lib/proxy/pluggable.rb file.

  attr_writer :settings
  def settings
    @settings ||= Proxy::Settings.load_plugin_settings(plugin_default_settings, settings_file)   <=== Add this line that I copy from Satellite 6.2.15
    #@settings ||= OpenStruct.new   <==== Comment out this line
  end

4) Run it again. The plugin settings are loaded now

/usr/bin/smart-proxy-openscap-send
Plugin settings: {:enabled=>true, :spooldir=>"/var/spool/foreman-proxy/openscap", :openscap_send_log_file=>"/var/log/foreman-proxy/openscap-send-22222222.log", :contentdir=>"/var/lib/foreman-proxy/openscap/content", :reportsdir=>"/var/lib/foreman-proxy/openscap/reports", :failed_dir=>"/var/lib/foreman-proxy/openscap/failed", :tailoring_dir=>"/usr/share/foreman-proxy/lib/../openscap/tailoring", :corrupted_dir=>"/var/lib/foreman-proxy/openscap/corrupted"}

Comment 1 Ondřej Pražák 2018-10-02 08:16:59 UTC
Thank you for reporting this bug, it is already tracked as #1542023 and fixed in 6.4, therefore I will close as a duplicate. Feel free to reopen if I misunderstood or if the problem persists in 6.4.

*** This bug has been marked as a duplicate of bug 1542023 ***