Denis Haskin
2011-Oct-04 13:41 UTC
MySQL ActiveRecord::StatementInvalid on insert w/ no detail?
Rails 3.1.0.rc8 I''m getting strange & unfortunately not consistently reproducible errors. Because it happens more frequently w/ multiple simultaneous clients, I suspect possibly some kind of transaction/locking issue, but it''s unclear. Every once in a while an INSERT will fail, and there''s no MySQL error message given: Mysql::Error: : INSERT INTO `carts` (`created_at`, `order_id`, `updated_at`, `user_id`) VALUES (?, ?, ?, ?) vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0.rc8/lib/ active_record/connection_adapters/mysql_adapter.rb:860:in `execute'' (typically after "Error:" there would be the text of the MySQL error: note it''s blank) The parameter list is valid, and usually contains only the cerated_at and updated_id columns; user_id and order_id are null (which is expected). I expect it''s a problem with this app that I''ve inherited (in fact, it looks like maybe it''s doing this insert twice in the context of one client request), but it''s been hard to pin down since it''s not consistently reproducible and there''s no MySQL error message. Ring any bells for anyone? Thanks, dwh -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Oct-06 11:10 UTC
Re: MySQL ActiveRecord::StatementInvalid on insert w/ no detail?
On Oct 4, 2:41 pm, Denis Haskin <de...-QjqrIaraUJHsRQ7aLHQQZ6xOck334EZe@public.gmane.org> wrote:> Rails 3.1.0.rc8 > > I''m getting strange & unfortunately not consistently reproducible > errors. Because it happens more frequently w/ multiple simultaneous > clients, I suspect possibly some kind of transaction/locking issue, > but it''s unclear. > > Every once in a while an INSERT will fail, and there''s no MySQL error > message given: > > Mysql::Error: : INSERT INTO `carts` (`created_at`, `order_id`, > `updated_at`, `user_id`) VALUES (?, ?, ?, ?) > vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0.rc8/lib/ > active_record/connection_adapters/mysql_adapter.rb:860:in `execute'' > > (typically after "Error:" there would be the text of the MySQL error: > note it''s blank) > > The parameter list is valid, and usually contains only the cerated_at > and updated_id columns; user_id and order_id are null (which is > expected). > > I expect it''s a problem with this app that I''ve inherited (in fact, it > looks like maybe it''s doing this insert twice in the context of one > client request), but it''s been hard to pin down since it''s not > consistently reproducible and there''s no MySQL error message. >Ugh. Anything in mysql''s various log files? Fred> Ring any bells for anyone? > > Thanks, > > dwh-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Denis Haskin
2011-Oct-06 11:58 UTC
Re: Re: MySQL ActiveRecord::StatementInvalid on insert w/ no detail?
No, although I realize I should enable the general query log to see if I can catch it there. For what it''s worth, I did drop in the mysql2 gem yesterday and so far the error has not occurred again. However, since it''s not consistently reproducible, that doesn''t necessarily make me more confident that this issue''s been addressed. dwh On Thu, Oct 6, 2011 at 7:10 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Oct 4, 2:41 pm, Denis Haskin <de...-QjqrIaraUJHsRQ7aLHQQZ6xOck334EZe@public.gmane.org> wrote: > > Rails 3.1.0.rc8 > > > > I''m getting strange & unfortunately not consistently reproducible > > errors. Because it happens more frequently w/ multiple simultaneous > > clients, I suspect possibly some kind of transaction/locking issue, > > but it''s unclear. > > > > Every once in a while an INSERT will fail, and there''s no MySQL error > > message given: > > > > Mysql::Error: : INSERT INTO `carts` (`created_at`, `order_id`, > > `updated_at`, `user_id`) VALUES (?, ?, ?, ?) > > vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.0.rc8/lib/ > > active_record/connection_adapters/mysql_adapter.rb:860:in `execute'' > > > > (typically after "Error:" there would be the text of the MySQL error: > > note it''s blank) > > > > The parameter list is valid, and usually contains only the cerated_at > > and updated_id columns; user_id and order_id are null (which is > > expected). > > > > I expect it''s a problem with this app that I''ve inherited (in fact, it > > looks like maybe it''s doing this insert twice in the context of one > > client request), but it''s been hard to pin down since it''s not > > consistently reproducible and there''s no MySQL error message. > > > > Ugh. Anything in mysql''s various log files? > > Fred > > Ring any bells for anyone? > > > > Thanks, > > > > dwh > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.