Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1395794 - /usr/libexec/rhsmd is failing with ImportError: No module named decorator
/usr/libexec/rhsmd is failing with ImportError: No module named decorator
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.9
Unspecified Unspecified
urgent Severity medium
: rc
: ---
Assigned To: Chris Snyder
John Sefler
: Regression, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-16 11:52 EST by John Sefler
Modified: 2017-03-21 06:57 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-03-21 06:57:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github candlepin/subscription-manager/pull/1521 None None None 2016-11-21 14:22 EST
Red Hat Product Errata RHSA-2017:0698 normal SHIPPED_LIVE Moderate: subscription-manager security, bug fix, and enhancement update 2017-03-21 08:39:12 EDT

  None (edit)
Description John Sefler 2016-11-16 11:52:34 EST
Description of problem:
On a freshly provisioned RHEL6.9 system, /usr/libexec/rhsmd is exiting early because it fails to import decorator which is provided by package python-decorator which does not appear to be installed by default anymore.

Bottom line: if subscription-manager needs the decorator module, then the spec file should require python-decorator.


Version-Release number of selected component (if applicable):
[root@ibm-z-24 ~]# rpm -q --whatprovides /usr/libexec/rhsmd
subscription-manager-1.18.4-1.el6.s390x


How reproducible:


Steps to Reproduce:
[root@ibm-z-24 ~]# /usr/libexec/rhsmd --help
[root@ibm-z-24 ~]# 

Actual results:
  no response

Expected results:
  the Usage statement and a list of Options.

Additional info:

[root@ibm-z-24 ~]# python -i /usr/libexec/rhsmd
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/libexec/rhsmd", line 33, in excepthook_base
    sys.exit(0)
SystemExit: 0

Original exception was:
Traceback (most recent call last):
  File "/usr/libexec/rhsmd", line 41, in <module>
    import decorator
ImportError: No module named decorator
>>> quit()
[root@ibm-z-24 ~]# 



[root@ibm-z-24 ~]# rpm -q subscription-manager --requires | grep python
/usr/bin/python  
dbus-python  
python(abi) = 2.6
python-dateutil  
python-ethtool  
python-iniparse  
python-rhsm >= 1.18.1
^^^^^^^^^^^
That list should also include python-decorator
Comment 2 John Sefler 2016-11-16 13:54:07 EST
[root@ibm-z-24 ~]# /usr/libexec/rhsmd --help
[root@ibm-z-24 ~]# echo $?
0

^ a successful exitCode of 0 when rhsmd actually failed to load a python module feels wrong too.
Comment 4 John Sefler 2016-11-17 14:59:17 EST
Here is another reason why we need python-decorator installed.  Without it, the following DBusException is being thrown to rhsm.log during register, unregister, and probably more modules...

2016-11-17 13:46:02,127 [DEBUG] subscription-manager:1731:MainThread @dbus_interface.py:46 - Unable to connect to dbus
2016-11-17 13:46:02,127 [ERROR] subscription-manager:1731:MainThread @dbus_interface.py:47 - org.freedesktop.DBus.Error.TimedOut: Activation of com.redhat.SubscriptionManager timed out
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/subscription_manager/dbus_interface.py", line 36, in __init__
    follow_name_owner_changes=self.has_main_loop)
  File "/usr/lib/python2.6/site-packages/subscription_manager/dbus_interface.py", line 69, in _get_validity_object
    return self.bus.get_object(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/dbus/bus.py", line 244, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 241, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.6/site-packages/dbus/bus.py", line 183, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.6/site-packages/dbus/bus.py", line 281, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
DBusException: org.freedesktop.DBus.Error.TimedOut: Activation of com.redhat.SubscriptionManager timed out
Comment 5 Chris Snyder 2016-11-21 14:22:47 EST
Adding a PR for the upstream fix.
Comment 7 Shwetha Kallesh 2016-11-28 03:51:56 EST
Reproducer:

[root@ibm-z10-78 ~]# /usr/libexec/rhsmd --help
[root@ibm-z10-78 ~]# python -i /usr/libexec/rhsmd
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/libexec/rhsmd", line 33, in excepthook_base
    sys.exit(0)
SystemExit: 0

Original exception was:
Traceback (most recent call last):
  File "/usr/libexec/rhsmd", line 41, in <module>
    import decorator
ImportError: No module named decorator
>>> 
[root@ibm-z10-78 ~]# rpm -q subscription-manager --requires | grep python
/usr/bin/python  
dbus-python  
python(abi) = 2.6
python-dateutil  
python-ethtool  
python-iniparse  
python-rhsm >= 1.18.1


Verification:

[root@ibm-z10-78 ~]# /usr/libexec/rhsmd --helpUsage: rhsmd [OPTIONS]

Options:
  -h, --help            show this help message and exit
  -d, --debug           Display debug messages
  -k, --keep-alive      Stay running (don't shut down after the first dbus
                        call)
  -s, --syslog          Run standalone and log result to syslog
  -f FORCE_SIGNAL, --force-signal=FORCE_SIGNAL
                        Force firing of a signal (valid, expired, warning,
                        partial, classic or registration_required)
  -i, --immediate       Fire forced signal immediately (requires --force-
                        signal)
[root@ibm-z10-78 ~]# rpm -q subscription-manager --requires | grep python/usr/bin/python  
dbus-python  
python(abi) = 2.6
python-dateutil  
python-decorator  
python-ethtool  
python-iniparse  
python-rhsm >= 1.18.1


[root@ibm-z10-78 ~]# rpm -q --whatprovides /usr/libexec/rhsmd
subscription-manager-1.18.5-1.el6.s390x
Comment 9 errata-xmlrpc 2017-03-21 06:57:26 EDT
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://rhn.redhat.com/errata/RHSA-2017-0698.html

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