I''m trying to upgrade our production server to rails 2. I''ve already done this on my dev machine (osx) and it worked fine. But now, with everything at the same version, but running in production mode, the production machine - a CentOS5 box - is getting loads of: ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL server during query errors. i"ve looked around but not found any valid reason why this should be happening. the mysql is version 5.0.22. Ruby 1.8.6 rails 2.0.2. Without solving this I guess we are going back to Rails 1.2.6, but the real problem is that it is causing my boss and team to question the entire stability of Rails! I''ve just set the server to run in development mode and it works a treat!!! What is up with that? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matthew Rudy Jacobs
2008-May-15 22:31 UTC
Re: mysql errors in production after upgrading to rails 2
phil wrote:> I''m trying to upgrade our production server to rails 2. I''ve already > done this on my dev machine (osx) and it worked fine. But now, with > everything at the same version, but running in production mode, the > production machine - a CentOS5 box - is getting loads of: > ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL > server during query > errors. > > i"ve looked around but not found any valid reason why this should be > happening. the mysql is version 5.0.22. Ruby 1.8.6 rails 2.0.2. > > Without solving this I guess we are going back to Rails 1.2.6, but the > real problem is that it is causing my boss and team to question the > entire stability of Rails! > > I''ve just set the server to run in development mode and it works a > treat!!! What is up with that?what else have you tried? you tried running in production mode locally? you tried "ruby script/console production" on the box? is this mongrel and apache? or what? is it every query? or just some special long queries? -- 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 -~----------~----~----~----~------~----~------~--~---
Ryan Bigg (Radar)
2008-May-16 00:42 UTC
Re: mysql errors in production after upgrading to rails 2
I think this is more of an ActiveRecord problem, because I was getting the same thing when I was using my IRC bot to log channels into a database through ActiveRecord. It usually happened for no apparent reason, but every few mintues it would drop a query, very annoying. Switched over to sqlite3 which seemed to work fine, but I''m guessing you don''t want to do this. The only thing I can suggest is changing database servers, perhaps to postgres? On Fri, May 16, 2008 at 8:01 AM, Matthew Rudy Jacobs < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > phil wrote: > > I''m trying to upgrade our production server to rails 2. I''ve already > > done this on my dev machine (osx) and it worked fine. But now, with > > everything at the same version, but running in production mode, the > > production machine - a CentOS5 box - is getting loads of: > > ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL > > server during query > > errors. > > > > i"ve looked around but not found any valid reason why this should be > > happening. the mysql is version 5.0.22. Ruby 1.8.6 rails 2.0.2. > > > > Without solving this I guess we are going back to Rails 1.2.6, but the > > real problem is that it is causing my boss and team to question the > > entire stability of Rails! > > > > I''ve just set the server to run in development mode and it works a > > treat!!! What is up with that? > > what else have you tried? > > you tried running in production mode locally? > you tried "ruby script/console production" on the box? > is this mongrel and apache? > or what? > > is it every query? > or just some special long queries? > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Correct, I perhaps did not give enough details. From the console in production mode on that machine it works fine. It is from the mongrel that it doesn''t. It is essentially every query from the mongrel, as far as I can tell. Just trying something now, it is actually failing on occasion, in mongrel, even in development. I''ve never seen these errors before: !\ FAILSAFE /!\ Fri May 16 08:22:19 +0200 2008 Status: 500 Internal Server Error You have a nil object when you didn''t expect it! The error occurred while evaluating nil.all_hashes /usr/local/lib/ ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/mysql_adapter.rb:482:in `select'' And the same query that I get this on: ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL server during query: I can run from the console. So it definitely seem to be how mongrel is connecting to mysql. I am not using the mysql gem (I wasn''t before under 1.2.6 either) I am connecting with the builtin mysql adaptor. On May 16, 12:31 am, Matthew Rudy Jacobs <rails-mailing-l...@andreas- s.net> wrote:> phil wrote: > > I''m trying to upgrade our production server to rails 2. I''ve already > > done this on my dev machine (osx) and it worked fine. But now, with > > everything at the same version, but running in production mode, the > > production machine - a CentOS5 box - is getting loads of: > > ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL > > server during query > > errors. > > > i"ve looked around but not found any valid reason why this should be > > happening. the mysql is version 5.0.22. Ruby 1.8.6 rails 2.0.2. > > > Without solving this I guess we are going back to Rails 1.2.6, but the > > real problem is that it is causing my boss and team to question the > > entire stability of Rails! > > > I''ve just set the server to run in development mode and it works a > > treat!!! What is up with that? > > what else have you tried? > > you tried running in production mode locally? > you tried "ruby script/console production" on the box? > is this mongrel and apache? > or what? > > is it every query? > or just some special long queries? > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg (Radar)
2008-May-16 06:29 UTC
Re: mysql errors in production after upgrading to rails 2
I get the all_hashes error too! nfi what''s causing it, might fire up my irc bot when I get home and try it then. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-16 09:25 UTC
Re: mysql errors in production after upgrading to rails 2
On 16 May 2008, at 07:27, phil wrote:> > And the same query that I get this on: > ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL > server during query: > > I can run from the console. > > So it definitely seem to be how mongrel is connecting to mysql. I am > not using the mysql gem (I wasn''t before under 1.2.6 either) I am > connecting with the builtin mysql adaptor. >The pure ruby mysql stuff is completely obsolete. Give the gem ago. Fred> On May 16, 12:31 am, Matthew Rudy Jacobs <rails-mailing-l...@andreas- > s.net> wrote: >> phil wrote: >>> I''m trying to upgrade our production server to rails 2. I''ve already >>> done this on my dev machine (osx) and it worked fine. But now, with >>> everything at the same version, but running in production mode, the >>> production machine - a CentOS5 box - is getting loads of: >>> ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to >>> MySQL >>> server during query >>> errors. >> >>> i"ve looked around but not found any valid reason why this should be >>> happening. the mysql is version 5.0.22. Ruby 1.8.6 rails 2.0.2. >> >>> Without solving this I guess we are going back to Rails 1.2.6, but >>> the >>> real problem is that it is causing my boss and team to question the >>> entire stability of Rails! >> >>> I''ve just set the server to run in development mode and it works a >>> treat!!! What is up with that? >> >> what else have you tried? >> >> you tried running in production mode locally? >> you tried "ruby script/console production" on the box? >> is this mongrel and apache? >> or what? >> >> is it every query? >> or just some special long queries? >> -- >> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I fixed it by installing the gem using this command: gem install mysql -- --with-mysql-conf=/usr/bin/mysql --with-mysql- lib=/usr/lib/mysql Thanks! On May 16, 11:25 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 16 May 2008, at 07:27, phil wrote: > > > > > And the same query that I get this on: > > ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to MySQL > > server during query: > > > I can run from the console. > > > So it definitely seem to be how mongrel is connecting to mysql. I am > > not using the mysql gem (I wasn''t before under 1.2.6 either) I am > > connecting with the builtin mysql adaptor. > > The pure ruby mysql stuff is completely obsolete. Give the gem ago. > > Fred > > > On May 16, 12:31 am, Matthew Rudy Jacobs <rails-mailing-l...@andreas- > > s.net> wrote: > >> phil wrote: > >>> I''m trying to upgrade our production server to rails 2. I''ve already > >>> done this on my dev machine (osx) and it worked fine. But now, with > >>> everything at the same version, but running in production mode, the > >>> production machine - a CentOS5 box - is getting loads of: > >>> ActiveRecord::StatementInvalid (Mysql::Error: Lost connection to > >>> MySQL > >>> server during query > >>> errors. > > >>> i"ve looked around but not found any valid reason why this should be > >>> happening. the mysql is version 5.0.22. Ruby 1.8.6 rails 2.0.2. > > >>> Without solving this I guess we are going back to Rails 1.2.6, but > >>> the > >>> real problem is that it is causing my boss and team to question the > >>> entire stability of Rails! > > >>> I''ve just set the server to run in development mode and it works a > >>> treat!!! What is up with that? > > >> what else have you tried? > > >> you tried running in production mode locally? > >> you tried "ruby script/console production" on the box? > >> is this mongrel and apache? > >> or what? > > >> is it every query? > >> or just some special long queries? > >> -- > >> 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---