First aids restoring a Rails app after a crash

The very first steps to restore a Rails application after a crash:

  1. Check the logs:
    tail -f myapp/log/production.log

    Hopefully here will appear the error that generates the crash.

    If nothing appear, even after refreshing, is because the application is not running, so usually is a fail on the mongrels. If in doubt is not a bad idea restart them anyway.

  2. Check for the mongrels for our app and kill/restart them.
    ps aux | grep mongrel
    rm log/mongrel.88*.pid
    mongrel_rails cluster::start
  3. If is not the mongrels, probably something related to the web server. Restart it.
    nginx -t -c /etc/nginx/nginx.conf
    sudo /etc/init.d/nginx restart

Leave a comment