Rails site down - help, I'm dying (almost)


#1

Dreamhost upgraded to 2.1.1 recently, which deprecated my Rails site done with 1.2.5 (Dreamhost officially does not support below 1.2.6 now).

My site died at a crucial time and I managed to get the local debug version running again on my machine, thanks to some changes in environment.rb and boot.rb, as well as changing some deprecated stuff that had been removed in 2.1.

I’ve uploaded the new files but am still crashing. My site is at www.chillisoft.co.za. I tried uploading a sitedown.html to help customers, but that won’t show either.

At least in the short-term I need to do two things. Redirect these errors to www.chillisoft.co.za/sitedown.html and/or display errors so I can see what is causing the continued crashing. Do I need to restart the webserver and how do I do this? I’m a little new at this stuff.

My .htaccess file is as follows:


General Apache options

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

If you don’t want Rails to look in certain directories,

use the following rewrite rules so that Apache won’t rewrite certain requests

Example:

RewriteCond %{REQUEST_URI} ^/notrails.*

RewriteRule .* - [L]

RewriteCond %{REQUEST_URI} ^/blog.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/habanero/forum.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/habanero/wiki.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/support/mantis.*
RewriteRule .* - [L]
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth.html).$ [NC]
RewriteRule .
- [L]
RewriteCond %{REQUEST_URI} ^/sitedown.html
RewriteRule .* - [L]

Redirect all requests not available on the filesystem to Rails

By default the cgi dispatcher is used which is very slow

For better performance replace the dispatcher with the fastcgi one

Example:

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

RewriteEngine On

If your Rails application is accessed via an Alias directive,

then you MUST also set the RewriteBase in this htaccess file.

Example:

Alias /myrailsapp /path/to/myrailsapp/public

RewriteBase /myrailsapp

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

In case Rails experiences terminal errors

Instead of displaying this message you can supply a file here which will be r$

Example:

ErrorDocument 500 /500.html

ErrorDocument 500 "

Application error

Rails application failed to

start properly"

ErrorDocument 500 sitedown.html


#2

If it’s getting down to the 500 error then you should be able to uncomment the line # ErrorDocument 500 /500.html and rename sitedown.html to 500.html

Maximum Cash Discount on any plan with MAXCASH


#3

Thanks.

I’ve managed to fix my .htaccess file. What I’m struggling with now is what I’ve had before, that the rails stuff is timing out and I get a Network Error/TCP Error. Something is holding up my rails code and I’m not getting any useful errors.

My error.log entries read:

[Wed Oct 08 01:41:25 2008] [error] [client 82.208.151.135] FastCGI: incomplete headers (0 bytes) received from server “/home/eric_chilli/chillisoft.co.za/http/dispatch.fcgi”, referer: http://www.chillisoft.co.za/habanero/changes_log
[Wed Oct 08 01:42:27 2008] [error] [client 196.35.158.184] FastCGI: comm with (dynamic) server “/home/eric_chilli/chillisoft.co.za/http/dispatch.fcgi” aborted: (first read) idle timeout (60 sec)
[Wed Oct 08 01:42:27 2008] [error] [client 196.35.158.184] FastCGI: incomplete headers (0 bytes) received from server “/home/eric_chilli/chillisoft.co.za/http/dispatch.fcgi”


#4

I’m having the same problem – site just went flat down at a critical time, and DH Support isn’t offering any info. So they changed their version number? My error is as follows, when I run dispatch.fcgi:

/usr/local/lib/site_ruby/1.8/rubygems/specification.rb:628:in method_missing': undefined methodruntime_dependencies’ for #Gem::Specification:0x2b8b842097f8 (NoMethodError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:162:in activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:49:ingem’
from ./public/…/config/boot.rb:59:in load_rails_gem' from ./public/../config/boot.rb:53:inload_initializer’
from ./public/…/config/boot.rb:38:in run' from ./public/../config/boot.rb:11:inboot!'
from ./public/…/config/boot.rb:109
from ./public/…/config/environment.rb:11:in require' from ./public/../config/environment.rb:11 from ./public/dispatch.fcgi:21:inrequire’
from ./public/dispatch.fcgi:21

Any ideas about how to fix?


#5

Did you guys see this: http://www.dreamhoststatus.com/2008/09/16/rails-211-is-coming/

Maximum Cash Discount on any plan with MAXCASH


#6

No, I didn’t: thank you!