0

I'm running Rails + Passenger under an Ubuntu AWS's instance. Now I'm trying to deploy with Capistrano, I already did my git repository (and upload it to the server) and my deploy.rb file (with capify .). I already ran cap deploy:setup and cap deploy:check successfully. But now when I try to run cap deploy it fails and I get this error:

* executing `deploy:migrations'
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote ubuntu@ec2.flasheves.com:git/proyecto.git master"
    command finished in 1651ms
  * executing "if [ -d /var/www/proyecto.flasheves.com/shared/cached-copy ]; then cd /var/www/proyecto.flasheves.com/shared/cached-copy && git fetch  origin && git reset  --hard ef3ba849cd27aea4c2f6d372f47c027f495b8a4f && git clean  -d -x -f; else git clone   ubuntu@ec2.flasheves.com:git/proyecto.git /var/www/proyecto.flasheves.com/shared/cached-copy && cd /var/www/proyecto.flasheves.com/shared/cached-copy && git checkout  -b deploy ef3ba849cd27aea4c2f6d372f47c027f495b8a4f; fi"
    servers: ["proyecto.flasheves.com"]
    [proyecto.flasheves.com] executing command
 ** [proyecto.flasheves.com :: out] Initialized empty Git repository in /var/www/proyecto.flasheves.com/shared/cached-copy/.git/
 ** [proyecto.flasheves.com :: err] Host key verification failed.
 ** [proyecto.flasheves.com :: err] fatal: The remote end hung up unexpectedly
    command finished in 355ms
failed: "sh -c 'if [ -d /var/www/proyecto.flasheves.com/shared/cached-copy ]; then cd /var/www/proyecto.flasheves.com/shared/cached-copy && git fetch  origin && git reset  --hard ef3ba849cd27aea4c2f6d372f47c027f495b8a4f && git clean  -d -x -f; else git clone   ubuntu@ec2.flasheves.com:git/proyecto.git /var/www/proyecto.flasheves.com/shared/cached-copy && cd /var/www/proyecto.flasheves.com/shared/cached-copy && git checkout  -b deploy ef3ba849cd27aea4c2f6d372f47c027f495b8a4f; fi'" on proyecto.flasheves.com
Zypher
  • 36,995
  • 5
  • 52
  • 95
eveevans
  • 53
  • 1
  • 6

1 Answers1

2

Remove the entry for ec2.flasheves.com your deploy server's ~/.ssh/known_hosts, it looks like the host key on ec2.flasheves.com changed and ssh is killing the connection since it could be a hijack.

http://www.symantec.com/connect/articles/ssh-host-key-protection

JohnD
  • 142
  • 9
  • Thanks but I found the problem > http://stackoverflow.com/questions/3269578/capistrano-asks-for-password-when-deploying-despite-ssh-keys So > I add `set :ssh_options, {:forward_agent => true}` to my deploy.rb file – eveevans Apr 27 '11 at 15:57