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 1355986

Summary: KeyError['filesystem'] when running sos on RHOS7
Product: Red Hat Enterprise Linux 7 Reporter: Michele Baldessari <michele>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: low Docs Contact:
Priority: low    
Version: 7.3CC: agk, bmr, gavin, lyarwood, plambri, rscarazz, sbradley
Target Milestone: rc   
Target Release: 7.4   
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-01-19 09:59:52 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 Michele Baldessari 2016-07-13 08:32:39 UTC
Description of problem:
[root@mrg-06 ~]# sosreport --batch
Traceback (most recent call last):
  File "/usr/sbin/sosreport", line 25, in <module>
    main(sys.argv[1:])
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1501, in main
    sos = SoSReport(args)
  File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 673, in __init__
    self.policy = sos.policies.load(sysroot=self.opts.sysroot)
  File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 40, in load
    cache['policy'] = policy(sysroot=sysroot)
  File "/usr/lib/python2.7/site-packages/sos/policies/redhat.py", line 157, in __init__
    super(RHELPolicy, self).__init__(sysroot=sysroot)
  File "/usr/lib/python2.7/site-packages/sos/policies/redhat.py", line 67, in __init__
    if pkgs['filesystem']['version'][0] == '3':
KeyError: 'filesystem'


This is quite weird as the filesystem package does indeed exist:
[root@mrg-06 ~]# rpm -q filesystem
filesystem-3.2-20.el7.x86_64

If I add a "print(pkgs.keys())" before line 67 I get these, which is a small subset of all the installed ones:
[u'kbd-misc', u'python-devel', u'python-kombu', u'cyrus-sasl-md5', u'libgpg-error-devel', u'python-pycadf', u'perl-parent', u'iproute', u'perl-Time-HiRes', u'python-boto', u'python-ldap', u'python-ironicclient', u'kbd-legacy', u'perl-macros', u'openwsman-python', u'dracut-config-rescue', u'libnl3', u'libcgroup', u'libSM', u'erlang-tools', u'usbredir', u'lzo', u'iwl105-firmware', u'python-oslo-serialization', u'cyrus-sasl-lib', u'redhat-support-tool', u'libyaml', u'libxml2-devel', u'fuse-libs', u'net-tools', u'libnl3-cli', u'libselinux-utils', u'openstack-nova-api', u'redhat-lsb-core', u'libblkid', u'openstack-ceilometer-notification', u'gdbm', u'libunistring', u'perl-Business-ISBN-Data', u'rpm', u'glibc', u'libestr', u'btrfs-progs', u'shadow-utils', u'python-libguestfs', u'python-XStatic-Font-Awesome', u'python-XStatic-JQuery-quicksearch', u'selinux-policy-devel', u'openstack-tuskar', u'libbasicobjects', u'python-cffi', u'bash', u'openstack-heat-api-cloudwatch', u'libjpeg-turbo', u'atk', u'openstack-tuskar-ui', u'hardlink', u'erlang-crypto', u'python-saslwrapper', u'binutils', u'perl-DBI', u'python-elasticsearch', u'libtiff', u'python-flask-babel', u'nss', u'libguestfs-tools', u'libssh2', u'pygpgme', u'bind-libs', u'pkgconfig', u'iwl3160-firmware', u'python-ply', u'dracut', u'python-gudev', u'perl-Storable', u'iptables-services', u'graphite2', u'python-tooz', u'net-snmp-agent-libs', u'libXt', u'python-XStatic-jquery-ui', u'python-pecan', u'python-mako', u'libsemanage', u'openstack-neutron-openvswitch', u'perl-WWW-RobotRules', u'erlang-asn1', u'texlive-base', u'sudo', u'libnetfilter_cttimeout', u'mesa-libgbm', u'gcc', u'libgnome-keyring', u'python-osprofiler', u'libcap-ng', u'python-pbr', u'glusterfs-api', u'quota', u'python-dns', u'm2crypto', u'desktop-file-utils', u'openstack-ceilometer-alarm', u'python-django-bash-completion', u'python-cinderclient', u'autogen-libopts', u'libsemanage-python']

The query by command line seems fine though
# rpm -qa --queryformat "%{NAME}|%{VERSION}\\n" |wc -l
1006

Probably relevant: this machine (it is an udnercloud) is quite overloaded:
[root@mrg-06 ~]# free
              total        used        free      shared  buff/cache   available
Mem:       12126544    11620868      158376       80032      347300       92596
Swap:       6160380     5581056      579324


Version-Release number of selected component (if applicable):
[root@mrg-06 ~]# rpm -q sos
sos-3.2-36.el7ost.1.noarch


How reproducible:
Only seen on this particular installation, so prio set to low.