Incomplete headers

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

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?

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.

Hi,

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

Any further ideas, what I can do?

Greetings

Mike

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

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.

Hi,

hm no, this did not help :frowning:

Greetings

Mike

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:inexit_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:incall’
/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:inwrite_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:ingo’
/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:inwrite_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:inwrite_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:inwrite_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:inindent’
/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:inwrite_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:inmethod_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:inmethod_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:inindent’
/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:ineach_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:ineach_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:inmethod_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:inmethod_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:inwrite_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:inload’
/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:inreload’
/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:indispatch’
/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:inprocess!’
/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:ineach’
/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:inprocess!’
/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

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