Bug 1506596

Summary: redhat.py:67:__init__:KeyError: 'filesystem'
Product: Red Hat Enterprise Linux 6 Reporter: Miroslav Hradílek <mhradile>
Component: sosAssignee: Filip Krska <fkrska>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9CC: agk, bmr, dkochuka, fkrska, gavin, isenfeld, mhradile, michele, pandrade, pbhoot, plambri, pmoravec, salmy, sbradley, supergallego31, xnie, yozone
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
URL: https://github.com/sosreport/sos/pull/942
Whiteboard:
Fixed In Version: sos-3.2-62.el6 Doc Type: Bug Fix
Doc Text:
Cause: Short timeout when retrieving list of packages. Consequence: Sosreport collection fails. Fix: Retrieve list of packages without timeout. Handle missing `filesystem` package gracefully. Result: Sosreport collection proceeds without `__init__:KeyError: 'filesystem'` error.
Story Points: ---
Clone Of: 1393961 Environment:
Last Closed: 2018-06-19 05:23:14 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:
Bug Depends On: 1393961    
Bug Blocks: 1374441, 1461138, 1506659    

Description Miroslav Hradílek 2017-10-26 11:50:10 UTC
The same issue is present on RHEL 6.9 - sos-3.2-54.el6.noarch

+++ This bug was initially created as a clone of Bug #1393961 +++

The above message happens when running sosreport.

  I believe the condition may be caused by either not having a PATH
defined, or a timeout. For either case, I would suggest the pseudo
patch to /usr/lib/python2.7/site-packages/sos/policies/redhat.py:

-    _rpmq_cmd = 'rpm -qa --queryformat "%{NAME}|%{VERSION}\\n"'
+    _rpmq_cmd = '/bin/rpm -qa --queryformat "%{NAME}|%{VERSION}\\n"'

-        if pkgs['filesystem']['version'][0] == '3':
+        if pkgs.has_key('filesystem') and pkgs['filesystem']['version'][0] == '3':

Comment 2 Miroslav Hradílek 2017-11-13 15:02:08 UTC
*** Bug 1441155 has been marked as a duplicate of this bug. ***

Comment 3 Filip Krska 2017-12-17 14:05:04 UTC
I'll add pull/942 as suggested in duplicate Bug 1441155#c0

and

https://github.com/sosreport/sos/commit/4df4897146d4f2a0589a8b32532f912f1ea2ed8c

so both timeout and missing filesystem pkg issues are addressed.

Comment 15 errata-xmlrpc 2018-06-19 05:23:14 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, 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-2018:1920