Dreamhost FastCGI: incomplete headers (0 bytes) errors

Sorry to trouble the list with another Dreamhost problem, but looking
through the archives I see nothing that can solve my problem.

I have installed my app as per
http://wiki.dreamhost.com/index.php/Ruby_on_Rails#Quick_Start_Guide_August_2006

with a symbolic link from my_domain.tld in ~/ to
~/apps/residence/public/

I get the Rails welcome screen. I have uploaded my app directory etc,
and populated my database. If I start Webrick in production mode on
dreamhost I can access the website fine, and everything seems to work.

I have a dispatch.fcgi file that reads :

#!/usr/bin/ruby
require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’

class RailsFCGIHandler
private
def frao_handler(signal)
dispatcher_log :info, “asked to terminate immediately”
dispatcher_log :info, “frao handler working its magic!”
restart_handler(signal)
end
alias_method :exit_now_handler, :frao_handler
end

RailsFCGIHandler.process!

and a line in public/.htacces that reads:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Unfortunately I cannot access my app. After a couple of minutes I get a
Application error
Rails application failed to start properly

and

[Wed Aug 16 03:01:05 2006] [error] [client 88.110.215.43] FastCGI: comm
with (dynamic) server “/home/c_lowis/residence-review.com/dispatch.fcgi”
aborted: (first read) idle timeout (120 sec)
[Wed Aug 16 03:01:05 2006] [error] [client 88.110.215.43] FastCGI:
incomplete headers (0 bytes) received from server
“/home/c_lowis/residence-review.com/dispatch.fcgi”

in my error.log in the ~/logs/ directory.

Changing the shebang in dispatch.* doesn’t seem to make a difference.
Does anybody have any ideas ?

Kind regards,

Chris

I’m in the exact same boat! Did you ever figure it out?

Gene H. wrote:

I’m in the exact same boat! Did you ever figure it out?

Well, in the end I managed to get something working by not symlinking
my-domain.tld in ~/ to another directory where my app is installed.
Rather run:
$ rails my-domain.tld in ~/

and follow the rest of the wiki page from there.

Now I am having all kinds of problems with getting rails to recognise
that gems are installed. All my controllers that use features from other
gems (I’ve tried SimpleSearch and Ferret) give me
uninitialized constant

errors in the production.log. It’s quite a frustrating experience ! I’d
appreciate any pointers,

Chris

I suggest you run dispatch.fcgi from the command line - you’ll
generally get more info that way

cheers,J

make sure your .profile (or whatever your shell file is) has your paths
for
locally install gems. As for the fcgi errors i have found that this
typically happens when the tmp/ and log/ folders are not available for
rails
to write into. This happens when I launch a new app from svn as i put
svn:ignore on the folders. another thing that has helped is forcing GC
to
happen in your dispatch.fcgi. I find 50 requests works well. Hope this
helps

Jodi S. wrote:

I suggest you run dispatch.fcgi from the command line - you’ll
generally get more info that way

cheers,J

Thanks to both of you for your useful insights . At the moment things
seem to be working ok, although I’ve had to abandon ferret for the time
being :frowning: The GC suggestion is something I haven’t tried, perhaps that
may help .

Local development with Mongrel is so much nicer ! There’s a support
request open for dreamhost users to vote for Mongrel support - if anyone
is interested you can vote here :

https://panel.dreamhost.com/index.cgi?tree=home.sugg&category=Software%20Installations&search=mongrel

regards,

Chris

Gene H. wrote:

I’m in the exact same boat! Did you ever figure it out?

Lol. Tester