Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1058495 - yum traceback remove subscription-manager plugin with yum
Summary: yum traceback remove subscription-manager plugin with yum
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2014-01-27 21:55 UTC by Adrian Likins
Modified: 2015-04-27 20:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:13:33 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1149095 None CLOSED [abrt] yum: injectioninit.py:52:init_dep_injection:AttributeError: 'module' object has no attribute 'PROFILE_MANAGER' 2019-03-29 09:51:14 UTC

Internal Links: 1149095

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@redhat.com>
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.


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