Welcome Guest | Login

Capistrano 2.2 / rake db:migrate failure

I've been working on setting up Cap to do my deployments and it's failing.  So I've tracked at least one problem down to the fact that the rake fails.

I see this:
 * executing "cd /home/{user_name}/{app_name}/releases/20080325163731; rake RAILS_ENV=production  db:migrate"
  servers: ["{server}"]
  [{server}] executing command
** [out :: {server}] (in /home/{user_name}/{app_name}/releases/20080325163731)
** [out :: {server}] rake aborted!
** [out :: {server}] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
** [out :: {server}]
** [out :: {server}] (See full trace by running task with --trace)
  command finished
My production database.yaml looks like so:

   production:
    adapter: mysql
    database: {account}_{app_name}db
    user: {account}_user
    password: pw
    # host: localhost
    # socket: /var/lib/mysqlsock/mysql.sock
    timeout: 5000
I feel like I've tried every permutation possible for the prod db set-up and yet the cap deploy:cold still fails in the rake section as does running:

rake RAILS_ENV=production  db:migrate --trace
When I try and run it from:
/home/{user_name}/{app_name}/current
       (in /home/{user_name}/{app_name}/releases/20080325163731)
      ** Invoke db:migrate (first_time)
      ** Invoke environment (first_time)
      ** Execute environment
      ** Execute db:migrate
      rake aborted!
      Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
I feel like this has to be something easy, but at this point I'm just at a loss.

My hope is that once I can get this straightened out I'll be able to get to the bottom of the "Application error Rails application failed to start properly" error I'm getting ...

Any pointers would be excellent.

-Tom

2008-03-25 11:57 AM

Could you try after adding the following line in your database.yml file?
--------
socket: /tmp/mysql.sock

2008-03-25 12:44 PM

Santhi,

Changed.

Now I'm seeing:

       [~/{app_name}/current]$ rake RAILS_ENV=production  db:migrate --trace
      (in /home/{account}/{app_name}/releases/20080325163731)
      ** Invoke db:migrate (first_time)
      ** Invoke environment (first_time)
      ** Execute environment
      ** Execute db:migrate
      rake aborted!
      Access denied for user 'root'@'localhost' (using password: YES)
I checked and rechecked the database.yml user and pass, but could this mean there is still a problem there?

Thanks for your quick reply.

-Tom

2008-03-25 12:54 PM

Hi Comptom,

The issue was with your database.yml file. In place of username, user was written which was causing the issue. I have fixed the issue.

Try rake db:migrate now.

2008-03-25 02:55 PM

Man, I know it was something simple.  Just deployed correctly.

Thanks again, you folks rock!

Tom

2008-03-25 03:42 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.