Errno::ECONNREFUSED: Connection refused though SSH works

1,468 views
Skip to first unread message

Justin Williams

unread,
Oct 30, 2007, 5:11:33 PM10/30/07
to Capistrano
I'm finally getting around to upgrading my recipes to Capistrano 2.
I'm using the Capistrano-ext multistage support. Right now I'm just
trying to get my staging script setup. I followed the upgrade guide
and some of Jamis' blog posts to get to where I am. Running any
command (cap staging deploy or cap staging upgrade upgrade:revisions)
renders the following error:


** transaction: start
* executing `deploy:update_code'
* executing "svn checkout -q -r553 svn+ssh://
jus...@secondgearllc.com/var/svn/smart/branches/quickbooks /var/www/
vhosts/secondgearllc.com/sites/smart/releases/20071030210556 && (echo
553 > /var/www/vhosts/secondgearllc.com/sites/smart/releases/
20071030210556/REVISION)"
servers: ["secondgearllc.com"]
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/vhosts/secondgearllc.com/sites/smart/
releases/20071030210556; true"
servers: ["secondgearllc.com"]
** [deploy:update_code] exception while rolling back:
Capistrano::ConnectionError, connection failed for: secondgearllc.com
(Errno::ECONNREFUSED: Connection refused - connect(2))
connection failed for: secondgearllc.com (Errno::ECONNREFUSED:
Connection refused - connect(2))

I can SSH into the server with no issues, so I'm not sure why
Capistrano would not want to work. Any suggestions would be
appreciated.


Code is below:

deploy.rb:
--------------------

# require 'mongrel_cluster/recipes'

set :stages, %w(staging production)
set :default_stage, "staging"
require 'capistrano/ext/multistage'

set :application, "smart"
set :port, 8000
set :deploy_via, :checkout

set :scm, :subversion
set :restart_via, :run
set :use_sudo, true

after 'deploy:update_code', 'deploy:symlink_attachments'

namespace :deploy do
desc "Run this after every successful deployment"
task :after_default do
cleanup
end
end

staging.rb
------------------------

set :repository, "svn+ssh://jus...@secondgearllc.com/var/svn/
#{application}/trunk"
set :user, "justin"
set :deploy_to, "/var/www/vhosts/secondgearllc.com/sites/
#{application}"
role :web, "secondgearllc.com"
role :app, "secondgearllc.com"
role :db, "secondgearllc.com", :primary => true

after "deploy:start", "deploy:restart_web_server"

namespace :deploy do
desc "Symlinks the attachments folder"
task :symlink_attachments, :roles => :app do
run <<-CMD
cd #{release_path} &&
ln -s /var/www/vhosts/secondgearllc.com/sites/smart/shared/
attachments/ public/attachments
CMD
end
end

desc "Restart Web Server"
task :restart_web_server, :roles => :web do
begin
run "cd #{current_path}; mongrel_rails restart"
run "/sbin/service httpd restart"
rescue RuntimeError => e
puts e
puts "Probably not a big deal, so I'll keep trying"
end
end

Jamis Buck

unread,
Oct 30, 2007, 5:34:18 PM10/30/07
to capis...@googlegroups.com
You've got

set :port, 8000

in there. Is your ssh server listening on port 8000? If not, that's
the problem.

- Jamis

> --~--~---------~--~----~------------~-------~--~----~
> To unsubscribe from this group, send email to capistrano-
> unsub...@googlegroups.com
> For more options, visit this group at http://groups.google.com/
> group/capistrano
> -~----------~----~----~----~------~----~------~--~---
>

Justin Williams

unread,
Nov 1, 2007, 9:59:16 AM11/1/07
to Capistrano
That fixed it. A second set of eyes always helps.

Thanks Jamis!

- j

> smime.p7s
> 3KDownload

Reply all
Reply to author
Forward
0 new messages