I''m running Ruby on Rails on Fedora Core 4 with lighttpd and fastcgi. I also used the login generator (don''t know if relevant). I have the following problem: At day time I work on the server and create/modify ruby files on the server, all pages work fine. Than the next day I want to open de server I get the error at the end of this message (on all pages, including non protected). If I restart lighttpd everything works again. Any ideas on how to fix this? This happens every day... Thanks, Stephan ======================================================================================================================== NoMethodError in Test#test You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] RAILS_ROOT: /home/stephan/members/public/../config/.. Application Trace | Framework Trace | Full Trace /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/mysql_adapter.rb:322:in `connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/mysql_adapter.rb:174:in `reconnect!'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in `connection'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/benchmarking.rb:85:in `active_record_runtime'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/benchmarking.rb:72:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/rescue.rb:82:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/base.rb:369:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/session_management.rb:116:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:141:in `process_request'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:53:in `process!'' /usr/lib/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/lib/site_ruby/1.8/fcgi.rb:117:in `session'' /usr/lib/site_ruby/1.8/fcgi.rb:104:in `each_request'' /usr/lib/site_ruby/1.8/fcgi.rb:36:in `each'' /usr/lib/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:52:in `process!'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:22:in `process!'' /home/stephan/members/public/dispatch.fcgi:24 /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/mysql_adapter.rb:322:in `connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/mysql_adapter.rb:174:in `reconnect!'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in `connection'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/benchmarking.rb:85:in `active_record_runtime'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/benchmarking.rb:72:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/rescue.rb:82:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/base.rb:369:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/session_management.rb:116:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:141:in `process_request'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:53:in `process!'' /usr/lib/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/lib/site_ruby/1.8/fcgi.rb:117:in `session'' /usr/lib/site_ruby/1.8/fcgi.rb:104:in `each_request'' /usr/lib/site_ruby/1.8/fcgi.rb:36:in `each'' /usr/lib/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:52:in `process!'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:22:in `process!'' /home/stephan/members/public/dispatch.fcgi:24 /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/mysql_adapter.rb:322:in `connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/mysql_adapter.rb:174:in `reconnect!'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in `connection'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/benchmarking.rb:85:in `active_record_runtime'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/benchmarking.rb:72:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/rescue.rb:82:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/base.rb:369:in `process_without_session_management_support'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.1/lib/action_controller/session_management.rb:116:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/dispatcher.rb:38:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:141:in `process_request'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:53:in `process!'' /usr/lib/site_ruby/1.8/fcgi.rb:600:in `each_cgi'' /usr/lib/site_ruby/1.8/fcgi.rb:117:in `session'' /usr/lib/site_ruby/1.8/fcgi.rb:104:in `each_request'' /usr/lib/site_ruby/1.8/fcgi.rb:36:in `each'' /usr/lib/site_ruby/1.8/fcgi.rb:597:in `each_cgi'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:52:in `process!'' /usr/lib/ruby/gems/1.8/gems/rails-0.14.4/lib/fcgi_handler.rb:22:in `process!'' /home/stephan/members/public/dispatch.fcgi:24 Request Parameters: None Show session dump :return_to: /teamuser/list flash: !map:ActionController::Flash::FlashHash {} Response Headers: {"Status"=>"200 OK", "cookie"=>[], "Cache-Control"=>"no-cache"} ======================================================================================================================== _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
ara.t.howard-32lpuo7BZBA@public.gmane.org
2005-Dec-12 19:15 UTC
Re: Rails crashes over night?
On Mon, 12 Dec 2005, Stephan van Erp wrote:> I''m running Ruby on Rails on Fedora Core 4 with lighttpd and fastcgi. I also > used the login generator (don''t know if relevant). I have the following > problem: At day time I work on the server and create/modify ruby files on > the server, all pages work fine. Than the next day I want to open de server > I get the error at the end of this message (on all pages, including non > protected). > > If I restart lighttpd everything works again. Any ideas on how to fix this? > This happens every day...switch to postgresql? seriously - this alone might fix. we have alot of issues here (noaa) with mysql dropping connections for 24/7 type applications. i''ve __never__ seen it happen with postgres, however. regards. -a -- ==============================================================================| ara [dot] t [dot] howard [at] noaa [dot] gov | all happiness comes from the desire for others to be happy. all misery | comes from the desire for oneself to be happy. | -- bodhicaryavatara ============================================================================== _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Stephan van Erp schrieb:> If I restart lighttpd everything works again. Any ideas on how to fix > this? This happens every day...I had such behaviour years ago in a piece of java server I''ve written. It was a timeout issue on the sql server (mysql) side. Did you hold any connections to speed up something? My problem was, that my open connection wasn''t close propably and the mysql server disconnected. So the next query produced a error like yours (of course, the exception was a bit different as it was thrown out of my java system). I''m a little bit suprised because I haven''t a huge experience with RoR yet and my guess was, that AR handle the connection prober (?!). HTH, -- Daniel Völkerts Protected by Anti Pesto.
AFAIK if connection to MySQL database is dropped then mysql-connector JDBC driver tries to reconnect several times to server. Only then it drops exception. I would be really cool to see such functionality in ActiveRecord (or mysql driver??) because this problem with connection timeout very annoying me as well. On 12/12/05, Daniel Völkerts <d.voelkerts-Mmb7MZpHnFY@public.gmane.org> wrote:> > Stephan van Erp schrieb: > > > If I restart lighttpd everything works again. Any ideas on how to fix > > this? This happens every day... > > I had such behaviour years ago in a piece of java server I''ve written. > It was a timeout issue on the sql server (mysql) side. Did you hold any > connections to speed up something? > > My problem was, that my open connection wasn''t close propably and the > mysql server disconnected. So the next query produced a error like yours > (of course, the exception was a bit different as it was thrown out of my > java system). > > I''m a little bit suprised because I haven''t a huge experience with RoR > yet and my guess was, that AR handle the connection prober (?!). > > HTH, > -- > Daniel Völkerts > Protected by Anti Pesto. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- anatol (http://pomozov.info) _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Anatol Pomozov schrieb:> AFAIK if connection to MySQL database is dropped then mysql-connector > JDBC driver tries to reconnect several times to server. Only then it > drops exception. > > I would be really cool to see such functionality in ActiveRecord (or > mysql driver??) because this problem with connection timeout very > annoying me as well.Yes, you have to pass an argument to the JDBC driver . In which case this affects the ruby mysql driver as well was not tested by me. g, -- Daniel Völkerts Protected by Anti Pesto.
Possibly Parallel Threads
- rescue_action_in_public useless to capture low level errors
- ActiveRecord::StatementInvalid error after app has been running for a while
- Problem with lighttpd on mac
- Application stops working over night: (Errno::EPIPE (Broken pipe)) is the error
- running lighttpd -> Recognition failed for "/"