RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1859968 - sosreport doesn't collect haproxy.cfg
Summary: sosreport doesn't collect haproxy.cfg
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sos
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.4
Assignee: Pavel Moravec
QA Contact: Miroslav Hradílek
URL:
Whiteboard:
Depends On:
Blocks: 1993051 1993052
TreeView+ depends on / blocked
 
Reported: 2020-07-23 11:59 UTC by Arie Bregman
Modified: 2021-08-12 10:01 UTC (History)
8 users (show)

Fixed In Version: sos-4.0-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1993051 1993052 (view as bug list)
Environment:
Last Closed: 2021-05-18 14:47:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github sosreport sos pull 2163 0 None closed [haproxy] enable the plugin when puppet-generated subdir exists 2021-01-21 10:05:34 UTC

Description Arie Bregman 2020-07-23 11:59:38 UTC
Description of problem:

Running sosreport doesn't collect containerized haproxy config from /var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg

Version-Release number of selected component (if applicable): sos-3.8.6


How reproducible: 100%


Steps to Reproduce:
1. run sesreport
2. open archive and see there is no /var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg

Comment 1 Pavel Moravec 2020-07-23 12:19:18 UTC
This sounds strange, since haproxy plugin there matches

https://github.com/sosreport/sos/blame/legacy-3.9/sos/plugins/haproxy.py

where I see:

class HAProxy(Plugin, RedHatPlugin, DebianPlugin):
    """HAProxy load balancer
    """

    plugin_name = 'haproxy'
    profiles = ('webserver',)

    packages = ('haproxy',)

    def setup(self):
        var_puppet_gen = "/var/lib/config-data/puppet-generated/haproxy"
        self.add_copy_spec([
            "/etc/haproxy/haproxy.cfg",
            var_puppet_gen + "/etc/haproxy/haproxy.cfg"
        ])
    ..


So, /var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg should be collected. If this plugin was enabled.


Is haproxy package installed on the system? Could you please run "sosreport -vvv" and attach the tarball afterwards?

Comment 3 Pavel Moravec 2020-07-23 14:56:34 UTC
So then the haproxy plugin needs to be enabled not only by presence of the package, but also by presence of the haproxy directory.

Will this change help?

--- /usr/lib/python3.6/site-packages/sos/plugins/haproxy.py
+++ /usr/lib/python3.6/site-packages/sos/plugins/haproxy.py
@@ -25,12 +25,13 @@ class HAProxy(Plugin, RedHatPlugin, Debi
     profiles = ('webserver',)
 
     packages = ('haproxy',)
+    var_puppet_gen = "/var/lib/config-data/puppet-generated/haproxy"
+    files = ( var_puppet_gen, )
 
     def setup(self):
-        var_puppet_gen = "/var/lib/config-data/puppet-generated/haproxy"
         self.add_copy_spec([
             "/etc/haproxy/haproxy.cfg",
-            var_puppet_gen + "/etc/haproxy/haproxy.cfg"
+            self.var_puppet_gen + "/etc/haproxy/haproxy.cfg"
         ])
         self.add_copy_spec("/etc/haproxy/conf.d/*")
         self.add_cmd_output("haproxy -f /etc/haproxy/haproxy.cfg -c")

Comment 4 Arie Bregman 2020-07-23 14:59:49 UTC
(In reply to Pavel Moravec from comment #3)
> So then the haproxy plugin needs to be enabled not only by presence of the
> package, but also by presence of the haproxy directory.
> 
> Will this change help?
> 
> --- /usr/lib/python3.6/site-packages/sos/plugins/haproxy.py
> +++ /usr/lib/python3.6/site-packages/sos/plugins/haproxy.py
> @@ -25,12 +25,13 @@ class HAProxy(Plugin, RedHatPlugin, Debi
>      profiles = ('webserver',)
>  
>      packages = ('haproxy',)
> +    var_puppet_gen = "/var/lib/config-data/puppet-generated/haproxy"
> +    files = ( var_puppet_gen, )
>  
>      def setup(self):
> -        var_puppet_gen = "/var/lib/config-data/puppet-generated/haproxy"
>          self.add_copy_spec([
>              "/etc/haproxy/haproxy.cfg",
> -            var_puppet_gen + "/etc/haproxy/haproxy.cfg"
> +            self.var_puppet_gen + "/etc/haproxy/haproxy.cfg"
>          ])
>          self.add_copy_spec("/etc/haproxy/conf.d/*")
>          self.add_cmd_output("haproxy -f /etc/haproxy/haproxy.cfg -c")

I'm not familiar with sos code but if that makes sosreport to collect haproxy not only when the package is present then yes, great. Thank you

Comment 5 Pavel Moravec 2020-07-23 15:12:52 UTC
That codechange will automatically collect the cfg file whenever /var/lib/config-data/puppet-generated/haproxy is present on the system.

Comment 6 Arie Bregman 2020-07-23 15:41:50 UTC
(In reply to Pavel Moravec from comment #5)
> That codechange will automatically collect the cfg file whenever
> /var/lib/config-data/puppet-generated/haproxy is present on the system.

Perfect, thank you.

Comment 10 Maros Kopec 2021-01-21 12:48:05 UTC
Tested manually on RHEL-8.4 x86_64 without haproxy installed by mocking haproxy.cfg file.

# rpm -qa haproxy
# rpm -qa sos
sos-4.0-5.el8.noarch

# mkdir -p  /var/lib/config-data/puppet-generated/haproxy/etc/haproxy/
# touch /var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg

# sos report
...
Your sosreport has been generated and saved in:
	/var/tmp/sosreport-host-10-0-139-2-1234567890-2021-01-21-iflubtf.tar.xz

# tar -tf /var/tmp/sosreport-host-10-0-139-2-1234567890-2021-01-21-iflubtf.tar.xz | grep haproxy
sosreport-host-10-0-139-2-1234567890-2021-01-21-iflubtf/var/lib/config-data/puppet-generated/haproxy/
sosreport-host-10-0-139-2-1234567890-2021-01-21-iflubtf/var/lib/config-data/puppet-generated/haproxy/etc/
sosreport-host-10-0-139-2-1234567890-2021-01-21-iflubtf/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/
sosreport-host-10-0-139-2-1234567890-2021-01-21-iflubtf/var/lib/config-data/puppet-generated/haproxy/etc/haproxy/haproxy.cfg

Comment 12 errata-xmlrpc 2021-05-18 14:47:21 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 (sos bug fix and enhancement update), 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/RHEA-2021:1604

Comment 13 Pavel Moravec 2021-07-27 10:45:02 UTC
There is a z-stream request to backport this to 8.2 (only) for better support experience of OSP16.1 still in use by many customers.

Could you please provide business justification to get approval from SST CEE or PM lead ?

Comment 14 Keigo Noha 2021-07-28 00:42:18 UTC
Hi Pavel-san,

Thank you for your comment on this.

Business Justification:
OSP16.1 is supported until April 30 2024 using RHEL8.2 EUS provided in the normal RHOSP subscriptions and RHEL8.2 TUS which OSP16.1 EUS provides the access to.
Support team in Red Hat and OEM partners expect that sosreport command collect all configuration files of RHOSP16.
Lacking this fix needs an additional work in support side and it will have an impact to customer satisfaction by taking a time to collect haproxy configuration additionally.
For better support experience, the fix should be backported into RHEL8.2.

To SST CEE or PM,
Could you please grant an approval for backporting to RHEL8.2.z? 

Kind Regards,
Keigo Noha


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