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

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

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