# Incomplete headers

**URL:** <https://www.ruby-forum.com/t/incomplete-headers/50816>\
**Category:** Rails\
**Created:** [December 21, 2005, 1:09pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816 "2005-12-21T13:09:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 21, 2005, 1:09pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/1 "2005-12-21T13:09:17Z")

</div>

Hi,

I wanna use Rails on a SuSE server with apache. Everything should be  
installed correctly, but when running the application I get this in my  
apache log:

FastCGI: comm with server  
“/srv/www/htdocs/web4/html/rails/public/dispatch.fcgi” aborted: idle  
timeout (60 sec)  
FastCGI: incomplete headers (0 bytes) received from server  
“/srv/www/htdocs/web4/html/rails/public/dispatch.fcgi”

When using the WEBRick server it works. This is my virtual Host Config:

 ServerName myServer DocumentRoot /srv/www/htdocs/web4/html/rails/public ErrorLog /srv/www/htdocs/web4/html/rails/log/apache.log

```
FastCgiIpcDir /tmp/fcgi_ipc
FastCgiServer /srv/www/htdocs/web4/html/rails/public/dispatch.fcgi \
   -initial-env RAILS_ENV=development \
   -idle-timeout 60

<Directory /srv/www/htdocs/web4/html/rails/public>
    Options ExecCGI FollowSymLinks
    AddHandler fastcgi-script .fcgi
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

```

I’ve already tried a lot. The /tmp/fcgi\_ipc has the correct permissions  
and the cgiserver-setting seem to work, because the timeout in the error  
message is 60 seconds too.

I’ve also downgraded vom fcgi 0.8.6 to 0.8.5, because I read, that there  
is a bug in the current version.

When running the dispatcher manually, I get this:

chicago110:/srv/www/htdocs/web4/html/rails/public # ruby dispatch.fcgi  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:274:  
warning: already initialized constant KNOWN\_OPTIONS  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:279:  
warning: already initialized constant DEF\_KEY\_ATTRIBUTES  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:280:  
warning: already initialized constant DEF\_ROOT\_NAME  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:281:  
warning: already initialized constant DEF\_CONTENT\_KEY  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:282:  
warning: already initialized constant DEF\_XML\_DECLARATION  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:283:  
warning: already initialized constant DEF\_ANONYMOUS\_TAG  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:284:  
warning: already initialized constant DEF\_FORCE\_ARRAY  
/usr/lib/ruby/gems/1.8/gems/xml-simple-1.0.7/lib/xmlsimple.rb:285:  
warning: already initialized constant DEF\_INDENTATION  
Status: 500 Internal Server Error

And in the fastcgi.crash.log I get:

[21/Dec/2005:13:07:39 :: 6435] starting  
[21/Dec/2005:13:07:39 :: 6435] terminated gracefully

But I can’t run it in the browser. Any idea why not?

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 21, 2005, 1:54pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/2 "2005-12-21T13:54:31Z")

</div>

Am Mittwoch, den 21.12.2005, 13:18 +0100 schrieb Michael G.:

> And in the fastcgi.crash.log I get:
> 
> [21/Dec/2005:13:07:39 :: 6435] starting  
> [21/Dec/2005:13:07:39 :: 6435] terminated gracefully

What does your development.log say? Is it writeable by the apache user?

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 21, 2005, 8:15pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/3 "2005-12-21T20:15:16Z")

</div>

Am Mittwoch, den 21.12.2005, 17:20 +0100 schrieb Michael G.:

> Hi,
> 
> strange, the log is empty. But it has the needed permissions:
> 
> -rw-rw-rw- 1 web4 ftponly 1 Dec 21 17:07 development.log
> 
> This should be enough, or not?

Yes. What i tested on my machine is, that if you delete development.log  
and run the dispatch.fcgi script manually the logfile should be  
recreated. If it does not on your system, Rails is never starting the  
boot process, that means your problem is lying a little bit deeper.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 22, 2005, 9:55am UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/4 "2005-12-22T09:55:51Z")

</div>

Hi,

ok I tried it out. The development.log was created automatically.

Any further ideas, what I can do?

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 21, 2005, 5:11pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/5 "2005-12-21T17:11:06Z")

</div>

Hi,

strange, the log is empty. But it has the needed permissions:

-rw-rw-rw- 1 web4 ftponly 1 Dec 21 17:07 development.log

This should be enough, or not?

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 21, 2005, 5:17pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/6 "2005-12-21T17:17:07Z")

</div>

Michael G. wrote:

> When using the WEBRick server it works. This is my virtual Host Config:  
> Try deleting any sessions in /tmp/ruby\_sess\*  
> The user under which Apache/FCGI runs may be having a problem reading  
> the session files created by the user under which you were running  
> WEBrick.

–  
We develop, watch us RoR, in numbers too big to ignore.

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 21, 2005, 5:23pm UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/7 "2005-12-21T17:23:08Z")

</div>

Hi,

hm no, this did not help ☹

Greetings

Mike

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [December 27, 2005, 9:52am UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/8 "2005-12-27T09:52:31Z")

</div>

Got the same problem; fastcgi gets really unstable after few requests.  
Running Rails 1.0 and latest freebsd ports for apache and mod\_fastcgi

# In apache error log:

[Tue Dec 27 09:10:34 2005] [error] [client 82.66.216.116] FastCGI:  
incomplete headers (35 bytes) received from server  
“/home/www/public/dispatch.fcgi”

# In development error log:

Processing Base#index (for 82.66.287.128 at 2005-12-26 22:28:19) [GET]  
Parameters: {}

SystemExit (exit):  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/  
fcgi\_handler.rb:122:in `exit' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/ fcgi_handler.rb:122:in`exit\_now\_handler’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
21:in `to_proc' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/ fcgi_handler.rb:110:in`call’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/code\_generation.rb:184:in `hash_value' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:135:in`write\_continue\_generation’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:118:in `write_generation' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/code_generation.rb:207:in`go’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/code\_generation.rb:216:in `continue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:85:in`write\_generation’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:85:in `add_segment' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:85:in`write\_generation’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/code\_generation.rb:207:in `go' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:309:in`write\_generation’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:309:in `method_missing' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/code_generation.rb:46:in`indent’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/code\_generation.rb:46:in `method_missing' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:309:in`write\_generation’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:509:in `generation_code_for' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:507:in`method\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/code\_generation.rb:46:in `indent' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/code_generation.rb:46:in`method\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:507:in `generation_code_for' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:501:in`indent’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:501:in `generation_code_for' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:498:in`each\_with\_index’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:498:in `each' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:498:in`each\_with\_index’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:498:in `generation_code_for' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:493:in`method\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/code\_generation.rb:46:in `indent' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/code_generation.rb:46:in`method\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:493:in `generation_code_for' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:446:in`write\_generation’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/  
action\_controller/routing.rb:577:in `draw' /config/routes.rb:1 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/ active_support/dependencies.rb:207:in`load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/  
active\_support/dependencies.rb:207:in `load' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/ action_controller/routing.rb:555:in`reload’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:  
69:in `prepare_application' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb: 37:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/  
fcgi\_handler.rb:141:in `process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/ fcgi_handler.rb:53:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/  
fcgi\_handler.rb:52:in `each_cgi' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in`each’  
/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/ fcgi_handler.rb:52:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/  
fcgi\_handler.rb:22:in `process!’  
/public/dispatch.fcgi:24

Nothing in fastcgi.crash.log

---

<div class="post-metadata">

**Author:** ![mgreenly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Post date:** [February 16, 2006, 6:51am UTC](https://www.ruby-forum.com/t/incomplete-headers/50816/9 "2006-02-16T06:51:31Z")

</div>

My problem was that the dispatch wasn’t getting the

require ‘fcgi\_handler’

so I had to hand copy this from my rails gem directory to the apps lib/  
directory and it all worked. Obviously not the best solution, but this  
was the root of the problems.

Andrew

> **[High Earth Orbit](https://highearthorbit.com/)**
>
> Personal website of Andrew Turner. Writings on geospatial collaboration, software engineering, Washington D.C., and other individual musings.
