minka
2006-Nov-28 22:08 UTC
Lost connection to MySQL server during query: SHOW FIELDS FROM orders
I am getting an intermittent error, the one above. I have not gone into production, i am still in development. I seem to lose connection to the MySQL server. If I do a refresh it comes back and all is fine. I have not been able to duplicate this. It simply occurs perhaps 1 out of ten times. Is this a characteristic of the development mode? I am using WEBrick. thanks, minka. Here is the error: ActiveRecord::StatementInvalid in ProductsController#save_order Mysql::Error: Lost connection to MySQL server during query: SHOW FIELDS FROM orders Here is a partial trace: RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:184:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:292:in `columns'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:696:in `columns'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1969:in `attributes_from_column_definition'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1351:in `initialize_without_callbacks'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:236:in `initialize'' app/controllers/products_controller.rb:87:in `save_order'' -e:4 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
cremes.devlist-ee4meeAH724@public.gmane.org
2006-Nov-28 22:29 UTC
Re: Lost connection to MySQL server during query: SHOW FIELDS FROM orders
On Nov 28, 2006, at 4:08 PM, minka wrote:> > I am getting an intermittent error, the one above. I have not gone > into > production, i am still in development. I seem to lose connection to > the > MySQL server. If I do a refresh it comes back and all is fine. > > I have not been able to duplicate this. It simply occurs perhaps 1 out > of ten times. Is this a characteristic of the development mode? I am > using WEBrick. > thanks, minka. > > Here is the error: > ActiveRecord::StatementInvalid in ProductsController#save_order > Mysql::Error: Lost connection to MySQL server during query: SHOW > FIELDS > FROM ordersIt might be related to using the ruby mysql bindings instead of the native C bindings for your platform. Install the ''mysql'' gem. It will build a native code extension callable from ruby which eliminates most mysql connection drops. After installing the gem, make sure it is active by doing the following (swiped this from a post earlier this week!): cremes$ irb irb(main):001:0> require ''rubygems'' => true irb(main):002:0> require ''mysql'' => false irb(main):003:0> puts Mysql::VERSION 20700 => nil cr --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jean Nibee
2006-Nov-29 05:32 UTC
Re: Lost connection to MySQL server during query: SHOW FIELD
Chuck Remes wrote:> On Nov 28, 2006, at 4:08 PM, minka wrote: > >> thanks, minka. >> >> Here is the error: >> ActiveRecord::StatementInvalid in ProductsController#save_order >> Mysql::Error: Lost connection to MySQL server during query: SHOW >> FIELDS >> FROM ordersTry this. http://www.afeared.org/?comment,343 It fixed the problem for me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chad
2006-Nov-29 10:15 UTC
Re: Lost connection to MySQL server during query: SHOW FIELDS FROM orders
If all else fails, try pre-loading your models if you are storing whole
objects in the session. I was having what appeared to be intermittent
db issues but the problem was the serialization of objects to the
session.
class ApplicationController < ActionController::Base
model :order, :member, :cart
end
Good luck,
Chad
On Nov 28, 2:08 pm, "minka"
<mmi...-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
wrote:> I am getting an intermittent error, the one above. I have not gone into
> production, i am still in development. I seem to lose connection to the
> MySQL server. If I do a refresh it comes back and all is fine.
>
> I have not been able to duplicate this. It simply occurs perhaps 1 out
> of ten times. Is this a characteristic of the development mode? I am
> using WEBrick.
> thanks, minka.
>
> Here is the error:
> ActiveRecord::StatementInvalid in ProductsController#save_order
> Mysql::Error: Lost connection to MySQL server during query: SHOW FIELDS
> FROM orders
>
> Here is a partial trace:
> RAILS_ROOT: script/../config/..
> Application Trace | Framework Trace | Full Trace
>
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in
> `log''
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:184:in
> `execute''
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/mysql_adapter.rb:292:in
> `columns''
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:696:in
> `columns''
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1969:in
> `attributes_from_column_definition''
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1351:in
> `initialize_without_callbacks''
>
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/callbacks.rb:236:in
> `initialize''
> app/controllers/products_controller.rb:87:in `save_order''
> -e:4
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---