# Dreamhost FastCGI: incomplete headers (0 bytes) errors

**URL:** <https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127>\
**Category:** Rails\
**Created:** [August 16, 2006, 12:08pm UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127 "2006-08-16T12:08:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 16, 2006, 12:08pm UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/1 "2006-08-16T12:08:46Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 17, 2006, 5:10am UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/2 "2006-08-17T05:10:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 17, 2006, 10:01am UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/3 "2006-08-17T10:01:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 17, 2006, 8:18pm UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/4 "2006-08-17T20:18:00Z")

</div>

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

cheers,J

---

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 17, 2006, 8:08pm UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/5 "2006-08-17T20:08:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 17, 2006, 8:51pm UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/6 "2006-08-17T20:51:54Z")

</div>

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 ☹ 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](https://panel.dreamhost.com/index.cgi?tree=home.sugg&category=Software%20Installations&search=mongrel)

regards,

Chris

---

<div class="post-metadata">

**Author:** ![chrislo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@chrislo](https://www.ruby-forum.com/u/chrislo)\
**Post date:** [August 20, 2006, 1:20am UTC](https://www.ruby-forum.com/t/dreamhost-fastcgi-incomplete-headers-0-bytes-errors/65127/7 "2006-08-20T01:20:47Z")

</div>

Gene H. wrote:

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

Lol. Tester
