To all fellow Dreamhosters out there... Sometimes my app mysteriously loses its connection to the database, resulting in a big ugly "Application Error (Rails)" page. Usually refreshing the page makes it go away, but not today. :-( In production.log I see this: MysqlError (Lost connection to MySQL server during query): Any idea why this happens? It''s rather intermittent and random, but I get this a few times a week. I''ve pasted a large section of the call stack below in case it helps. Thanks! Jeff /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:316:in `real_connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:316:in `connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:87:in `initialize'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:37:in `new'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:37:in `mysql_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `send'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection_without_query_cache='' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/query_cache.rb:54:in `connection='' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:106:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in `connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:734:in `columns'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:746:in `column_names'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:759:in `column_methods_hash'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:in `all_attributes_exists?'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:in `all?'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:in `each'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:in `all?'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1016:in `all_attributes_exists?'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:975:in `method_missing'' /app/models/trivia_question.rb:6:in `for_today'' -- Posted via http://www.ruby-forum.com/.
On Apr 30, 2006, at 2:25 PM, Jeff Cohen wrote:> To all fellow Dreamhosters out there... > > Sometimes my app mysteriously loses its connection to the database, > resulting in a big ugly "Application Error (Rails)" page. Usually > refreshing the page makes it go away, but not today. :-( > > In production.log I see this: > > MysqlError (Lost connection to MySQL server during query): > > Any idea why this happens? It''s rather intermittent and random, but I > get this a few times a week.You might ask your hosting provider. Their database might be restarting and causing your connection to disappear. ...or perhaps your application is attempting to run queries that are above their memory allocation limits and it kills the query during the process of fetching data. Good luck tracking down the solution. Cheers, Robby Robby Russell Founder & Executive Director PLANET ARGON, LLC Ruby on Rails Development, Consulting & Hosting www.planetargon.com www.robbyonrails.com +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4968 [fax]
I have been running a Rails app on Dreamhost for a couple of weeks now (just launched official beta Sat) and I have not yet run into any issues like this. If I do notice them I will let you know, though. Frank http://www.lobbr.com -- Posted via http://www.ruby-forum.com/.
i''ve talked to dreamhost a couple of times about this. it happens on occasion, which is really annoying. all the static pages come up fine, but mysql connections die. they told me it''s because another account on the same server is hogging all the bandwidth and that mysql is the first to die in that situation. i would just email them about it. they always replied to me within a day. good luck. -tak. On Apr 30, 2006, at 5:25 PM, Jeff Cohen wrote:> To all fellow Dreamhosters out there... > > Sometimes my app mysteriously loses its connection to the database, > resulting in a big ugly "Application Error (Rails)" page. Usually > refreshing the page makes it go away, but not today. :-( > > In production.log I see this: > > MysqlError (Lost connection to MySQL server during query): > > Any idea why this happens? It''s rather intermittent and random, but I > get this a few times a week. > > I''ve pasted a large section of the call stack below in case it helps. > > Thanks! > Jeff > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/mysql_adapter.rb:316:in > `real_connect'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/mysql_adapter.rb:316:in > `connect'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/mysql_adapter.rb:87:in > `initialize'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/mysql_adapter.rb:37:in > `new'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/mysql_adapter.rb:37:in > `mysql_connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/abstract/ > connection_specification.rb:145:in > `send'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/abstract/ > connection_specification.rb:145:in > `connection_without_query_cache='' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/query_cache.rb:54:in > `connection='' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/abstract/ > connection_specification.rb:106:in > `retrieve_connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/connection_adapters/abstract/ > connection_specification.rb:20:in > `connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:734:in > `columns'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:746:in > `column_names'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:759:in > `column_methods_hash'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:1016:in > `all_attributes_exists?'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:1016:in > `all?'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:1016:in > `each'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:1016:in > `all?'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:1016:in > `all_attributes_exists?'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/ > active_record/base.rb:975:in > `method_missing'' > /app/models/trivia_question.rb:6:in `for_today'' > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails