My app consists of receiving emails with image attachments from its users so I have been employing the MMS2R gem and Fetcher. Every 60 seconds the app goes to the email server to fetch emails. Under Rails 2.1.1 things worked fine - when I received an email, the email was fetched, parsed and saved to the database. However I needed to upgrade to Rails 2.2.2 for unrelated reasons and now I get the following error in my log when the app tries to save to the database. Emailpic is just the model in the database. "Emailpic Columns (0.0ms) Mysql::Error: MySQL server has gone away: SHOW FIELDS FROM `emailpics`" Does anyone know what changed between 2.1.1 and 2.2.2 to cause this to happen? -- 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 -~----------~----~----~----~------~----~------~--~---
Adeel Ahmad
2009-Mar-03 04:32 UTC
Re: Rails 2.2.2 - Mysql::Error: MySQL server has gone away
This was solved by the fine guys at Engine Yard. I added the following lines to my environmemnt.rb: ActiveRecord::Base.allow_concurrency = true ActiveRecord::Base.verification_timeout = 10 And just before I do a fetch I have this line: Emailpic.verify_active_connections! -- 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 -~----------~----~----~----~------~----~------~--~---
Tung Nguyen
2009-Mar-09 04:57 UTC
Re: Rails 2.2.2 - Mysql::Error: MySQL server has gone away
Adeel, This worked for you with activerecord 2.2.2 ? The Engineyard guys suggested the same thing to me, but we''re getting this deprecation working.. DEPRECATION WARNING: ActiveRecord::Base.verification_timeout= has been deprecated and no longer has any effect. Please remove all references to verification_timeout=.. (called from verification_timeout= at /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:106) Tung Adeel Ahmad wrote:> This was solved by the fine guys at Engine Yard. > I added the following lines to my environmemnt.rb: > > ActiveRecord::Base.allow_concurrency = true > ActiveRecord::Base.verification_timeout = 10 > > And just before I do a fetch I have this line: > > Emailpic.verify_active_connections!-- 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 -~----------~----~----~----~------~----~------~--~---
Tung Nguyen
2009-Mar-09 05:24 UTC
Re: Rails 2.2.2 - Mysql::Error: MySQL server has gone away
ic, youre doing a Emailpic.verify_active_connections! So, thats what is probably reestablishing the connection.... -- 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 -~----------~----~----~----~------~----~------~--~---
Tung Nguyen
2009-Mar-09 05:25 UTC
Re: Rails 2.2.2 - Mysql::Error: MySQL server has gone away
I just wonder if there''s a more automated way of doing this, instead of manually have to check the connection every time we do a mysql query... -- 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 -~----------~----~----~----~------~----~------~--~---
Andrew Roth
2009-Mar-21 21:21 UTC
Re: Rails 2.2.2 - Mysql::Error: MySQL server has gone away
I''m getting these MySQL server has gone away on SHOW FIELDS too. I''ve spent a fair bit of effort trying to figure out what''s going on, with no success. All we''ve determined is it seems to have a higher chance of happening after some idle time. I can usually make it happen by hitting an ajax page with many requests at once (just spamming the ajax). Any ideas welcome. On Mar 2, 10:56 pm, Adeel Ahmad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> My app consists of receiving emails with image attachments from its > users so I have been employing the MMS2R gem and Fetcher. Every 60 > seconds the app goes to the email server to fetch emails. > > Under Rails 2.1.1 things worked fine - when I received an email, the > email was fetched, parsed and saved to the database. > > However I needed to upgrade to Rails 2.2.2 for unrelated reasons and now > I get the following error in my log when the app tries to save to the > database. Emailpic is just the model in the database. > > "Emailpic Columns (0.0ms) Mysql::Error: MySQL server has gone away: > SHOW FIELDS FROM `emailpics`" > > Does anyone know what changed between 2.1.1 and 2.2.2 to cause this to > happen? > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Roth
2009-Mar-26 01:31 UTC
Re: Rails 2.2.2 - Mysql::Error: MySQL server has gone away
I''ve had some success with the mysql_retry_lost_connection gem. On Mar 21, 5:21 pm, Andrew Roth <andrewr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m getting these MySQL server has gone away on SHOW FIELDS too. I''ve > spent a fair bit of effort trying to figure out what''s going on, with > no success. All we''ve determined is it seems to have a higher chance > of happening after some idle time. I can usually make it happen by > hitting an ajax page with many requests at once (just spamming the > ajax). Any ideas welcome. > > On Mar 2, 10:56 pm, Adeel Ahmad <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > My app consists of receiving emails with image attachments from its > > users so I have been employing the MMS2R gem and Fetcher. Every 60 > > seconds the app goes to the email server to fetch emails. > > > Under Rails 2.1.1 things worked fine - when I received an email, the > > email was fetched, parsed and saved to the database. > > > However I needed to upgrade to Rails 2.2.2 for unrelated reasons and now > > I get the following error in my log when the app tries to save to the > > database. Emailpic is just the model in the database. > > > "Emailpic Columns (0.0ms) Mysql::Error: MySQL server has gone away: > > SHOW FIELDS FROM `emailpics`" > > > Does anyone know what changed between 2.1.1 and 2.2.2 to cause this to > > happen? > > -- > > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---