This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes

Bug 712896

Summary: yum regression: in method 'ssl_ctx_load_verify_locations', argument 2 of type 'char const *'
Product: Red Hat Enterprise Linux 5 Reporter: Jan Pazdziora <jpazdziora>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: high    
Version: 5.7CC: omoris, pknirsch, slukasik, syeghiay
Target Milestone: rcKeywords: Regression
Target Release: 5.7   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.22-37.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 07:24:11 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jan Pazdziora 2011-06-13 10:10:15 EDT
Description of problem:


Recently our tests started to fail on RHEL 5.7 (to be). I've narrowed it down to change between yum-3.2.22-33.el5.noarch and yum-3.2.22-34.el5.noarch. We now get traceback

Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 333, in __run_action
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 325, in __do_call
    method = getMethod.getMethod(method, "/usr/share/rhn/", "actions")
  File "/usr/share/rhn/up2date_client/getMethod.py", line 78, in getMethod
    actions = __import__(modulename)
  File "/usr/share/rhn/actions/packages.py", line 268, in ?
    yum_base = YumAction()
  File "/usr/share/rhn/actions/packages.py", line 63, in __init__
    self.doTsSetup()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 86, in doTsSetup
    return self._getTs()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 662, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 502, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 260, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 168, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 226, in _check_db_version
    return repo._check_db_version(mdtype)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1225, in _check_db_version
    repoXML = self.repoXML
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1398, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/share/yum-plugins/rhnplugin.py", line 513, in _getRepoXML
    return YumRepository._getRepoXML(self)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1390, in _getRepoXML
    self._loadRepoXML(text=self)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1380, in _loadRepoXML
    return self._groupLoadRepoXML(text, ["primary"])
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1364, in _groupLoadRepoXML
    if self._commonLoadRepoXML(text):
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1200, in _commonLoadRepoXML
    result = self._getFileRepoXML(local, text)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 973, in _getFileRepoXML
    cache=self.http_caching == 'all')
  File "/usr/share/yum-plugins/rhnplugin.py", line 327, in _getFile
    start, end, copy_local, checkfunc, text, reget, cache, size)
  File "/usr/share/yum-plugins/rhnplugin.py", line 420, in _noExceptionWrappingGet
    result = self.grab.urlgrab(remote, local,
  File "/usr/share/yum-plugins/rhnplugin.py", line 482, in <lambda>
    grab = property(lambda self: self._getgrab())
  File "/usr/share/yum-plugins/rhnplugin.py", line 477, in _getgrab
    self._setupGrab()
  File "/usr/share/yum-plugins/rhnplugin.py", line 444, in _setupGrab
    ugopts = self._default_grabopts()
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 486, in _default_grabopts
    opts = { 'keepalive': self.keepalive,
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 653, in _getSslContext
    sslCtx.load_verify_locations(self.sslcacert)
  File "/usr/lib/python2.4/site-packages/M2Crypto/SSL/Context.py", line 130, in load_verify_locations
    return m2.ssl_ctx_load_verify_locations(self.ctx, cafile, capath)
exceptions.TypeError: in method 'ssl_ctx_load_verify_locations', argument 2 of type 'char const *'

with yum-rhn-plugin from Spacewalk upstream.

A quick Google search shows

        http://efreedom.com/Question/1-3826694/Pythons-M2Crypto-Raises-Exception-Ssl-Ctx-Load-Verify-Locations-Loading-Certificates

where the cause is claimed to be a unicode object instead of string.

Version-Release number of selected component (if applicable):

yum-3.2.22-34.el5.noarch

How reproducible:

Hard, as part of larger test.

Steps to Reproduce:
1. yum repolist
  
Actual results:

Fail with the traceback above.

Expected results:

Should not fail.

Additional info:

James says:

At certain points near the beginning of operations we call
yum/yumRepo.py:_getSslContext(self)

 With 3.2.22-36.el5 this is called with self.sslcacert set to the
unicode string:  /etc/sysconfig/rhn/RHN-ORG-TRUSTED-SSL-CERT

 With 3.2.22-33.el5 this function isn't called at all (because of the
way rhnplugin overrides the yum "grab setup").
Comment 3 Jan Pazdziora 2011-06-16 05:11:50 EDT
Awesome, I confirm that yum-3.2.22-37.el5 fixes the problem for us.

Thank you!

Jan
Comment 5 errata-xmlrpc 2011-07-21 07:24:11 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1060.html