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 1058495

Summary: yum traceback remove subscription-manager plugin with yum
Product: Red Hat Enterprise Linux 7 Reporter: Adrian Likins <alikins>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: ckozak
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:13:33 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:    
Bug Blocks: 863175    

Description Adrian Likins 2014-01-27 21:55:39 UTC
Description of problem:
[~]$ sudo yum remove python-rhsm subscription-manager
Loaded plugins: changelog, langpacks, product-id
...
Running transaction
  Erasing    : subscription-manager-firstboot-1.10.11-1.el7.x86_64                                                1/5 
  Erasing    : subscription-manager-migration-1.10.11-1.el7.x86_64                                                2/5 
  Erasing    : subscription-manager-gui-1.10.11-1.el7.x86_64                                                      3/5 
  Erasing    : subscription-manager-1.10.11-1.el7.x86_64                                                          4/5 
warning: /etc/yum/pluginconf.d/subscription-manager.conf saved as /etc/yum/pluginconf.d/subscription-manager.conf.rpmsave
warning: /etc/rhsm/rhsm.conf saved as /etc/rhsm/rhsm.conf.rpmsave
  Erasing    : python-rhsm-1.10.11-1.el7.x86_64                                                                   5/5 
Traceback (most recent call last):
  File "/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 355, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 261, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 770, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1874, in runTransaction
    self.plugins.run('posttrans')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/product-id.py", line 52, in posttrans_hook
ImportError: No module named injectioninit


Version-Release number of selected component (if applicable):
1.10.11-1.el7 (well, git master really)


Expected results:


Additional info:

product-id.py does a lazy import of 
 from subscription_manager.injectioninit import init_dep_injection
    init_dep_injection()

which, in this case, that module no longer exists.

Should probably expect potential import error there and handle it

Comment 3 Carter Kozak 2014-02-05 16:13:24 UTC
commit aff364e4a9eedd582f143948a946e8af15fe1bc9
Author: Adrian Likins <alikins>
Date:   Mon Feb 3 14:59:48 2014 -0500

    1058495: productid yum errors on yum remove
    
    If we yum remove subscription-manager, we also remove
    the productid yum plugin, which trys to lazy load
    subman code and errors. Catch and handle that case.

Comment 6 John Sefler 2014-02-14 19:31:47 UTC
Re-testing to demonstrate the failure...

[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription-manager: 1.10.11-1.el7
python-rhsm: 1.10.11-1.el7

Key Step: disable /etc/yum/pluginconf.d/subscription-manager.conf before attempting to yum remove python-rhsm

[root@jsefler-7 ~]# cat /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0

[root@jsefler-7 ~]# yum remove --quiet -y python-rhsm
Warning: RPMDB altered outside of yum.
warning: /etc/yum/pluginconf.d/subscription-manager.conf saved as /etc/yum/pluginconf.d/subscription-manager.conf.rpmsave
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 355, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 261, in main
    return_code = base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 770, in doTransaction
    resultobject = self.runTransaction(cb=cb)
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1874, in runTransaction
    self.plugins.run('posttrans')
  File "/usr/lib/python2.7/site-packages/yum/plugins.py", line 188, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/product-id.py", line 52, in posttrans_hook
ImportError: No module named injectioninit

Comment 7 John Sefler 2014-02-14 19:43:15 UTC
Verifying Version...

[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription-manager: 1.10.14-1.el7
python-rhsm: 1.10.12-1.el7

Key Step: disable /etc/yum/pluginconf.d/subscription-manager.conf before attempting to yum remove python-rhsm

[root@jsefler-7 ~]# cat /etc/yum/pluginconf.d/subscription-manager.conf
[main]
enabled=0

[root@jsefler-7 ~]# yum remove --quiet -y python-rhsm
warning: /etc/yum/pluginconf.d/subscription-manager.conf saved as /etc/yum/pluginconf.d/subscription-manager.conf.rpmsave
No module named injectioninit
[root@jsefler-7 ~]# echo $?
0
[root@jsefler-7 ~]# rpm -q python-rhsm subscription-manager
package python-rhsm is not installed
package subscription-manager is not installed

VERIFIED: Successfully used yum to remove python-rhsm (and subscription-manager) while the subscription-manager plugin is disabled without encountering a traceback.  Instead, we now get a stderr message stating that "No module named injectioninit" was found which is friendlier than a traceback.

Comment 8 Ludek Smid 2014-06-13 10:13:33 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.