This actually has nothing to do with Ruby / Rails, I just ran into this myself and had quite a bit of trouble finding a real answer.
The issue is that the sphinx indexer script is trying to create a temporary MySQL table while building the index. In my case MySQL ran out of disk space for the temporary table (default is /tmp
, my partition was only 2GB)
As data is added to this temporary table and the disk is filled the table becomes corrupt, because the last bit of data written to the temp table is truncated.
The solution is to ensure the drive that MySQL is writing temporary tables to has enough space on it. I ended up changing the temp directory in my.cnf
to a different larger partition. Default location for the config file on debian is /etc/mysql/my.cnf
Add:
tmpdir = /var/lib/mysql/tmp
Best place to put it is next to the datadir
setting in the [mysqld]
section.