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 1959413

Summary: saphana plugin missing argument traceback
Product: Red Hat Enterprise Linux 8 Reporter: Miroslav Hradílek <mhradile>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.5CC: agk, bmr, plambri, sbradley, theute
Target Milestone: betaKeywords: Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-4.1-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 19:36:31 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 Miroslav Hradílek 2021-05-11 13:38:24 UTC
Description of problem:
Plugin saphana crashes on missing argument when get_inst_info() is called.

Version-Release number of selected component (if applicable):
sos-4.1-1.el8.noarch (unreleased)

How reproducible:
100%

Steps to Reproduce:
# mkdir -p /hana/shared/A01/HDB01/
# mkdir -p /hana/shared/A02/HDB02/

# sos report -o saphana --batch
. . .
 Setting up archive ...
 Setting up plugins ...
caught exception in plugin method "saphana.setup()"
writing traceback to sos_logs/saphana-plugin-errors.txt
 Running plugins. Please wait ...
. . .

# tar -tf /var/tmp/sosreport-hostname-vbmsorx.tar.xz | grep saphana
sosreport-hostname-vbmsorx/sos_commands/saphana/
sosreport-hostname-vbmsorx/sos_commands/saphana/A01_HDB_info
sosreport-hostname-vbmsorx/sos_commands/saphana/A01_version
sosreport-hostname-vbmsorx/sos_commands/saphana/A01_memusage
sosreport-hostname-vbmsorx/sos_commands/saphana/A01_replicainfo
sosreport-hostname-vbmsorx/sos_logs/saphana-plugin-errors.txt

# tar -xf /var/tmp/sosreport-hostname-vbmsorx.tar.xz
# cat sosreport-hostname-vbmsorx/sos_logs/saphana-plugin-errors.txt
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/sos/report/__init__.py", line 906, in setup
    plug.setup()
  File "/usr/lib/python3.6/site-packages/sos/report/plugins/saphana.py", line 52, in setup
    self.get_inst_info(sid, sidadm, inst)
TypeError: get_inst_info() missing 1 required positional argument: 'inst'


Expected results:
No traceback collect info for both dirs like in 4.0.

# tar -tf /var/tmp/sosreport-hostname-nsugfzu.tar.xz | grep saphana
sosreport-hostname-nsugfzu/sos_commands/saphana/
sosreport-hostname-nsugfzu/sos_commands/saphana/A01_HDB_info
sosreport-hostname-nsugfzu/sos_commands/saphana/A01_version
sosreport-hostname-nsugfzu/sos_commands/saphana/A01_memusage
sosreport-hostname-nsugfzu/sos_commands/saphana/A01_replicainfo
sosreport-hostname-nsugfzu/sos_commands/saphana/A01_01_status
sosreport-hostname-nsugfzu/sos_commands/saphana/A02_HDB_info
sosreport-hostname-nsugfzu/sos_commands/saphana/A02_version
sosreport-hostname-nsugfzu/sos_commands/saphana/A02_memusage
sosreport-hostname-nsugfzu/sos_commands/saphana/A02_replicainfo
sosreport-hostname-nsugfzu/sos_commands/saphana/A02_02_status

Additional info:
I believe the issue comes after refactor in
https://github.com/sosreport/sos/commit/e6c65495c7d6efba9a12e44956443ce5aea013f2

and argument was omitted unintentionally. The following change seems to fix it.

--- saphana.bak	2021-05-11 09:19:50.617219406 -0400
+++ /usr/lib/python3.6/site-packages/sos/report/plugins/saphana.py	2021-05-11 09:20:39.017260540 -0400
@@ -49,7 +49,7 @@
                     for inst in os.listdir("/hana/shared/%s/" % sid):
                         if "HDB" in inst:
                             inst = inst.strip()[-2:]
-                            self.get_inst_info(sid, sidadm, inst)
+                            self.get_inst_info(prefix, sid, sidadm, inst)
 
     def get_inst_info(self, prefix, sid, sidadm, inst):
         proc_cmd = 'su - %s -c "sapcontrol -nr %s -function GetProcessList"'

Comment 1 Pavel Moravec 2021-05-11 14:03:48 UTC
A nice catch.

Comment 5 errata-xmlrpc 2021-11-09 19:36:31 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:4388