1

I recently switched from Heroku's Bamboo stack to the Cedar one (Rails 3.1.4, Ruby 1.9.2, Thin gem for web server). Since then I keep getting 500 errors such as this, where it seems that the query is not acting right:

207 <13>1 2012-05-06T16:10:51+00:00 d. app web.1 - - ActiveRecord::StatementInvalid (Mysql::Error: : SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1)

It's not an error in the code though because the page eventually renders successfully (ie status 200) when I refresh the page. Sometimes it is 1 refresh, but can get up to 4 refreshes before I get a 200.

I thought it was the database because I was on ClearDB's free plan, but I upgraded to ClearDB's next plan with better I/O performance and it still happens

  1. this never happened when I was on Bamboo
  2. it happens on just about every page that does queries on the DB
  3. it doesn't always happen, but I'd say it happens on at least 1 in 5 pages views
  4. the model/query doesn't matter, the same error occurs (just indicating a different model/fields then the example above)
pnuts
  • 58,317
  • 11
  • 87
  • 139
yellowreign
  • 3,528
  • 8
  • 43
  • 80

1 Answers1

0

Do you get the same errors if you are in console heroku run console ? I've never seen this before. Try upgrading your Mysql gem, which one are you using http://api.rubyonrails.org/classes/ActiveRecord/StatementInvalid.html i think the correct one is mysql2 https://rubygems.org/gems/mysql2

Schneems
  • 14,918
  • 9
  • 57
  • 84