Random 500 Internal Server Error - ActiveRecord::StatementInvalid Mysql::Error
Added by Filip Procházka over 12 years ago
Hi guys,
I've freshly installed Redmine 2.0.3 with mysql on Thin and nginx
$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
$ gem --version
1.8.24
$ thin --version
thin 1.3.1 codename Triple Espresso
$ bundle
Using rake (0.9.2.2)
Using i18n (0.6.0)
Using multi_json (1.3.6)
Using activesupport (3.2.6)
Using builder (3.0.0)
Using activemodel (3.2.6)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.1)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.6)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.6)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.6)
Using activeresource (3.2.6)
Using coderay (1.0.7)
Using fastercsv (1.5.5)
Using json (1.7.3)
Using mysql (2.8.1)
Using net-ldap (0.3.1)
Using pg (0.14.0)
Using bundler (1.1.4)
Using rack-ssl (1.3.2)
Using rdoc (3.12)
Using thor (0.15.3)
Using railties (3.2.6)
Using rails (3.2.6)
Using prototype-rails (3.2.1)
Using ruby-openid (2.1.8)
Using rack-openid (1.3.1)
Using rmagick (2.13.1)
Using sqlite3 (1.3.6)
And it completely randomly throws 500. Few examples
Started PUT "/issues/4" for 127.0.0.1 at Pá čen 29 16:38:47 +0200 2012
Processing by IssuesController#update as HTML
Parameters: {"last_journal_id"=>"", "id"=>"4", "notes"=>"", "authenticity_token"=>"...", "commit"=>"Potvrdit", "attachments"=>{"1"=>{"descrip
tion"=>""}}, "issue"=>{"tracker_id"=>"2", "description"=>"", "due_date"=>"", "parent_issue_id"=>"", "subject"=>"...", "status_id"=>"1", "lock_version"=>"0", "
project_id"=>"5", "start_date"=>"2012-06-18", "done_ratio"=>"0", "is_private"=>"0", "assigned_to_id"=>"", "category_id"=>"", "priority_id"=>"4", "estimated_hours"=>""}, "utf8"=>"✓"}
Completed 500 Internal Server Error in 624ms
ActiveRecord::StatementInvalid (Mysql::Error: : INSERT INTO `journal_details` (`journal_id`, `old_value`, `prop_key`, `property`, `value`) VALUES (?, ?, ?, ?, ?)):
app/models/journal.rb:47:in `save'
app/models/issue.rb:1073:in `create_journal'
app/models/issue.rb:731:in `save_issue_with_child_records'
app/models/issue.rb:718:in `save_issue_with_child_records'
app/controllers/issues_controller.rb:182:in `update'
Started POST "/watchers/watch?object_id=14&object_type=issue" for 127.0.0.1 at Pá čen 29 16:35:18 +0200 2012
Processing by WatchersController#watch as JS
Parameters: {"object_type"=>"issue", "authenticity_token"=>"...", "amp"=>nil, "object_id"=>"14"}
Completed 500 Internal Server Error in 51ms
ActiveRecord::StatementInvalid (Mysql::Error: : INSERT INTO `watchers` (`user_id`, `watchable_id`, `watchable_type`) VALUES (?, ?, ?)):
lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb:43:in `add_watcher'
lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb:54:in `set_watcher'
app/controllers/watchers_controller.rb:117:in `set_watcher'
app/controllers/watchers_controller.rb:27:in `watch'
Started POST "/projects/domestic-cz/issues" for 127.0.0.1 at Pá čen 29 16:32:53 +0200 2012
Processing by IssuesController#create as HTML
Parameters: {"authenticity_token"=>"...", "project_id"=>"domestic-cz", "commit"=>"Vytvořit", "attachments"=>{"1"=>{"description"=>""}}, "issu
e"=>{"tracker_id"=>"2", "description"=>"", "due_date"=>"2012-07-02", "watcher_user_ids"=>["4"], "parent_issue_id"=>"", "subject"=>"...", "status_id"=>"1", "s
tart_date"=>"2012-06-25", "done_ratio"=>"0", "is_private"=>"0", "assigned_to_id"=>"1", "priority_id"=>"5", "estimated_hours"=>""}, "utf8"=>"✓"}
Completed 500 Internal Server Error in 819ms
ActiveRecord::StatementInvalid (Mysql::Error: : INSERT INTO `issues` (`assigned_to_id`, `author_id`, `category_id`, `created_on`, `description`, `done_ratio`, `due_date`, `estimated_ho
urs`, `fixed_version_id`, `is_private`, `lft`, `lock_version`, `parent_id`, `priority_id`, `project_id`, `rgt`, `root_id`, `start_date`, `status_id`, `subject`, `tracker_id`, `updated_
on`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)):
app/controllers/issues_controller.rb:148:in `create'
And there is more, I just hit F5 once, sometimes more and it just continues to work. I have no idea what to do or search for. Thanks for any advice.