# Daily rails application error

**URL:** <https://www.ruby-forum.com/t/daily-rails-application-error/77513>\
**Category:** Rails\
**Created:** [November 28, 2006, 4:00pm UTC](https://www.ruby-forum.com/t/daily-rails-application-error/77513 "2006-11-28T16:00:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [November 28, 2006, 4:00pm UTC](https://www.ruby-forum.com/t/daily-rails-application-error/77513/1 "2006-11-28T16:00:56Z")

</div>

hi, all…

each day, as far as i can tell, i run into this problem the first thing  
in the morning…

when i got to my site, i get a rails application error…

i check my logs, and i get this:

Errno::ENOENT (No such file or directory - /var/lib/mysql/mysql.sock):  
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active\_record/vendor/mysql.rb:104:in  
`initialize’

the weird thing is… the act of checking my logs makes my site suddenly  
working…

my database.yml looks like this…

production:  
adapter: mysql  
database: xxx  
username: xxx  
password: xxx  
host: localhost  
socket: /var/lib/mysql/mysql.sock

anyone have any ideas?

thanks!

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [November 28, 2006, 6:24pm UTC](https://www.ruby-forum.com/t/daily-rails-application-error/77513/2 "2006-11-28T18:24:09Z")

</div>

If you check the mongrel mailing lists then you should see some posts  
similar to this. Basically if the MySQL connection timeout value is  
smaller than the “check timeout” value in rails then the DB server  
closes the connection and ActiveREcord doesn’t check before using the  
stale connection.

Setting the timeout to be smaller in rails than the DB should fix it.  
(How you do that I can’t remember).

RJ

---

<div class="post-metadata">

**Author:** ![spacechurro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/d2c977/32.png) [@spacechurro](https://www.ruby-forum.com/u/spacechurro)\
**Post date:** [November 28, 2006, 7:29pm UTC](https://www.ruby-forum.com/t/daily-rails-application-error/77513/3 "2006-11-28T19:29:09Z")

</div>

RJ wrote:

> If you check the mongrel mailing lists then you should see some posts  
> similar to this. Basically if the MySQL connection timeout value is

got it… i will go over there and check it out…

thanks!
