It’s just data

SQLite3::CorruptException: database disk image is malformed

Call for testers.  In addition to making sure that the scenarios described in Agile Web Development with Rails work with Rails 3.0, I’m monitoring the development on Rails 3.1.  At the present time, I have a highly repeatable scenario that produces the error mentioned above (scroll to the bottom).

In order to test this, you need a current (master) clone of the following repositories:

If you have all three, I’d appreciate any help people can give in running the simple instructions mentioned in this bug, and reporting on the results you see in the bug report itself — either passes or failures.  My plans are to try to reproduce this under a virtual machine, incrementally adding gems and packages to see if I can identify the environmental change which causes this failure.

OK, this makes no sense at all; but I created a virtual machine on one of the machines in which I had corruption problems, and initially the test passed.  I then one by one installed packages until I saw the failure... and the packages which caused the problem was postfix.

I uninstalled postfix and the test passed again.

Tomorrow, I will destroy the virtual machine and reinstall fresh, and ONLY install what is needed to get the test to run, and then ONLY install postfix and see what happens.

Posted by Sam Ruby at

Postfix on RHEL 6 does not cause the problem with this scenario.  Version information:

RHEL 6: postfix-2.6.6-2.el6.x86_64
Ubuntu 10.04-1: 2.7.0-1

Posted by Sam Ruby at

Reproduction instructions using Ubuntu 10.04-1 on VirtualBox.  Probably optional:

sudo apt-get update
sudo apt-get dist-upgrade
sudo shutdown -r now
sudo /media/VBOXADDITIONS_3.1.6_59338/
sudo shutdown -r now

Prep for rvm:

sudo apt-get install build-essential zlib1g-dev libreadline5-dev libxml2-dev libsqlite3-dev libssl-dev curl git-core
bash < <( curl )
source "$HOME/.rvm/scripts/rvm"
rvm install 1.8.7
rvm use 1.8.7

Fetch rails master:

mkdir git
cd git
git clone git://
git clone git://
git clone git://
cd ..

Fetch tests:

mkdir tmp
cd tmp
tar xzf pre-corruption.tgz
gem install bundler
sed -i s/rubys/$USER/ Gemfile
bundle install

Now install the villian (be sure to configure or it won’t fail!):

sudo apt-get install postfix

Automated tests:

ruby corruption_test.rb
firefox work/corruption_test.html

Manual tests:

cp -rp pre-corruption corrupt
cd corrupt
sed -i s/rubys/$USER/ Gemfile
bundle install
rake db:migrate db:seed
# once server has started, visit http://localhost:3000/ then:
# ... click on the first Add to Cart button; then Checkout; then Place Order
ruby ~/git/rails/bin/rails server

To verify that it was postfix that caused this:

sudo apt-get remove postfix

Note: both Rails master and Rails 3-0-stable use mail 2.2.12.

Posted by Sam Ruby at

Isolated to this commit.

Posted by Sam Ruby at

Revision 30294: Net::SMTP should close the SSL connection if the connection verification fails

backported to Mail gem

mail 2.2.13 released

Posted by Sam Ruby at

Add your comment