Broken YUM

Issues related to applications and software problems
Post Reply
phoenix
Posts: 141
Joined: 2005/09/07 08:39:55
Location: Vannes, France

Broken YUM

Post by phoenix » 2014/10/24 13:41:31

Hi

I seem to have a broken YUM, after a yum update some weeks back I tried to check for any updates recently and I have the following errors:

Code: Select all

Loaded plugins: fastestmirror
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 571, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 499, in doCommand
    ret = base.updatePkgs(extcmds, update_to=(basecmd == 'update-to'))
  File "/usr/share/yum-cli/cli.py", line 1013, in updatePkgs
    self.update()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 5041, in update
    updates = self.up.getUpdatesTuples()
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1097, in <lambda>
    up = property(fget=lambda self: self._getUpdates(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 843, in _getUpdates
    self._up = rpmUtils.updates.Updates(self.rpmdb.simplePkgList(), self.pkgSack.simplePkgList())
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1078, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 783, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 344, in populateSack
    self.doSetup()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 157, in doSetup
    self.retrieveAllMD()
  File "/usr/lib/python2.7/site-packages/yum/repos.py", line 88, in retrieveAllMD
    dl = repo._async and repo._commonLoadRepoXML(repo)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1456, in _commonLoadRepoXML
    result = self._getFileRepoXML(local, text)
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1234, in _getFileRepoXML
    size=102400) # setting max size as 100K
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1014, in _getFile
    result = self.grab.urlgrab(misc.to_utf8(relative), local,
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 694, in <lambda>
    grab = property(lambda self: self._getgrab())
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 689, in _getgrab
    self._setupGrab()
  File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 655, in _setupGrab
    failure_callback=mirror_failure)
  File "/usr/lib/python2.7/site-packages/urlgrabber/mirror.py", line 275, in __init__
    self.mirrors.sort(key=estimate, reverse=True)
  File "/usr/lib/python2.7/site-packages/urlgrabber/mirror.py", line 269, in estimate
    speed, fail = _TH.estimate(m['mirror'])
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 2416, in estimate
    _TH.load()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 2365, in load
    host, speed, fail, ts = line.rsplit(' ', 3)
ValueError: need more than 1 value to unpack
This is a relatively recent (initial) minimal install of CentOS7 (CentOS Linux release 7.0.1406 (Core)) and is running in a VM on VMware ESX 5.5, in addition to the standard repositories I have nux-dextop, epel and vmware-tools enabled. This server runs power-dns server (with MariaDB as the backend) & recursor, deluge bittorrent server, HTTPD and a Splunk indexer forwarding logs to a central server.

I can't determine from that output what the exact problem actually is and I've tried a couple of solutions from a search but they are only cleaning the yum cache, metadata and rpm db and none of those do any good, I've also downloaded and reinstalled all the rpms for yum that I could find and that also didn't do any good. I'm totally lost with this problem, is this fixable and is there any more information required to help diagnose this problem?
Regards


Bill

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Broken YUM

Post by TrevorH » 2014/10/24 14:11:46

Try with yum --noplugins update or whatever. That looks like fastestmirror going wrong to me.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

phoenix
Posts: 141
Joined: 2005/09/07 08:39:55
Location: Vannes, France

Re: Broken YUM

Post by phoenix » 2014/10/24 14:24:54

I have a feeling I'd tried that but I did it again and I still get the same error
Regards


Bill

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Broken YUM

Post by TrevorH » 2014/10/24 14:42:39

Post all the repo files from /etc/yum.repos.d and the contents of /etc/yum.conf
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

phoenix
Posts: 141
Joined: 2005/09/07 08:39:55
Location: Vannes, France

Re: Broken YUM

Post by phoenix » 2014/10/24 14:51:54

Code: Select all

cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release


#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

Code: Select all

cat epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

Code: Select all

cat nux-dextop.repo
[nux-dextop]
name=Nux.Ro RPMs for general desktop use
baseurl=http://li.nux.ro/download/nux/dextop/el7/$basearch/ http://mirror.li.nux.ro/li.nux.ro/nux/dextop/el7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro
protect=0

[nux-dextop-testing]
name=Nux.Ro RPMs for general desktop use - testing
baseurl=http://li.nux.ro/download/nux/dextop-testing/el7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-nux.ro
protect=0

Code: Select all

cat vmware-tools.repo
[vmware-tools]
name = VMware Tools
baseurl = http://packages.vmware.com/packages/rhel7/x86_64/
enabled = 1
gpgcheck = 1
I've just checked and the only CentOS repository that's enabled is the base one (that's been the case since the initial install), if you need those files I'll post them as well.

I meant to say earlier, thanks for your prompt reply and help with this. :)
Regards


Bill

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Broken YUM

Post by TrevorH » 2014/10/24 20:25:42

The only thing odd I see in your repo files is in that last one. None of mine have a space after they keyword on either side of the = sign. Try removing those extra spaces from the vmware repo lines.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

phoenix
Posts: 141
Joined: 2005/09/07 08:39:55
Location: Vannes, France

Re: Broken YUM

Post by phoenix » 2014/10/25 06:29:21

That last repo was a copy/paste from the VMware site and it's been working fine until this problem but I removed the all the spaces from either side of all the equals, still the same result.
Regards


Bill

User avatar
TrevorH
Forum Moderator
Posts: 29457
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Broken YUM

Post by TrevorH » 2014/10/25 07:59:57

My last suggestion before I'm out of ideas is to run yum --noplugins --disablerepo=\* --enablerepo=base,updates update and see if that helps. After that I think you're into reading the code and running it via strace to see if you can get more clues as to what's going on...
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

phoenix
Posts: 141
Joined: 2005/09/07 08:39:55
Location: Vannes, France

Re: Broken YUM

Post by phoenix » 2014/10/25 10:18:01

OK, I'll give your suggestions a try although with the lack of anything showing up on the internet (and my limited skills) I don't think I'll hold out much hope. If I manage to recover this I'll post any solution here. Thanks again for your help.
Regards


Bill

phoenix
Posts: 141
Joined: 2005/09/07 08:39:55
Location: Vannes, France

Re: Broken YUM

Post by phoenix » 2014/10/26 06:40:46

I'm afraid your suggestion didn't work so I resorted to try strace. While looking at the trace output I remembered that the fastest mirror plugin used these two files:

Code: Select all

/var/cache/yum/x86_64/7/base/mirrorlist.txt
/var/cache/yum/x86_64/7/timedhosts
Looking at those files didn't provide any great inspiration so I resorted to brute force by removing them and running yum update again, voila!! The files were recreated and the update worked, I would have thought that even if the files were corrupt that disabling the fastest mirror plugin would have disabled reading (or opening) those files but the strace showed otherwise. In any case, problem solved and thanks again for your help. :)
Regards


Bill

Post Reply

Return to “CentOS 7 - Software Support”