I know this question gets asked a lot but I can’t seem to find the
answer when I search through the mailing list. First off here’s my set
up.
Cent OS 4.3
Apache 2.0
Fast CGI 2.4.0
Rails 1.1
Mysql 5.0
The app starts up fine, but every morning it refuses to start and gives
me the dreaded Application error untill I reload Apache. I thought my
database was timing out so I added this line to my environment.rb
ActiveRecord::Base.verification_timeout = 3000
My database is set to drop inactive connections after 2 hours, so my
database should keep the connection open. I can watch the processes on
mysql and the rails connection is dropped after about 10 minutes. If I
try to access the web page after this timeout, the app re-connects
perfectly. This is why I’m completely confused about why the app
refuses to start each morning. Here is the related lines from my
production log.
Errno::EPIPE (Broken pipe):
/usr/lib/ruby/1.8/mysql.rb:1042:in flush' /usr/lib/ruby/1.8/mysql.rb:1042:in
write’
/usr/lib/ruby/1.8/mysql.rb:462:in write' /usr/lib/ruby/1.8/mysql.rb:436:in
command’
/usr/lib/ruby/1.8/mysql.rb:307:in stat' /vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:147:in
active?’
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:85:in
verify!' /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:99:in
verify_active_connections!’
/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:98:in
verify_active_connections!' /vendor/rails/railties/lib/dispatcher.rb:70:in
prepare_application’
/vendor/rails/railties/lib/dispatcher.rb:37:in dispatch' /vendor/rails/railties/lib/fcgi_handler.rb:150:in
process_request’
/vendor/rails/railties/lib/fcgi_handler.rb:54:in process!' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:600:in
each_cgi’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/./fcgi.rb:597:in each_cgi' /vendor/rails/railties/lib/fcgi_handler.rb:53:in
process!’
/vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!’
/var/www/my_app/htdocs/mailing_lists/public/dispatch.fcgi:24
Charlie B.
Programmer
Castle Branch Inc.