Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1882544

Summary: sosreport does not execute ceph cmds when containerized
Product: Red Hat Enterprise Linux 8 Reporter: Randy Martinez <r.martinez>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 8.2CC: agk, bmr, jhunsaker, jjansky, lithomas, mhackett, mhradile, mkluson, plambri, pmoravec, sbradley, tonay
Target Milestone: rcKeywords: OtherQA, Reopened, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: sos-4.3-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 10:50:23 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:

Comment 3 Pavel Moravec 2020-10-09 20:47:05 UTC
Hello,
could you please clarify:
- what particular commands should sosreport collect?
- when it should do so (I expect whenever ceph plugin is enabled - but how to further restrict it to "when containerised"?)
- could some commands output contain some customer sensitive data (passwords, certs,..) that we should obfuscate?

Thanks in advance for the info.


(there is some BZ issue preventing me to raise needinfo.. /o\ )

Comment 6 Pavel Moravec 2020-11-04 20:50:59 UTC
Kindly bumping the needinfo, please (but no rush at all).

Comment 11 Pavel Moravec 2021-02-19 08:52:34 UTC
Won't this be a fix, then? Override check_enabled method in the ceph plugin, such that:

- for non-containerised environments, we first run the current enabledness check 
- if it returns False, we use SoSPredicate to eval the "systemctl is-enabled ceph-mon@$(hostname -s) && systemctl cat ceph-mon@$(hostname -s) | grep -Eq 'docker|podman'" test

One option:


@@ -6,7 +6,7 @@
 #
 # See the LICENSE file in the source distribution for further information.
 
-from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin
+from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin, SoSPredicate
 from socket import gethostname
 
 
@@ -37,6 +37,24 @@ class Ceph(Plugin, RedHatPlugin, UbuntuP
         'ceph-osd@*'
     )
 
+    def check_enabled(self):
+        # ceph on non-containerised environment
+        if super(Ceph, self).check_enabled():
+            return True
+        # containerised ceph is present iff:
+        # - ceph-mon@$(hostname -s) service is enabled
+        # - the service config has a reference to 'docker' or 'podman'
+        shortname = self.ceph_hostname.split('.')[0]
+        cephtest = {'cmd': 'systemctl is-enabled ceph-mon@%s' % shortname, 'output': 'enabled'}
+        cephdockertest = {'cmd': 'systemctl cat ceph-mon@%s' % shortname, 'output': 'docker' }
+        cephpodmantest = {'cmd': 'systemctl cat ceph-mon@%s' % shortname, 'output': 'podman' }
+        cephpred = SoSPredicate(self, cmd_outputs=cephtest)
+        cephdockerpred = SoSPredicate(self, cmd_outputs=cephdockertest)
+        cephpodmanpred = SoSPredicate(self, cmd_outputs=cephpodmantest)
+        return self.test_predicate(self, pred=cephpred) and \
+            ( self.test_predicate(self, pred=cephdockerpred) or \
+              self.test_predicate(self, pred=cephpodmanpred))
+
     def setup(self):
         all_logs = self.get_option("all_logs")
 

(a bit improved one is to set and eval "cephpred" first and optionally return False, then check the other two predicates)



Randy, could you please test this?

Comment 12 Pavel Moravec 2021-04-23 09:42:01 UTC
Randy,
kindly reminder of the needinfo. If you wish to have this fixed in 8.5, we need a response soon.

Comment 17 Pavel Moravec 2021-08-17 08:17:22 UTC
Sounds good, thanks! Preliminary adding to 8.6 (and 9.0 GA).

Comment 19 Pavel Moravec 2022-02-22 07:43:14 UTC
This will be fixed in RHEL8.7 automatically, due to a rebase of sos to 4.3 release there, which does contain the https://github.com/sosreport/sos/commit/93da93267a582d8e93e1da55f7e6a6763a6791b8 commit fixing the #2646 PR.

We will prepare a very first candidate build for that in a month-ish time frame.

@tonay , would you be able to test the build once ready? (and thanks for preparing the PR, the BZ specification was unclear to me)

Comment 20 Teoman ONAY 2022-02-28 11:00:35 UTC
Of course, just let me know when it is ready.

Comment 21 Pavel Moravec 2022-03-18 11:00:28 UTC
Hello,
as our QE might not have available systems for testing the fix, would you be able to verify the fix once available (as a candidate package for 8.7)?

Comment 22 RHEL Program Management 2022-03-24 07:27:25 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 23 Pavel Moravec 2022-03-24 07:30:09 UTC
Reopening, this will be fixed.

Comment 25 Pavel Moravec 2022-04-06 06:26:17 UTC
(In reply to Teoman ONAY from comment #20)
> Of course, just let me know when it is ready.

Hello,
could you please use the build from https://people.redhat.com/pmoravec/sos-4.2-15/sos-4.2-15.el8.noarch.rpm to verify?

Thanks in advance.

Comment 26 Pavel Moravec 2022-04-06 08:01:54 UTC
(In reply to Pavel Moravec from comment #25)
> (In reply to Teoman ONAY from comment #20)
> > Of course, just let me know when it is ready.
> 
> Hello,
> could you please use the build from
> https://people.redhat.com/pmoravec/sos-4.2-15/sos-4.2-15.el8.noarch.rpm to
> verify?
> 
> Thanks in advance.

I apologize for a wrong version: please use the build from https://people.redhat.com/pmoravec/sos-4.3-1/ instead.

Comment 39 errata-xmlrpc 2022-11-08 10:50:23 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/RHBA-2022:7732