views:

33

answers:

2

Hello all,

I am making use of Redmine a web based software tracking tool, its perfect for my needs. However, I keep coming across this error in my production.log.

ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away: SELECT * FROM issue_relations WHERE (issue_relations.issue_from_id = 6) ): app/models/issue.rb:234:in after_save'
app/controllers/issues_controller.rb:196:in
edit'

When I add a ticket or update a ticket I get the below error and the above is recorded in my logs. It returns this via the browser after about 15 seconds. I have tried it several times, other areas of the app work fine.

Internal error

An error occurred on the page you were trying to access. If you continue to experience problems please contact your redMine administrator for assistance.

Back

I am using Ruby on Rails 2.3.8 on Phusion Passenger. Gem version 1.3.7. Active record 2.3.8. mysql (2.8.1 ruby x86-mingw32 x86-mswin32, 2.7.3 mswin32).

I am not a Ruby on Rails programmer and I am at loss on what else I can do to narrow this down. I had quick Google and found that as of rails 2.3 there is an option to reconnect so in my database.yml file I placed a reconnect true, but this didn't help!

Thanks all for any help

A: 

Try putting the code from this Gist in a file in {rails application}/config/initializers/active_record_connections.rb: http://gist.github.com/238999

That said, this should probably not be happening in the first place - and if requests are taking 15 seconds to load, that also suggests that something else is going on. Can you share what appears in the logs before this error?

Nick Ragaz
A: 

The list of usual suspects: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html (all checkable on the MySQL-side of things).

Wrikken