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 2012857 - unhandled exception when plugin timeout happens during logging a collected file
Summary: unhandled exception when plugin timeout happens during logging a collected file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sos
Version: ---
Hardware: ppc64le
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Moravec
QA Contact: Radek Duda
URL:
Whiteboard:
Depends On:
Blocks: 2012859
TreeView+ depends on / blocked
 
Reported: 2021-10-11 13:21 UTC by Pavel Moravec
Modified: 2022-05-10 16:26 UTC (History)
7 users (show)

Fixed In Version: sos-4.2-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2012859 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:16:36 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github sosreport sos issues 2722 0 None open unhandled exception when plugin timeout happens during logging a collected file 2021-10-11 13:21:01 UTC
Red Hat Issue Tracker RHELPLAN-99428 0 None None None 2021-10-11 13:21:39 UTC
Red Hat Product Errata RHEA-2022:1998 0 None None None 2022-05-10 15:16:56 UTC

Description Pavel Moravec 2021-10-11 13:21:01 UTC
Description of problem:
Spin-off from https://bugzilla.redhat.com/show_bug.cgi?id=1869561#c19 / https://bugzilla.redhat.com/show_bug.cgi?id=1869561#c20 . When *all* above happens:

- sos report run in verbose mode
- a plugin timeouts when still collecting files
- the plugin is/was running as the latest one

then there is a race condition where debug logs attempt to write to sos.log file that was already moved away from temp.location to the final destination.

I.e. https://github.com/sosreport/sos/issues/2722 needs to be fixed&backported.


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


How reproducible:
100%


Steps to Reproduce:
(bit artificial reproducer for QE):
sos report -o selinux --batch --build -k selinux.timeout=1 -vv

(real reproducer):
have a ppc64le system with hundreds of CPUs, such that collecting /sys/devices/system/cpu* takes >600s plugin timeout for sos report


Actual results:
a backtrace like:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/logging/__init__.py", line 996, in emit
    stream.write(msg)
ValueError: I/O operation on closed file.
Call stack:
  File "/usr/lib64/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 69, in _worker
    work_item.run()
  File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/root/sos-main/sos/report/__init__.py", line 1083, in collect_plugin
    plug.collect()
  File "/root/sos-main/sos/report/plugins/__init__.py", line 2667, in collect
    self._collect_copy_specs()
  File "/root/sos-main/sos/report/plugins/__init__.py", line 2631, in _collect_copy_specs
    self._log_info("collecting path '%s'" % path)
  File "/root/sos-main/sos/report/plugins/__init__.py", line 706, in _log_info
    self.soslog.info(self._format_msg(msg))
Message: "[plugin:selinux] collecting path '/var/lib/selinux/targeted/active/modules/100/ntp/cil'"
Arguments: ()
[plugin:selinux] collecting path '/var/lib/selinux/targeted/active/modules/100/ntp/cil'



Expected results:
no backtrace / segfault


Additional info:

Comment 4 errata-xmlrpc 2022-05-10 15:16:36 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-2022:1998


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