Forum: Ruby on Rails Incomplete headers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7a1e3e4b4337a358175632374b9e1a08?d=identicon&s=25 Michael Gebhart (Guest)
on 2005-12-21 13:09
(Received via mailing list)
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:

<VirtualHost myIP:80>
    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>
</VirtualHost>


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
953c18019bceaa294ae0429bef6ab388?d=identicon&s=25 Norman Timmler (Guest)
on 2005-12-21 13:54
(Received via mailing list)
Am Mittwoch, den 21.12.2005, 13:18 +0100 schrieb Michael Gebhart:
> 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?
7a1e3e4b4337a358175632374b9e1a08?d=identicon&s=25 Michael Gebhart (Guest)
on 2005-12-21 17:11
(Received via mailing list)
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
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2005-12-21 17:17
(Received via mailing list)
Michael Gebhart 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.
7a1e3e4b4337a358175632374b9e1a08?d=identicon&s=25 Michael Gebhart (Guest)
on 2005-12-21 17:23
(Received via mailing list)
Hi,

hm no, this did not help :(

Greetings

Mike
953c18019bceaa294ae0429bef6ab388?d=identicon&s=25 Norman Timmler (Guest)
on 2005-12-21 20:15
(Received via mailing list)
Am Mittwoch, den 21.12.2005, 17:20 +0100 schrieb Michael Gebhart:
> 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.
7a1e3e4b4337a358175632374b9e1a08?d=identicon&s=25 Michael Gebhart (Guest)
on 2005-12-22 09:55
(Received via mailing list)
Hi,

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

Any further ideas, what I can do?

Greetings

Mike
E6dcb4743b83392a4fc39693f110cc26?d=identicon&s=25 =?UTF-8?Q?J=C3=A9r=C3=B4me_L?= (Guest)
on 2005-12-27 09:52
(Received via mailing list)
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
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Andrew Turner (Guest)
on 2006-02-16 06:51
(Received via mailing list)
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
http://highearthorbit.com
This topic is locked and can not be replied to.