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 1483397

Summary: sosreport takes an extremely long time to complete
Product: Red Hat Enterprise Linux 7 Reporter: Renaud Métrich <rmetrich>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: agk, bmr, gavin, plambri, sbradley
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-21 06:53:05 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 Renaud Métrich 2017-08-21 03:26:50 UTC
Description of problem:

On some customer sites, sosreport takes an extremely long time to complete (7 hours), whereas it took few minutes on RHEL 7.3.
When the issue happens, the step "Running plugins ..." is *not* reached after several minutes.

This is due to the new plugin "jars" which is enabled by default and that scans directories not local to the system and/or containing a lot of files:
- /usr/share/java: OK, likely local to the system
- /usr/lib/java: OK, likely local to the system
- /opt: NOT OK, likely remote mount points, and too generic
- /usr/local: can't tell
- /var/lib: NOT OK, local to the system but can contains a lot of files (in particular /var/lib/pgsql)

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

sos-3.4-5.el7 (RHEL 7.4)

How reproducible:

Depends on the customer setup

Additional info:

A simple "find /usr/share/java /usr/lib/java /opt /usr/local /var/lib -iname '*.jar' >/dev/null 2>&1", which is more restrictive than what is actually done by the plugin (the plugin scans *all files* in these directories, not only ".jar"), takes 100 minutes on the customer site.
This resulted in the sosreport taking up to 440 minutes!

There are many issues with this plugin:
1. it can take forever to complete, depending on customer setup (automounts, remote mounts, lots of files, etc.)
2. the scan is done in the "setup" of the plugin, instead of when running the plugin
3. the scan opens every single file, whatever the name is, to try detecting if it's a Jar file or not
4. the scan happens on well-known directories not suitable to host Jar files, such as /var/lib/pgsql: on a basic system not having Java/Tomcat installed (my RHEL7 workstation), the /var/lib/directory contains already +19000 files by default
5. depending on customer's issue, this plugin may be completely useless and, IMO, should be disabled by default

Comment 2 Pavel Moravec 2017-08-21 06:53:05 UTC
Thanks for reporting, analysis and also suggestions what jars plugin can - shouldnt traverse. We came to similar conclusion in an older bz1482574 so I am closing this as DUP.

As a workaround, disable jars plug-in:

sosreport -n jars

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

Comment 3 Bryn M. Reeves 2017-08-21 09:28:09 UTC
You can also mark the plugin persistently disabled via /etc/sos.conf by adding a line to the plugins section:

  [plugins]
  disable = jars