0

Yum is failing on some of my amazon instances, I tried to followup with the amazon guys but not able to get it fixed yet. Below is the error,python and yum version info:

[root@myhost_test.cache]# yum list
Loaded plugins: priorities, s3iam, update-motd, upgrade-helper
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 174, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 572, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 638, in doCommand
    repoid=repoid)
  File "/usr/share/yum-cli/cli.py", line 1382, in returnPkgLists
    ignore_case=True, repoid=repoid)
  File "/usr/lib/python2.7/dist-packages/yum/__init__.py", line 2886, in doPackageLists
    avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
  File "/usr/lib/python2.7/dist-packages/yum/__init__.py", line 1069, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/dist-packages/yum/__init__.py", line 774, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/dist-packages/yum/repos.py", line 383, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 250, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 342, in _check_db_version
    return repo._check_db_version(mdtype)
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1520, in _check_db_version
    repoXML = self.repoXML
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1706, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1702, in _getRepoXML
    self._loadRepoXML(text=self.ui_id)
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1693, in _loadRepoXML
    return self._groupLoadRepoXML(text, self._mdpolicy2mdtypes())
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1667, in _groupLoadRepoXML
    if self._commonLoadRepoXML(text):
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1492, in _commonLoadRepoXML
    result = self._getFileRepoXML(local, text)
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1270, in _getFileRepoXML
    size=102400) # setting max size as 100K
  File "/usr/lib/python2.7/dist-packages/yum/yumRepo.py", line 1058, in _getFile
    **kwargs
  File "/usr/lib/yum-plugins/s3iam.py", line 195, in urlgrab
    response = urllib2.urlopen(request)
  File "/usr/local/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/local/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/local/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/local/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/local/lib/python2.7/urllib2.py", line 1181, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/local/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/usr/local/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/local/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/local/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/local/lib/python2.7/httplib.py", line 1176, in connect
    self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
  File "/usr/local/lib/python2.7/ssl.py", line 387, in wrap_socket
    ciphers=ciphers)
  File "/usr/local/lib/python2.7/ssl.py", line 138, in __init__
    self._sslobj = _ssl.sslwrap(self._sock, server_side,
AttributeError: 'module' object has no attribute 'sslwrap'
[root@ip-10-30-213-135-datascience cache]# python -V
Python 2.7.6
[root@ip-10-30-213-135-datascience cache]# yum --version
3.4.3
  Installed: rpm-4.11.2-2.63.amzn1.x86_64 at 2015-03-25 11:50
  Built    : Amazon.com, Inc. <http://aws.amazon.com> at 2015-03-17 21:56
  Committed: Ben Cressey <bcressey@amazon.com> at 2015-03-17

  Installed: yum-3.4.3-137.54.amzn1.noarch at 2015-03-25 11:50
  Built    : Amazon.com, Inc. <http://aws.amazon.com> at 2015-03-04 01:16
  Committed: Rodrigo Novo <rodarvus@amazon.de> at 2015-03-04
Aaron Copley
  • 12,525
  • 5
  • 47
  • 68
Ramesh Kumar
  • 1,770
  • 5
  • 19
  • 29
  • Since this is a custom package of `yum` built by Amazon exclusively for use on their system, your query may best be directed to them. Copying the binaries directly off of a working server may help if Amazon refuses, though. – Hyppy Apr 23 '15 at 19:29

2 Answers2

2

Problem is with SSLwrap getting removed in python 2.7 onwards. to rectify this a short solution is make yum use python2.6

vim /usr/bin/yum

change shebang of it to python2.6

kewl vivek
  • 36
  • 2
1

It seems there is a problem with the /usr/local/lib/python2.7/ssl.py file.

Can you post an the md5sum of this file both from the failing machine and from a working one? Can you also check if the python version is the same?

shodanshok
  • 47,711
  • 7
  • 111
  • 180