I'm having a little trouble trying to deploy a previously working project to the development server. I did not set-up the system however I do have all the credentials I need (I think).
After trying cap staging deploy I get so far and then it produces an error. Please see below:
triggering load callbacks
* 2012-11-20 14:52:20 executing `staging'
triggering start callbacks for `deploy'
* 2012-11-20 14:52:20 executing `multistage:ensure'
Identity added: /Users/XXX/.ssh/id_rsa (/Users/XXX/.ssh/id_rsa)
* 2012-11-20 14:52:20 executing `deploy'
* 2012-11-20 14:52:20 executing `deploy:update'
** transaction: start
* 2012-11-20 14:52:20 executing `deploy:update_code'
executing locally: "git ls-remote ssh://gitolite@repo1:2011/proto_projectname_rails HEAD"
command finished in 2864ms
* executing "git clone -q ssh://gitolite@repo1:2011/proto_projectname_rails /var/www/projectname/releases/20121120145223 && cd /var/www/projectname/releases/20121120145223 && git checkout -q -b deploy 0598169ed07015279bd78efa91f25ed3e5edcad8 && (echo 0598169ed07015279bd78efa91f25ed3e5edcad8 > /var/www/projectname/releases/20121120145223/REVISION)"
servers: ["repo2"]
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/projectname/releases/20121120145223; true"
servers: ["repo2"]
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: repo2 (Errno::ECONNREFUSED: Connection refused - connect(2))
connection failed for: repo2 (Errno::ECONNREFUSED: Connection refused - connect(2))
deploy.rb
set :stages, %w(staging production)
set :default_stage, "production"
require 'capistrano/ext/multistage'
set :application, "projectname"
set :scm, :git
set :repository, "ssh://gitolite@repo1:2011/proto_projectname_rails"
I am honestly confused as to why a previously working version no longer functions.
Any help, advice or guidance or this matter is more than welcome.
Thank you
As a side note, yes it has always been the non-standard port of 2011 and is in my .ssh/config
Edit:
There are 2 servers involved in this process.
After running the following locally and on 2nd server I do get a response.
git ls-remote ssh://gitolite@repo1:2011/proto_projectname_rails
It returns;
0598169ed07015279bd78efa91f25ed3e5edcad8 HEAD
0598169ed07015279bd78efa91f25ed3e5edcad8 refs/heads/master
Edit: Runs on 2 servers. Repo1 and Repo2
cap deploy:check
Returns
triggering load callbacks
* 2012-11-27 21:02:36 executing `production'
triggering start callbacks for `deploy:check'
* 2012-11-27 21:02:36 executing `multistage:ensure'
Identity added: /Users/x/.ssh/id_rsa (/Users/x/.ssh/id_rsa)
* 2012-11-27 21:02:36 executing `deploy:check'
* executing "test -d /var/www/projectname/releases"
servers: ["repo2"]
connection failed for: repo2 (Errno::ECONNREFUSED: Connection refused - connect(2))
Solved
It turns out that it was being rejected due to the 2nd servers port number. Adding
set :port, 1893
The bounty is still open to anyone that can explain this.
Why could always SSH into the server, without editing my ssh/config at anytime, and were other machines able to deploy, with the exact same deploy and staging files, but I could not until I explicitly added the port number?