Suddenly, Capistrano began to return a SSH issue:
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: staging.myserver.com (Net::SSH::AuthenticationFailed: root) connection failed for: staging.myserver.com (Net::SSH::AuthenticationFailed: root)
My deploy.rb contains:
require 'capistrano/ext/multistage'
ssh_options[:forward_agent] = true
ssh_options[:keys] = ["myserver_rsa"]
set :stages, ["staging", "production"]
set :default_stage, "staging"
set :scm, "git"
set :application, "myapp"
set :repository, "git@bitbucket.org:project/myapp.git"
set :use_sudo, false
set :deploy_via, :remote_cache
and at my config/deploy/staging.rb
server 'staging.myserver.com', :app, :web, :db, primary: true
set :branch, 'staging'
set :rails_env, "staging"
set :deploy_to, "/var/rails/#{application}"
set :user, "root"
set :password, "my_triple_check_password_login"
set :domain, "staging.myserver.com"
Tests made by me before posting here:
Try to login via ssh (ssh -v staging.myserver.com) => Logged successfully without prompt my password. (using myserver_rsa key)
Agent Forward => Enabled in server and in local
Try to login via ssh without keys: => prompted for password. Copy and paste it from staging.rb and logged perfectly.
Change server root password. => Try to login with new password via ssh root@... worked nice. but via capistrano, fails.
Run in IRB a Net SSH script to login. => Logged in and return a
hostname
result from bash.
This issue starts yesterday suddenly. I really don't have more ideas :/
First of all, nothing was change at server either Cap deploy configs.
Thanks!