Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1189186

Summary: subscription-manager requires python-dateutil, but dependency only available in RHEL 5.10 or later
Product: Red Hat Satellite 5 Reporter: James Hartsock <hartsjc>
Component: RegistrationAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 520CC: awood, bbuckingham, cperry, ggainey, hartsjc, lpramuk, satqe-list, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-rhsm-1.13.2.1-1.el5, subscription-manager-1.11.3-12.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-24 08:16:28 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: 1127217    

Description James Hartsock 2015-02-04 16:08:52 UTC
Description of problem:
If installing RHEL 5.9 (or earlier) with rhn-tools repository also enabled, anaconda will pull the newer subscription-manager from rhn-tools repository.  However, anaconda is unable to satisfy the python-dateutil repository as this wasn't added to RHEL until RHEL 5.10.  This leave the installed system with errors running /etc/cron.daily/rhsmd (and likely subscription-manager too).

Version-Release number of selected component (if applicable):
rhn-tools-rhel-x86_64-server-5


How reproducible:
Very

Steps to Reproduce:
1. Use 5.8 kickstart (I am using RHEL 5.8 DVD) file that also has current rhn-tools repo enabled
$ grep -e ^url -e ^repo virt.cfg 
url --url http://172.31.0.1/repos/rhel5.8
repo --name="RHEL - RHN Tools"     --baseurl=http://172.31.0.1/repos/rhn-tools-rhel-x86_64-server-5/

2. Install system using kickstart



Actual results:
# cat /etc/redhat-release ; uname -r
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
2.6.18-308.el5

# rpm -q subscription-manager
subscription-manager-1.11.3-11.el5

# /etc/cron.daily/rhsmd 
Traceback (most recent call last):
  File "/usr/libexec/rhsmd", line 34, in ?
    from subscription_manager.injectioninit import init_dep_injection
  File "/usr/share/rhsm/subscription_manager/injectioninit.py", line 17, in ?
    from subscription_manager.cache import ProductStatusCache, EntitlementStatusCache, \
  File "/usr/share/rhsm/subscription_manager/cache.py", line 30, in ?
    import rhsm.connection as connection
  File "/usr/lib64/python2.4/site-packages/rhsm/connection.py", line 20, in ?
    import dateutil.parser
ImportError: No module named dateutil.parser




Expected results:
/etc/cron.daily/rhsmd & susbscription-manager should work after a fresh install




Additional info:
Believe similar issue in RHEL 6 reported in bz 1156154 was resolved by added the needed dependency to the rhntools repo.  Think following that behaviour and adding python-dateutil RPM to the RHEL 5 rhntools repository would be acceptable solution

Comment 1 RHEL Program Management 2015-02-04 16:13:33 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Xixi 2015-03-19 21:08:20 UTC
> Additional info:
> Believe similar issue in RHEL 6 reported in bz 1156154 was resolved by added
> the needed dependency to the rhntools repo.  Think following that behaviour
> and adding python-dateutil RPM to the RHEL 5 rhntools repository would be
> acceptable solution

Fixing wrong product - if we're reading this correctly it should be a Satellite 5 BZ not Satellite 6 same as above referenced bug.

Comment 4 James Hartsock 2015-04-06 15:25:38 UTC
Xixi,

Thank you for correcting, wasn't sure which should be since subscription-manager that needs dependency is needed for CDN & sat 6 registration.


Anyone have idea on feasibility of getting these dependencies added to the repositories?

Comment 8 Alex Wood 2015-05-07 18:52:18 UTC
The python-rhsm package has a Requires on python-dateutil.  I'm very confused as to how python-rhsm is getting installed.  RPM and/or Yum should refuse to install it due to the missing dependency.

Can you post the version of python-rhsm that's being installed?  Also an `rpm -q --requires python-rhsm` would be illuminating.

Comment 9 James Hartsock 2015-05-11 17:24:20 UTC
This is during anaconda install with the rhn-tools-rhel-x86_64-server-5 & RHEL 5.8 repository enabled.  Anaconda does note this dependency issue, but moves forward on its own:


$ grep -e subscription-manager -e python-rhsm -e python-dateutil var/log/anaconda.log | head -n 6
10:30:43 DEBUG   : Matched python-rhsm-1.13.2-1.el5.x86_64 to require for python-rhsm
10:30:43 WARNING : Unresolvable dependency python-dateutil in subscription-manager
10:30:53 WARNING : Unresolvable dependency python-dateutil in python-rhsm
10:30:57 WARNING : Unresolvable dependency python-dateutil in python-rhsm
10:30:58 DEBUG   : Matched python-rhsm-1.13.2-1.el5.x86_64 to require for python-rhsm
10:30:58 WARNING : Unresolvable dependency python-dateutil in subscription-manager

Comment 10 James Hartsock 2015-05-19 18:57:19 UTC
Here is info from kickstart config...

$ grep -e ^repo -e ^url BZ1189186.cgf 
url --url http://172.31.0.1/repos/rhel5.8
repo --name="RHEL - RHN Tools"     --baseurl=http://172.31.0.1/repos/rhn-tools-rhel-x86_64-server-5/

$ sed -n '/%packages/,/^$/p' BZ1189186.cgf 
%packages
@base
subscription-manager


Can see that rhel5.8 didn't have subscription-manager
$ curl -s http://172.31.0.1/repos/rhel5.8 | grep -c subscription-manager
0


But it is in rhn-tools...
$ curl -s http://172.31.0.1/repos/rhn-tools-rhel-x86_64-server-5/ | grep subscription-manager-[0-9] | sed -e 's/^.*href="//' -e 's/".*$//'
subscription-manager-1.11.3-11.el5.x86_64.rpm


Here is virt-intall for the test...
# name=test && ver=5.8 && qemu-img create -f raw /var/lib/libvirt/images/${name}${ver}.img 10G && virt-install --name=${name}${ver} --force --vcpus=2 --ram=2048 --graphics=spice --os-type=linux --noautoconsole --network=network:default,model=virtio --disk=/var/lib/libvirt/images/${name}${ver}.img,size=8,bus=virtio,sparse=true --location=http://172.31.0.1/repos/rhel${ver} --extra-args="debug sshd ks=http://172.31.0.1/KS/${ver}/BZ1189186.cgf console=tty0 console=ttyS0,115200"


After the install, can see that subscription-manager is installed, but NOT its dependencies because they aren't in 5.8 or rhn-tools repository...

# package-cleanup --problems
Setting up yum
Reading local RPM database
Processing all local requires
Missing dependencies:
Package python-rhsm requires python-dateutil
Package subscription-manager requires python-dateutil

# rpm -q python-rhsm ; rpm -q subscription-manager ; rpm -q python-dateutil
python-rhsm-1.13.2-1.el5
subscription-manager-1.11.3-11.el5
package python-dateutil is not installed


# grep -e python-dateutil /var/log/anaconda.log 
18:44:51 WARNING : Unresolvable dependency python-dateutil in subscription-manager
18:44:53 WARNING : Unresolvable dependency python-dateutil in python-rhsm
18:44:55 WARNING : Unresolvable dependency python-dateutil in python-rhsm
18:44:55 WARNING : Unresolvable dependency python-dateutil in subscription-manager


# rpm -q --requires python-rhsm
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libcrypto.so.6()(64bit)  
libpthread.so.0()(64bit)  
libssl.so.6()(64bit)  
m2crypto  
python(abi) = 2.4
python-dateutil  <--------------------------------
python-iniparse  
python-simplejson  
rpm-python  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)  



# rpm -q --requires subscription-manager
/bin/bash  
/bin/sh  
/bin/sh  
/bin/sh  
/bin/sh  
/usr/bin/python  
chkconfig  
chkconfig  
config(subscription-manager) = 1.11.3-11.el5
dbus-python  
initscripts  
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libglib-2.0.so.0()(64bit)  
pygobject2  
python-dateutil  <--------------------------------
python-dmidecode  
python-ethtool  
python-iniparse  
python-rhsm >= 1.11.3-5
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)  
usermode  
virt-what  
yum >= 3.2.19-15




And yes, post install yum does refuse to install, but anaconda obviously does NOT...

# yum --enablerepo=rhn-tools-rhel-x86_64-server-5 reinstall subscription-manager
Plugin "subscription-manager" can't be imported
Loaded plugins: product-id, security
Setting up Reinstall Process
Resolving Dependencies
--> Running transaction check
---> Package subscription-manager.x86_64 0:1.11.3-11.el5 set to be updated
--> Processing Dependency: python-dateutil for package: subscription-manager
--> Finished Dependency Resolution
subscription-manager-1.11.3-11.el5.x86_64 from rhn-tools-rhel-x86_64-server-5 has depsolving problems
  --> Missing Dependency: python-dateutil is needed by package subscription-manager-1.11.3-11.el5.x86_64 (rhn-tools-rhel-x86_64-server-5)
Error: Missing Dependency: python-dateutil is needed by package subscription-manager-1.11.3-11.el5.x86_64 (rhn-tools-rhel-x86_64-server-5)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest


Any more data needed regarding this issue?
Is there a plan on how to correct this issue?

Comment 12 Lukas Pramuk 2015-06-30 12:14:47 UTC
FAILED_QA. (python-rhsm-1.13.2.1-1.el5)

Though sat5to6 tool remains functinal, the fix haven't solved the issue
Used following reproducer:

1. Create ks profile using rhel5.9 ks tree and associate rhn-tools-rhel-x86_64-server-5 channel with it
2. Provision a machine using created ks profile
3. At provisioned machine run couple of commands:

# /etc/cron.daily/rhsmd
Traceback (most recent call last):
  File "/usr/libexec/rhsmd", line 34, in ?
    from subscription_manager.injectioninit import init_dep_injection
  File "/usr/share/rhsm/subscription_manager/injectioninit.py", line 19, in ?
    from subscription_manager.cert_sorter import CertSorter
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 24, in ?
    from subscription_manager.isodate import parse_date
  File "/usr/share/rhsm/subscription_manager/isodate.py", line 109, in ?
    raise ImportError("No suitable date parsing module found ('dateutil', nor 'xml.utils.iso8601')")
ImportError: No suitable date parsing module found ('dateutil', nor 'xml.utils.iso8601')


# yum repolist
Loaded plugins: product-id, rhnplugin, security, subscription-manager
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 157, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
    self.conf
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 238, in _getConfig
    startupconf.pluginconfpath,disabled_plugins,enabled_plugins)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 409, in doPluginSetup
    plugin_types, confpath, disabled_plugins, enabled_plugins)
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 162, in __init__
    self.run('config')
  File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/subscription-manager.py", line 123, in config_hook
    from subscription_manager.injectioninit import init_dep_injection
  File "/usr/share/rhsm/subscription_manager/injectioninit.py", line 19, in ?
    from subscription_manager.cert_sorter import CertSorter
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 24, in ?
    from subscription_manager.isodate import parse_date
  File "/usr/share/rhsm/subscription_manager/isodate.py", line 109, in ?
    raise ImportError("No suitable date parsing module found ('dateutil', nor 'xml.utils.iso8601')")
ImportError: No suitable date parsing module found ('dateutil', nor 'xml.utils.iso8601')

# rpm -q python-rhsm subscription-manager python-dateutil
python-rhsm-1.13.2.1-1.el5
subscription-manager-1.11.3-11.el5
package python-dateutil is not installed

# grep -e python-dateutil /var/log/anaconda.log 
09:44:46 WARNING : Unresolvable dependency python-dateutil in subscription-manager
09:44:52 WARNING : Unresolvable dependency python-dateutil in subscription-manager

>>> python-dateutil is still required by yet another package: subscription-manager-1.11.3-11.el5

Comment 13 Lukas Pramuk 2015-06-30 12:15:51 UTC
There is also subscription-manager-1.11.3-11.el5 being installed that still requires python-dateutil.
Further removing python-dateutil dependency from subcription-manager rpm wouldn't help, as dateutil is actually stilll imported by subscription-manager code.

IMHO, contrary to removing rpm dependencies, the solution is to satisfy dependency by including python-dateutil into rhn-tools channel.

Comment 15 Alex Wood 2015-07-01 16:42:53 UTC
Lukas,

The code is meant to try to use dateutil and fall back to PyXML for older versions, so this issue should be solvable by installing 'PyXML'.  Would you mind trying that and seeing if it fixes things?  If so, I'll put a Requires in the spec file for 'PyXML'.  It looks like that Requires got removed in newer versions of subscription-manager meant for new versions of RHEL.

Comment 16 Lukas Pramuk 2015-07-10 11:09:40 UTC
Alex,
yes it fixes things. If I install PyXML then subscription-manager starts to work.

# rpm -q PyXML
PyXML-0.8.4-6.el5

# yum repolist
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
repo id                                    repo name                                                              status
rhel-x86_64-server-5                       Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)                      16,804
rhn-tools-rhel-x86_64-server-5             Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64)                 614
repolist: 17,418

# /etc/cron.daily/rhsmd

Comment 17 Lukas Pramuk 2015-07-10 11:24:07 UTC
In order to ensure that rhsmd & susbscription-manager will work after a fresh install, you will need to modify related kickstarts to include PyXML to packages that are installed during kickstart (tab Software - subtab Package Groups):

@Base
PyXML

The other possibility is to add rpm dependency for PyXML. WYT?

Comment 18 Alex Wood 2015-07-10 13:36:10 UTC
(In reply to Lukas Pramuk from comment #17)
> In order to ensure that rhsmd & susbscription-manager will work after a
> fresh install, you will need to modify related kickstarts to include PyXML
> to packages that are installed during kickstart (tab Software - subtab
> Package Groups):
> 
> @Base
> PyXML
> 
> The other possibility is to add rpm dependency for PyXML. WYT?

Yes, I was going to add it as a requires.  I will get that change in shortly.

Comment 19 Alex Wood 2015-07-10 15:43:46 UTC
PyXML added as Requires in subscription-manager-1.11.3-12.el5

Comment 20 Lukas Pramuk 2015-07-22 12:28:33 UTC
VERIFIED.

used reproducer in comment #12:

# rpm -q python-rhsm subscription-manager python-dateutil PyXML
python-rhsm-1.13.2.1-1.el5
subscription-manager-1.11.3-12.el5
package python-dateutil is not installed
PyXML-0.8.4-6.el5

# yum repolist
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
repo id                                                                          repo name                                                                                                   status
rhel-x86_64-server-5                                                             Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)                                                           16,814
rhn-tools-rhel-x86_64-server-5                                                   Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64)                                                      618
repolist: 17,432

# /etc/cron.daily/rhsmd

Comment 22 errata-xmlrpc 2015-07-24 08:16:28 UTC
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/RHBA-2015-1489.html