Description of problem: When I'm running through proxy which is stopped, yum fails (which is OK), but it fails with different exception than expected. Version-Release number of selected component (if applicable): yum-rhn-plugin-0.5.4-26.el5 yum-3.2.22-38.el5 How reproducible: always Steps to Reproduce: 1. Register yourself to RHN (RHN Satellite in my case) 2. Configure yum-rhn-plugin to run through proxy # grep -i proxy /etc/sysconfig/rhn/up2date | grep -v comment enableProxyAuth=1 enableProxy=1 proxyPassword=proxy_password proxyUser=proxy_user httpProxy=localhost:3128 3. Stop the proxy # service squid stop 4. Try to install some package from RHN channel # yum install -y test-package Actual results: # yum install -y test-regular-mon07nov2011_12_56_42_27745-0.1-1 Loaded plugins: rhnplugin 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 254, in _getConfig self.plugins.run('init') 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/rhnplugin.py", line 148, in init_hook conduit.error(0, COMMUNICATION_ERROR + "\n" + CHANNELS_DISABLED + File "/usr/lib/python2.4/site-packages/yum/Errors.py", line 32, in __str__ return "%s" %(self.value,) AttributeError: CommunicationError instance has no attribute 'value' Expected results: Error message should state there is a problem with connection. Additional info: From code inspection this seems to be caused by a mishmash of which variable yum and yum-rhn-plugin are using to store exception string: === yum uses self.value in its exceptions === # vim /usr/lib/python2.4/site-packages/yum/Errors.py class YumBaseError(Exception): """ Base Yum Error. All other Errors thrown by yum should inherit from this. """ def __init__(self, value=None): Exception.__init__(self) self.value = value def __str__(self): return "%s" %(self.value,) === yum-rhn-plugin uses self.errmsg === # vim /usr/share/rhn/up2date_client/up2dateErrors.py class Error(YumBaseError): """base class for errors""" def __init__(self, errmsg): self.errmsg = errmsg self.log = up2dateLog.initLog() def __repr__(self): self.log.log_me(self.errmsg) return self.errmsg
This is just special case (or better: consequence) of bug 595837. Fixed in spacewalk.git as commit 1bdc55b83a00d48bb263ba7d4f9c13d3b0ddbb1e
I forgot that backend still use errmsg, so I created setter and getter for errmsg as alias to value. commited as 61d62a5a31cdfb5094987c2575a5b0a56e9c194d and 369c6fb728bf69c742d1f526244c753b401e0c7a
both commits cherrypicked to svn as rev. 208312.
Fixed in rev. 208328.
*** Bug 756324 has been marked as a duplicate of this bug. ***
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. http://rhn.redhat.com/errata/RHBA-2012-0250.html