tags:

views:

100

answers:

2

I be at a loss here, and after scouring the seas (read: internet) for solutions I am left with none other than to hit up the stack. any help appreciated.

I have capistrano running locally for deployments onto several different environments. (I'm on windows 7, fwiw). All was well until I needed to deploy to multiple :app servers during a single deployment.

Usually I'm prompted for my ssh passphrase once when I call 'cap deploy'. I have ssh-agent running (git never pesters for my pass) but despite this Capistrano has always bugged me once each deployment. Regardless, it always worked when deploying to ONE host.

Now, when I attempt to deploy to multiple servers at once, it asks for my passphrase what appears to be multiple times:

(ips removed by ME)

servers: ["redacted", "redacted"]<br />
Enter passphrase for ~/.ssh/id_rsa: Enter passphrase for ~/.ssh/id_rsa: 

So with the above I enter my passphrase but this doesn't work. It waits as little while, then spits out this error:

connection failed for: <one of the server ips> (NoMethodError: undefined method `overwrite' for nil:NilClass)

And that's the end of that.

  1. I can "passwordless" ssh into the servers I'm deploying on just fine.
  2. I'm pretty certain the ssh-agent is running since I can hit Git w/out entering my passphrase every time
  3. Using 'forward_agent' setting in cap deploy did not work.
  4. This is my role:
    role :app, "ip 1 removed", "ip 2 removed"
  5. If i set default_run_options[:max_hosts] = 1, it works OK but it asks for my passphrase for every single connection to each host I'm deploying to.. which ends up being a lot.

Essentially I'm looking for any of the below (but not limited to): - "You're never going to fix that on windows" - "This is how you get REAL passwordless deployment in capistrano" - "Have you overlooked this setting/feature?" - "I have a rock that can fix anything, you may borrow it"

Thanks!

A: 

What is the user variable set to? run a simple invoke command from the directory with the Capfile which should try to execute on every server listed. Does it successfully connect?

cap invoke COMMAND="echo 'Hello World'"

If that won't run then likely your user is not the same as your ssh passwordless agent. You could also look in the SSH logs on the server and see if you can tell what agent is actually trying to connect unsuccessfully.

naven87
I have multiple stages so I'd call: cap production invoke ...This fails since it asks form the passphrase for each server simultaneously (ie: I get asked the passphrase for times at once, but I'm not given the chance to enter it in 4 times). running this for individual servers works fine, ex:cap prod1 invoke ...Since I can invoke successfully on any individual server, I hesitate to think its the user variable. I do have to connect via vpn, I wonder if that has something to do with it.
morris082
A: 

I've actually experienced the same problem and have corrected it (patched it, really) by supplying the "default_run_options[:max_hosts] = 1" and using ssh-agent to cache my passphrase. NOT an ideal solution, to be sure, and the core issue remains hidden under the surface.

jeyroz
Ongoing discussion taking place here:http://groups.google.com/group/capistrano/browse_thread/thread/d38dee230377b464
jeyroz
When I give that a whirl I have to provide by ssh key for every command that is fired off for each server (adds up to about 30 total). I do have ssh-agent going, but cap still asks for it. (With ssh-agent off it asks twice)
morris082