yum crashing with “thread.error: can’t start new thread”

While attempting to install a package on a VPS, I encountered:

[root@drache ~]# yum install php-mysql
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
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 178, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 345, in doCommands
    self._getTs(needTsRemove)
  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 661, in 
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 501, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 232, in populateSack
    self.doSetup()
  File "/usr/lib/python2.4/site-packages/yum/repos.py", line 79, in doSetup
    self.ayum.plugins.run('postreposetup')
  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/fastestmirror.py", line 181, in postreposetup_hook
    all_urls = FastestMirror(all_urls).get_mirrorlist()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist
    self._poll_mirrors()
  File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors
    pollThread.start()
  File "/usr/lib64/python2.4/threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

The solution was to disable the fastest mirror plugin by editing /etc/yum/pluginconf.d/fastestmirror.conf:

cat /etc/yum/pluginconf.d/fastestmirror.conf
[main]
enabled=0
verbose=0
socket_timeout=3
hostfilepath=/var/cache/yum/timedhosts.txt
maxhostfileage=10
maxthreads=15
#exclude=.gov, facebook

Event ID 9: iaStor0 did not respond within the timeout period

Just tonight, after 40 mins after waking my computer from sleep, my CDROM empty drive started to randomly attempt to read/seek and hang the entire system. The hard disk activity light was also constantly on. Thinking that it was some sort of issue with a rogue program trying to open a file on a CDROM and failing, I rebooted my computer. It took forever to get past BIOS, and the computer hung on the “Starting Windows” screen while booting windows.

At the end, I disconnected the SATA cable connecting the CDROM and attempted to boot the computer again. This time, without the CDROM drive connected, the computer boots as it always had! Looking at Window’s system logs, the error “The device, \Device\Ide\iaStor0, did not respond within the timeout period.” began flooding the logs approximately 40 minutes after my computer turned on. The full error goes as follows:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="iaStorV" /> 
  <EventID Qualifiers="49156">9</EventID> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2011-03-02T08:09:59.225343600Z" /> 
  <EventRecordID>8079</EventRecordID> 
  <Channel>System</Channel> 
  <Computer>win7</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>\Device\Ide\iaStor0</Data> 
  <Binary>0F0005000100000000000000090004C00100000000000000000000000000000000000000000000000000000000</Binary> 
  </EventData>
  </Event>

A quick google search turned up that it is most probably some issue with the Intel RAID firmware I have on my motherboard. Now, I’m left with one question: What suddenly caused this error to occur? There was no hardware or software changes. The computer had no problems for the past 3 years prior to tonight.

At any rate, I have no problems living without a DVD drive. Who uses those these days anyway (other than to reinstall windows, still haven’t gotten PXE boot to work for WinPE).


Addendum: I recently needed to read some DVDs and replugged in the DVD drive without issue. I’ve no idea why this error occured, but it appeared to have resolved itself during the 2 months when it was completely unplugged from my computer.

fcntl() failed – No locks available

Recently, I’ve been trying to setup dovecot with postfix on a server. While attempting to get kerberos/ldap authentication working, I’ve ran into the following error:

dovecot: Feb 22 22:43:02 Error: IMAP(leo): fcntl() failed with file /home/leo/Maildir/dovecot.index.log: No locks available
dovecot: Feb 22 22:43:02 Error: IMAP(leo): mail_index_wait_lock_fd() failed with file /home/leo/Maildir/dovecot.index.log: No locks available

The /home directory is a automounted NFS share from a remote server. To resolve this issue, ensure that nfslock is running on both the server and client machine.

Disable Putty CTRL-S (XOFF)

Using putty with programs that bind keys to CTRL-S may be slighly problematic since putty will send XOFF, which will basically freeze your terminal until you send XON (CTRL-Q).

To disable XOFF, add to your .bashrc file the following lines:

stty ixany
stty ixoff -ixon
stty stop undef
stty start undef

Ubuntu 10.10 PXE live boot

This guide will setup Ubuntu 10.10 PXE live cd boot using NFS.

1. Setup your standard PXE server (tftp + dhcp) such that your files are under /tftpboot. Under CentOS, this is accomplished by

yum install tftp tftp-server xinetd syslinux
  • tftp/tftp-server is for the tftp server which is required to boot off PXE
  • xinetd is the super server which launches the tftp server when requested
  • syslinux contains pxelinux.0. This can also be found on some linux distribution images

2. Download the Ubuntu 10.10 iso.
3. Either mount the iso and extract the files to /tftpboot/images/ubuntu1010

 mount -o loop ubuntu-10.10-desktop-i386.iso  /mnt
cp -a /mnt/. /tftpboot/images/ubuntu1010
umount /mnt

or mount the iso directly to /tftpboot/images/ubuntu1010

mount -o loop ubuntu-10.10-desktop-i386.iso  /tftpboot/images/ubuntu1010

4. Add the following entry to your /tftpboot/pxelinux.cfg/default

label 2
        kernel /images/ubuntu1010/casper/vmlinuz
        append root=/dev/nfs boot=casper netboot=nfs nfsroot=10.1.1.6:/tftpboot/images/ubuntu1010 initrd=/images/ubuntu1010/casper/initrd.lz quiet splash --

5. Add the following entry to your /etc/exports

/tftpboot/images/ubuntu1010 10.1.1.0/24(async,no_root_squash,no_subtree_check,ro)
  • /tftpboot/images/ubuntu1010 – the location which is to be shared via NFS
  • 10.1.1.0/24 – the IPs which are allowed to access this share. Change this to match your network IPs.

6. Start/restart your NFS server
7. Your PXE boot should now work. When greeted with your pxe screen, enter ‘2’ (or whatever was set as your label in the pxe config file), and ubuntu should should begin booting.

Apache/HTTPd missing startup script

After manually compiling apache, there doesn’t seem to be a startup script provided. If that’s the case, use the following for the apache startup script (taken from http://www.faqs.org/docs/securing/chap29sec247.html). Place it in /etc/init.d/ with 755 chmod & root ownership and group.

If you compiled apache to a different location, outside of the usual PATH, you need to specify the full path to httpd in the script below.

#!/bin/sh
#
# Startup script for the Apache Web Server
#
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server. It is used to serve 
# HTML files and CGI.
# processname: httpd

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
	start)
		echo -n "Starting httpd: "
		daemon /path/to/apache/bin/httpd -DSSL
		echo
		touch /var/lock/subsys/httpd
		;;
	stop)
		echo -n "Shutting down http: "
		killproc httpd
		echo
		rm -f /var/lock/subsys/httpd
		rm -f /var/run/httpd.pid
		;;
	status)
		status httpd
		;;
	restart)
		$0 stop
		$0 start
		;;
	reload)
		echo -n "Reloading httpd: "
		killproc httpd -HUP
		echo
		;;
	*)
		echo "Usage: $0 {start|stop|restart|reload|status}"
		exit 1
		esac

exit 0