Cap 2.13, 2.14 and Net-SSH 2.8 conflict, possibly

245 views
Skip to first unread message

rbbic...@gmail.com

unread,
Feb 3, 2014, 5:10:05 PM2/3/14
to capis...@googlegroups.com
Versions:
  • Ruby: 1.9.3
  • Capistrano: 2.13 and 2.14
  • Net-SSH 2.7.0 and 2.8.0
Platform:
  • Mac OS X 10.6.8
  • Deploying to... Ubuntu 12.04
Files:
  • Capfile
load 'deploy'
default_run_options
[:pty] = true
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load
'config/deploy' # remove this line to skip loading any of the default tasks

  • deploy.rb
set :application, "myapp"
set :repository, "http://foo.bar.net/svn/myapp/trunk"
set :stages, %w(trunk staging production)
set :default_stage, 'trunk'
  • Stage files (production.rb, staging.rb)
role :web, "foo.bar.net" # Your HTTP server, Apache/etc
role
:app, "foo.bar.net" # This may be the same as your `Web` server
role
:db,  "foo.bar.net", :primary => true # This is where Rails migrations will run

set :deploy_to, "/var/www/#{application}/trunk"
set :rails_env, "trunk"

I have deployed this application numerous times successfully to all environments. In my other apps, I have been locking the capistrano gem to 2.14 as we use subversion and there's a bug in 2.15 (and 3.x is obviously out) and I was making the pass on this one today. I was also doing some other things and emptied its gemset and re-installed it using bundle update. And then when I went to deploy, this (deploy:check in the example as it's a lot shorter):

$ cap deploy:check
    triggering load callbacks
    triggering start callbacks
for `deploy:check'
  * 2014-02-03 16:34:28 executing `
multistage:ensure'
*** Defaulting to `trunk'

 
* 2014-02-03 16:34:28 executing `trunk'
  * 2014-02-03 16:34:28 executing `
deploy:check'
  * executing "test -d /var/www/graphene/trunk/releases"
    servers: ["foo.bar.net"]
connection failed for: foo.bar.net (Net::SSH::AuthenticationFailed: Authentication failed for user br...@foo.bar.net)

Googling around I find that the likely cause is I need default_run_options[:pty] = true set, except, it is indeed set in my Capfile. (Tried in deploy.rb, also, just to be sure.) When I went to one of my other apps, they deployed fine. When I went to a tag of this app that I just recently deployed, it also deployed fine. On looking at the gem list, I saw the problematic app had was using net-ssh (2.8.0) the happy app was using net-ssh (2.7.0). Seeing as net-ssh was mentioned explicitly in the error, I uninstalled 2.8 and installed 2.7, and sure enough I got the expected password prompt when carrying out a deploy.

So this is not so much a question as an observation that could possibly help someone else who is scratching their head.


Tyler Freeman

unread,
Feb 5, 2014, 5:55:15 PM2/5/14
to capis...@googlegroups.com
I can confirm that I also had this issue. Uninstalling Net-SSH 2.8 and installing 2.7 fixed this.

BTW, thanks for saving my afternoon by posting this.
Reply all
Reply to author
Forward
0 new messages