CentOS 6.3

Recently I've started getting the following error on my CentOS VPS when running yum update:

[user@foo1 ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink                                            |  11 kB     00:00
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 285, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 136, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 434, in doCommands
  File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 99, in _getTs
  File "/usr/lib/python2.6/site-packages/yum/depsolve.py", line 110, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 897, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 682, in _getSacks
  File "/usr/lib/python2.6/site-packages/yum/repos.py", line 265, in populateSack
  File "/usr/lib/python2.6/site-packages/yum/repos.py", line 92, in doSetup
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/fastestmirror.py", line 202, in postreposetup_hook
    all_urls = FastestMirror(all_urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 369, in get_mirrorlist
  File "/usr/lib/yum-plugins/fastestmirror.py", line 413, in _poll_mirrors
  File "/usr/lib/python2.6/threading.py", line 474, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

I've tried yum clean all but that doesn't seem to help. The VPS doesn't have a lot of memory to begin with but I'm not seeing it at a substantially low value:

[user@foo ~]# free
             total       used       free     shared    buffers     cached
Mem:        262144     109904     152240          0          0          0
-/+ buffers/cache:     109904     152240

If I reboot the system, it works fine (for awhile... then the issue returns again a few hours later).

Any thoughts? What can I do to troubleshoot this?

  • @Mat - This is probably an OpenVZ container. OpenVZ containers do not support swap. – Chris Down Feb 25 '13 at 6:30
  • @ChrisDown: oh, didn't know that. Thanks. – Mat Feb 25 '13 at 7:33
  • The messages point to nonexisting/damaged pieces of yum(1) and/or Python. But if that is so, it shouldn't "work for a few hours". Perhaps a memory hog running, and yum just hasn't got enough memory to start properly? Check relevant variables (memory, primarily) when it works fine and when it doesn't. Install yum-utils, look up the documentation on package-cleanup(1) and see if that tells you anything of interest. Check the logs for a sucessful run and a failed one. – vonbrand Feb 25 '13 at 16:08

I found the answer here: http://blog.aditech.info/2012/05/fix-threaderror-cant-start-new-thread.html

The short summary is that there was insufficient memory available on the box. Disabling the fastest-mirror plug-in resolved the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.