rails-nG6qG2zCiNXF3kJR96AzWl6hYfS7NtTn@public.gmane.org
2005-Oct-15 02:48 UTC
apache graceful/fastcgi rails app stops
Hello out there, After restarting the apache server with apachectl graceful, my rails application stops responding. In the logfile of the application I see -------------------------------------------------- [Sat Oct 15 04:19:27 CEST 2005] Dispatcher failed to catch: exit (SystemExit) /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:10:in `exit'' /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:10 /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:10:in `call'' /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each'' /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /var/www/c.net/myapp/public/dispatch.fcgi:18 FCGI process 17607 killed by this error -------------------------------------------------- But there is a dispatch.fcgi "running": m5s09:~# ps -Af | grep dis www-data 22859 22857 0 04:19 ? 00:00:01 /opt/ruby/1.8.2/bin/ruby /path/to/dispatch.fcgi and the production.log: -------------------------------------------------- ... Processing Base#index (for 83.97.40.144 at Sat Oct 15 04:30:21 CEST 2005) Parameters: {} ActionController::RoutingError (Recognition failed for ""): /opt/ruby/1.8.2e/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/routing.rb:444 :in `recognition_failed'' /opt/ruby/1.8.2e/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/routing.rb:434 :in `recognize!'' /opt/ruby/1.8.2e/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' /var/www/c.net/myapp/public/dispatch.fcgi:20 /var/www/c.net/myapp/public/dispatch.fcgi:18:in `each_cgi'' /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each'' /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /var/www/c.net/myapp/public/dispatch.fcgi:18 -------------------------------------------------- (even with other actions besides "" the application does not respond, all I get is a 404.) My setup: apache 2.0.54, mod_fastcgi (no idea of version info, but should be pretty recent), ruby 1.8.2 / current stable Rails, ruby/fastcgi 0.8.6, Linux 2.6.12.4 I have no Idea what is going on, could somebody enlighten me? Thanks, Patrick
Did you install fastcgi as a gem or compiled yourself? If the former one, try compiling fastcgi and change require_gem to a plain require in your dispatcher.fcgi. I''ve had similar unexpected problems with the fastcgi gem On 15.Eki.2005, at 05:48, rails-nG6qG2zCiNXF3kJR96AzWl6hYfS7NtTn@public.gmane.org wrote:> Hello out there, > > After restarting the apache server with apachectl graceful, my rails > application stops responding. In the logfile of the application I see > > -------------------------------------------------- > > [Sat Oct 15 04:19:27 CEST 2005] Dispatcher failed to catch: exit > (SystemExit) > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:10:in `exit'' > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:10 > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:10:in `call'' > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each'' > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' > /var/www/c.net/myapp/public/dispatch.fcgi:18 > FCGI process 17607 killed by this error > > -------------------------------------------------- > > > But there is a dispatch.fcgi "running": > > m5s09:~# ps -Af | grep dis > www-data 22859 22857 0 04:19 ? 00:00:01 /opt/ruby/1.8.2/ > bin/ruby /path/to/dispatch.fcgi > > > > and the production.log: > > -------------------------------------------------- > ... > > Processing Base#index (for 83.97.40.144 at Sat Oct 15 04:30:21 CEST > 2005) > Parameters: {} > > > ActionController::RoutingError (Recognition failed for ""): > /opt/ruby/1.8.2e/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/routing.rb:444 > :in `recognition_failed'' > /opt/ruby/1.8.2e/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/routing.rb:434 > :in `recognize!'' > /opt/ruby/1.8.2e/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/ > dispatcher.rb:32:in `dispatch'' > /var/www/c.net/myapp/public/dispatch.fcgi:20 > /var/www/c.net/myapp/public/dispatch.fcgi:18:in `each_cgi'' > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each'' > /opt/ruby/1.8.2e/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' > /var/www/c.net/myapp/public/dispatch.fcgi:18 > > -------------------------------------------------- > (even with other actions besides "" the application does not respond, > all I get is a 404.) > > > My setup: apache 2.0.54, mod_fastcgi (no idea of version info, but > should be pretty recent), ruby 1.8.2 / current stable Rails, ruby/ > fastcgi > 0.8.6, Linux 2.6.12.4 > > > > I have no Idea what is going on, could somebody enlighten me? > > Thanks, > > Patrick > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hello,> Did you install fastcgi as a gem or compiled yourself?I compiled the ruby fastcgi myself.> If the former one, try compiling fastcgi and change require_gem to a > plain require in your dispatcher.fcgi. I''ve had similar unexpected > problems with the fastcgi gemSo this is not the reason.... Too bad :) Currently I use a proxy and forward all request to a lighttpd instance. But there is another problem: redirects always (of course, how should rails know its behind a proxy) use the lighttpd host and port, but that is another story... Thanks for your answer, Patrick
Patrick Gundlach schrieb:> So this is not the reason.... Too bad :) Currently I use a proxy and > forward all request to a lighttpd instance. But there is another > problem: redirects always (of course, how should rails know its behind > a proxy) use the lighttpd host and port, but that is another story...As for this problem, Apache conveniently supports transparently changing "Location:" HTTP headers [1]. Cheers, Paulus [1] http://httpd.apache.org/docs/2.0/mod/mod_proxy.html.en#proxypassreverse
On Oct 16, 2005, at 2:11 AM, Patrick Gundlach wrote:> Hello, > > >> Did you install fastcgi as a gem or compiled yourself? >> > > I compiled the ruby fastcgi myself. > > >> If the former one, try compiling fastcgi and change require_gem to a >> plain require in your dispatcher.fcgi. I''ve had similar unexpected >> problems with the fastcgi gem >> > > So this is not the reason.... Too bad :) Currently I use a proxy and > forward all request to a lighttpd instance. But there is another > problem: redirects always (of course, how should rails know its behind > a proxy) use the lighttpd host and port, but that is another story... > > Thanks for your answer, > > Patrick > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >Patrick- As far as lighty knowing it is behind a proxy.. if you set the ProxyPreserveHost when you ProxyPass and ProxyPassRevers from apache then the headers are sent on unmodified to lighty and it will do the rigth thing with redirects.. Cheers- -Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org 509-577-7732