Bug 1927245
| Summary: | The subscription-manager RPM package does not mark some directories as part of the RPM package | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jiri Hnidek <jhnidek> |
| Component: | subscription-manager | Assignee: | Jiri Hnidek <jhnidek> |
| Status: | CLOSED ERRATA | QA Contact: | Red Hat subscription-manager QE Team <rhsm-qe> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.3 | CC: | arpandey, cdonnell, jsefler, redakkan, vasil.minsk |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | 8.0 | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | subscription-manager-1.28.15-1.el8 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-11-09 19:37:35 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: | |||
This is output of RPM created from attached PR: /etc/dbus-1/system.d /etc/dnf/plugins /etc/logrotate.d /etc/pam.d /etc/security/console.apps /etc/yum.repos.d /usr/bin /usr/lib/python3.9/site-packages/dnf-plugins /usr/lib/systemd/system /usr/lib/tmpfiles.d /usr/libexec /usr/sbin /usr/share/bash-completion/completions /usr/share/dbus-1/system-services /usr/share/locale/as/LC_MESSAGES /usr/share/locale/bn_IN/LC_MESSAGES /usr/share/locale/de/LC_MESSAGES /usr/share/locale/es/LC_MESSAGES /usr/share/locale/fr/LC_MESSAGES /usr/share/locale/gu/LC_MESSAGES /usr/share/locale/hi/LC_MESSAGES /usr/share/locale/it/LC_MESSAGES /usr/share/locale/ja/LC_MESSAGES /usr/share/locale/kn/LC_MESSAGES /usr/share/locale/ko/LC_MESSAGES /usr/share/locale/ml/LC_MESSAGES /usr/share/locale/mr/LC_MESSAGES /usr/share/locale/or/LC_MESSAGES /usr/share/locale/pa/LC_MESSAGES /usr/share/locale/pt_BR/LC_MESSAGES /usr/share/locale/ru/LC_MESSAGES /usr/share/locale/ta_IN/LC_MESSAGES /usr/share/locale/te/LC_MESSAGES /usr/share/locale/zh_CN/LC_MESSAGES /usr/share/locale/zh_TW/LC_MESSAGES /usr/share/man/man5 /usr/share/man/man8 /usr/share/polkit-1/actions *** Bug 1945279 has been marked as a duplicate of this bug. *** Pre-verifying on build to be part of development compose : Re-producing issue on older version of sub-man [root@hpe-dl380pgen8-02-vm-5 /]# rpm -qa subscription-manager subscription-manager-1.28.13-2.el8.x86_64 [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# ./check_rpm.py subscription-manager /etc/dbus-1/system.d /etc/dnf/plugins /etc/logrotate.d /etc/pam.d /etc/security/console.apps /etc/yum.repos.d /usr/bin /usr/lib/systemd/system /usr/lib/tmpfiles.d /usr/lib64/python3.6/site-packages/rhsmlib/candlepin /usr/lib64/python3.6/site-packages/rhsmlib/cloud /usr/lib64/python3.6/site-packages/rhsmlib/cloud/providers /usr/lib64/python3.6/site-packages/rhsmlib/compat /usr/lib64/python3.6/site-packages/rhsmlib/dbus /usr/lib64/python3.6/site-packages/rhsmlib/dbus/facts /usr/lib64/python3.6/site-packages/rhsmlib/dbus/objects /usr/lib64/python3.6/site-packages/rhsmlib/facts /usr/lib64/python3.6/site-packages/rhsmlib/services /usr/lib64/python3.6/site-packages/subscription_manager-1.28.13-py3.6.egg-info <<<<< .egg-info, ../rhsmlib and ../subscription_manager Not marked as part of rpm /usr/lib64/python3.6/site-packages/subscription_manager/api /usr/lib64/python3.6/site-packages/subscription_manager/branding /usr/lib64/python3.6/site-packages/subscription_manager/model /usr/lib64/python3.6/site-packages/subscription_manager/plugin /usr/lib64/python3.6/site-packages/subscription_manager/scripts /usr/libexec /usr/sbin /usr/share/bash-completion/completions /usr/share/dbus-1/system-services /usr/share/locale/as/LC_MESSAGES /usr/share/locale/bn_IN/LC_MESSAGES /usr/share/locale/de/LC_MESSAGES /usr/share/locale/es/LC_MESSAGES /usr/share/locale/fr/LC_MESSAGES /usr/share/locale/gu/LC_MESSAGES /usr/share/locale/hi/LC_MESSAGES /usr/share/locale/it/LC_MESSAGES /usr/share/locale/ja/LC_MESSAGES /usr/share/locale/kn/LC_MESSAGES /usr/share/locale/ko/LC_MESSAGES /usr/share/locale/ml/LC_MESSAGES /usr/share/locale/mr/LC_MESSAGES /usr/share/locale/or/LC_MESSAGES /usr/share/locale/pa/LC_MESSAGES /usr/share/locale/pt_BR/LC_MESSAGES /usr/share/locale/ru/LC_MESSAGES /usr/share/locale/ta_IN/LC_MESSAGES /usr/share/locale/te/LC_MESSAGES /usr/share/locale/zh_CN/LC_MESSAGES /usr/share/locale/zh_TW/LC_MESSAGES /usr/share/man/man5 /usr/share/man/man8 /usr/share/polkit-1/actions [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# ll /usr/lib64/python3.6/site-packages/subscription_manager-1.28.13-py3.6.egg-info total 32 -rw-r--r--. 1 root root 1 Mar 15 13:22 dependency_links.txt -rw-r--r--. 1 root root 598 Mar 15 13:22 entry_points.txt -rw-r--r--. 1 root root 455 Mar 15 13:22 PKG-INFO -rw-r--r--. 1 root root 37 Mar 15 13:22 requires.txt -rw-r--r--. 1 root root 11152 Mar 15 13:22 SOURCES.txt -rw-r--r--. 1 root root 49 Mar 15 13:22 top_level.txt [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# yum remove subscription-manager -y -q Removed: dnf-plugin-subscription-manager-1.28.13-2.el8.x86_64 python3-chardet-3.0.4-7.el8.noarch python3-dmidecode-3.12.2-15.el8.x86_64 python3-ethtool-0.14-3.el8.x86_64 python3-idna-2.5-5.el8.noarch python3-iniparse-0.4-31.el8.noarch python3-inotify-0.9.6-13.el8.noarch python3-librepo-1.12.0-3.el8.x86_64 python3-libxml2-2.9.7-9.el8.x86_64 python3-pysocks-1.6.8-3.el8.noarch python3-requests-2.20.0-2.1.el8_1.noarch python3-subscription-manager-rhsm-1.28.13-2.el8.x86_64 python3-urllib3-1.24.2-5.el8.noarch subscription-manager-1.28.13-2.el8.x86_64 [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# ll /usr/lib64/python3.6/site-packages/subscription_manager-1.28.13-py3.6.egg-info total 0 ^^^^^ .egg-info not removed after package removal =========================================================================================================== Verifying fix on latest build for sub-man: subscription-manager-1.28.15-1.el8.x86_64 Steps for verification- [root@hpe-dl380pgen8-02-vm-5 ~]# [root@hpe-dl380pgen8-02-vm-5 ~]# rpm -qa subscription-manager subscription-manager-1.28.15-1.el8.x86_64 [root@hpe-dl380pgen8-02-vm-5 ~]# rpm -q --changelog subscription-manager | grep 1927245 - 1927245: Mark several dir as part of RPM (jhnidek) - 1927245: Mark several dir as part of RPM (jhnidek) [root@hpe-dl380pgen8-02-vm-5 ~]# [root@hpe-dl380pgen8-02-vm-5 ~]# cd / [root@hpe-dl380pgen8-02-vm-5 /]# ./check_rpm.py subscription-manager /etc/dbus-1/system.d /etc/dnf/plugins /etc/logrotate.d /etc/pam.d /etc/security/console.apps /etc/yum.repos.d /usr/bin /usr/lib/systemd/system /usr/lib/tmpfiles.d /usr/libexec /usr/sbin /usr/share/bash-completion/completions /usr/share/dbus-1/system-services /usr/share/locale/as/LC_MESSAGES /usr/share/locale/bn_IN/LC_MESSAGES /usr/share/locale/de/LC_MESSAGES /usr/share/locale/es/LC_MESSAGES /usr/share/locale/fr/LC_MESSAGES /usr/share/locale/gu/LC_MESSAGES /usr/share/locale/hi/LC_MESSAGES /usr/share/locale/it/LC_MESSAGES /usr/share/locale/ja/LC_MESSAGES /usr/share/locale/kn/LC_MESSAGES /usr/share/locale/ko/LC_MESSAGES /usr/share/locale/ml/LC_MESSAGES /usr/share/locale/mr/LC_MESSAGES /usr/share/locale/or/LC_MESSAGES /usr/share/locale/pa/LC_MESSAGES /usr/share/locale/pt_BR/LC_MESSAGES /usr/share/locale/ru/LC_MESSAGES /usr/share/locale/si/LC_MESSAGES /usr/share/locale/ta_IN/LC_MESSAGES /usr/share/locale/te/LC_MESSAGES /usr/share/locale/zh_CN/LC_MESSAGES /usr/share/locale/zh_TW/LC_MESSAGES /usr/share/man/man5 /usr/share/man/man8 /usr/share/polkit-1/actions [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# ll /usr/lib64/python3.6/site-packages/subscription_manager-1.28.15-py3.6.egg-info total 32 -rw-r--r--. 1 root root 1 Mar 31 10:57 dependency_links.txt -rw-r--r--. 1 root root 598 Mar 31 10:57 entry_points.txt -rw-r--r--. 1 root root 455 Mar 31 10:57 PKG-INFO -rw-r--r--. 1 root root 37 Mar 31 10:57 requires.txt -rw-r--r--. 1 root root 11161 Mar 31 10:57 SOURCES.txt -rw-r--r--. 1 root root 49 Mar 31 10:57 top_level.txt [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# yum remove subscription-manager -y -q [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# [root@hpe-dl380pgen8-02-vm-5 /]# ll /usr/lib64/python3.6/site-packages/subscription_manager-1.28.15-py3.6.egg-info ls: cannot access '/usr/lib64/python3.6/site-packages/subscription_manager-1.28.15-py3.6.egg-info': No such file or directory ^^^^^^^^^^^^directory removed successfully as part of rpm after package removal Verified: All directories specific for subscription marked as part of the RPM and .egg-info packages removed after package removal 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 (subscription-manager 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/RHBA-2021:4390 |
Description of problem: RPM package subscription-manager does not mark some directories as part of the RPM. It can causes several issues. When RPM is removed from the system, then filesystem is not cleaned from directories that are not needed anymore. One directory is bigger issue that ther others. This directory: /usr/lib64/python3.6/site-packages/subscription_manager-1.28.10-py3.6.egg-info would cause big issues in the future. When there is more than one subscription-manager-<version>.egg-info directory, than subscription-manager entry point Python script generated by python3-setuptools will not be able to start subscription-manager (tested on Fedora). Thus it would not be possible to start subscription-manager on some future version of RHEL. Version-Release number of selected component (if applicable): [root@ip-172-31-42-54 ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 3.2.11-1 subscription management rules: 5.41 subscription-manager: 1.28.10-1.el8 How reproducible: 100% Steps to Reproduce: 1. Check that subscription-manager is installed in the system: [root@localhost ~]# rpm -q subscription-manager subscription-manager-1.28.10-1.el8.x86_64 2. Run following Python script. This script print directories, that are not part of RPM, but are used by some files. ```python #!/usr/bin/env python3 """ Script for checking RPMs directory structure. Prints directories that are not part of RPM, but are used by RPM. The output of this script can only help you to find directories that should be part of the RPM. Many directories should not be part of RPM, like /usr/bin or /usr/share/man/man8. So it is necessary to have some experience with checked RPM package and UNIX directory structure. """ import subprocess import sys import os def check_rpm_structure(rpm): """ Check rpm structure """ # Run process completed_process = subprocess.run( ["rpm", "-ql", rpm], stdout=subprocess.PIPE, encoding='UTF-8' ) # Try to parse output of process if completed_process.returncode == 0: dirs = [] missing_dirs = [] paths = completed_process.stdout.split() # Get list of all directories marked as part of RPM for path in paths: if os.path.isdir(path): dirs.append(path) # Go through the list of all files (not directories) and # check if directory name of file is marked as part of RPM for path in paths: if not os.path.isdir(path): dir_name = os.path.dirname(path) if dir_name not in dirs: if dir_name not in missing_dirs: missing_dirs.append(dir_name) # Print output in readable format print('\n'.join(missing_dirs)) def main(): if len(sys.argv) != 2: print("Syntax: {cmd} rpm_installed_on_the_system".format(cmd=sys.argv[0])) else: check_rpm_structure(sys.argv[1]) if __name__ == '__main__': main() ``` Actual results: [root@ip-172-31-42-54 ~]# ./check_rpm.py subscription-manager /etc/dbus-1/system.d /etc/dnf/plugins /etc/logrotate.d /etc/pam.d /etc/security/console.apps /etc/yum.repos.d /usr/bin /usr/lib/systemd/system /usr/lib/tmpfiles.d /usr/lib64/python3.6/site-packages/rhsmlib/candlepin /usr/lib64/python3.6/site-packages/rhsmlib/cloud /usr/lib64/python3.6/site-packages/rhsmlib/cloud/providers /usr/lib64/python3.6/site-packages/rhsmlib/compat /usr/lib64/python3.6/site-packages/rhsmlib/dbus /usr/lib64/python3.6/site-packages/rhsmlib/dbus/facts /usr/lib64/python3.6/site-packages/rhsmlib/dbus/objects /usr/lib64/python3.6/site-packages/rhsmlib/facts /usr/lib64/python3.6/site-packages/rhsmlib/services /usr/lib64/python3.6/site-packages/subscription_manager-1.28.10-py3.6.egg-info /usr/lib64/python3.6/site-packages/subscription_manager/api /usr/lib64/python3.6/site-packages/subscription_manager/branding /usr/lib64/python3.6/site-packages/subscription_manager/model /usr/lib64/python3.6/site-packages/subscription_manager/plugin /usr/lib64/python3.6/site-packages/subscription_manager/scripts /usr/libexec /usr/sbin /usr/share/bash-completion/completions /usr/share/dbus-1/system-services /usr/share/locale/as/LC_MESSAGES /usr/share/locale/bn_IN/LC_MESSAGES /usr/share/locale/de/LC_MESSAGES /usr/share/locale/es/LC_MESSAGES /usr/share/locale/fr/LC_MESSAGES /usr/share/locale/gu/LC_MESSAGES /usr/share/locale/hi/LC_MESSAGES /usr/share/locale/it/LC_MESSAGES /usr/share/locale/ja/LC_MESSAGES /usr/share/locale/kn/LC_MESSAGES /usr/share/locale/ko/LC_MESSAGES /usr/share/locale/ml/LC_MESSAGES /usr/share/locale/mr/LC_MESSAGES /usr/share/locale/or/LC_MESSAGES /usr/share/locale/pa/LC_MESSAGES /usr/share/locale/pt_BR/LC_MESSAGES /usr/share/locale/ru/LC_MESSAGES /usr/share/locale/ta_IN/LC_MESSAGES /usr/share/locale/te/LC_MESSAGES /usr/share/locale/zh_CN/LC_MESSAGES /usr/share/locale/zh_TW/LC_MESSAGES /usr/share/man/man5 /usr/share/man/man8 /usr/share/polkit-1/actions Expected results: Following directories should be part of RPM and should not be listed in previous output: /usr/lib64/python3.6/site-packages/rhsmlib/candlepin /usr/lib64/python3.6/site-packages/rhsmlib/cloud /usr/lib64/python3.6/site-packages/rhsmlib/cloud/providers /usr/lib64/python3.6/site-packages/rhsmlib/compat /usr/lib64/python3.6/site-packages/rhsmlib/dbus /usr/lib64/python3.6/site-packages/rhsmlib/dbus/facts /usr/lib64/python3.6/site-packages/rhsmlib/dbus/objects /usr/lib64/python3.6/site-packages/rhsmlib/facts /usr/lib64/python3.6/site-packages/rhsmlib/services /usr/lib64/python3.6/site-packages/subscription_manager-1.28.10-py3.6.egg-info /usr/lib64/python3.6/site-packages/subscription_manager/api /usr/lib64/python3.6/site-packages/subscription_manager/branding /usr/lib64/python3.6/site-packages/subscription_manager/model /usr/lib64/python3.6/site-packages/subscription_manager/plugin /usr/lib64/python3.6/site-packages/subscription_manager/scripts Additional info: Note: I observed multiple versions of .egg-info directories on one RHEL8 system: [root@localhost ~]# ls -ld /usr/lib64/python3.6/site-packages/subscription_manager*.egg-info drwxr-xr-x. 2 root root 6 Jan 26 12:49 /usr/lib64/python3.6/site-packages/subscription_manager-1.27.16-py3.6.egg-info drwxr-xr-x. 2 root root 134 Jan 29 09:33 /usr/lib64/python3.6/site-packages/subscription_manager-1.28.10-py3.6.egg-info drwxr-xr-x. 2 root root 6 Jan 29 09:33 /usr/lib64/python3.6/site-packages/subscription_manager-1.29.5-py3.6.egg-info