13

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?

5 Answers 5

23

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I am Using net-ssh 2.7.0 and passwordless login is working fine, but still getting Net::SSH::AuthenticationFailed
Thanks you! It seems that 2.9 also has an issue where it can't connect to the server via port 22, while using ssh works fine. Reverting to 2.7 works!
I'm using ruby-2.1.2p95, after installing net-ssh 2.7.0, I got this error: **/ruby-2.1.2/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'net-ssh' (>= 2.8.0) - did find: [net-ssh-2.7.0] (Gem::LoadError)
I am using net-ssh 2.7.0 and got the same issue
10

I had the same problem while deploying using capistrano Net::SSH::AuthenticationFailed: Authentication failed for user deployer@IP

ssh-copy-id deployer@ip 

This will add your keys to server and you can login without password.

Comments

0

After uninstall net-ssh 2.8.0, remove on gemfile.lock, too. It will continuously okay.

Comments

0

Please remove old net-ssh and install updated as below, add this in your gem file or can install it on your environment specifying 2.9.2 version.

gem 'net-ssh', '~> 2.9.2'

Its works for me.

Comments

0

For capistrano2 in your deploy.rb

  • net-ssh 2.9.1 set :ssh_options, { config: false}
  • net-ssh 2.9.2 set :ssh_options, { config: false, number_of_password_prompts: 0 }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.