Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capistrano cannot deploy code, because Net::SSH::AuthenticationFailed: Authentication failed

We have a Rails app that is running on Amazon AWS. We're pushing there a new code almost every day for a few months in a row.

Today, when I tried to deploy a new code there, I was given this error message:

  * 2014-02-16 13:09:51 executing `deploy'
  * 2014-02-16 13:09:51 executing `deploy:update'
 ** transaction: start
  * 2014-02-16 13:09:51 executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote [email protected]:my_bitbucket_name/project_name.git master"
    command finished in 2909ms
  * executing "if [ -d /home/deployer/project_name/shared/cached-copy ]; then cd /home/deployer/project_name/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 16958dfcee27dd9c33855ecece0013428e2c57c8 && git clean -q -d -x -f; else git clone -q -b master [email protected]:rdudacz/looky.co.git /home/deployer/looky/shared/cached-copy && cd /home/deployer/project_name/shared/cached-copy && git checkout -q -b deploy 16958dfcee27dd9c33855ecece0013428e2c57c8; fi"
    servers: ["IP"]
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/deployer/project_name/releases/20140216120957; true"
    servers: ["IP"]
 ** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: IP (Net::SSH::AuthenticationFailed: Authentication failed for user deployer@IP)
connection failed for: IP (Net::SSH::AuthenticationFailed: Authentication failed for user deployer@IP)

What happened here? Where to start with looking for the issue?

like image 215
user984621 Avatar asked Feb 16 '14 12:02

user984621


1 Answers

The problem is the gem

net-ssh

The last version (2.8.0) causes this issue. The solution is to uninstall it:

gem uninstall net-ssh -v 2.8.0

and then to add to the Gemfile its previous version:

gem "net-ssh", "~> 2.7.0"

That's it.

like image 54
user984621 Avatar answered Sep 21 '22 15:09

user984621