开发者

Capistrano fails for multiple host deployments

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 di开发者_JS百科fferent 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!


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.


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.


did you tried to use putty-agent for storing ssh passwords ?

maybe not direct response but you can install msysgit and select msysgit to be added fully to PATH, also select to use putty-agent for authentication.


I had an almost identical problem (on Ubuntu 10.04), except that instead of getting the error connection failed for..., it would just sit there and do nothing until I press CTRL+C.

The solution was to manually add my SSH key to my keyring by typing ssh-add /path/to/my/private/key. It asked me for my passphrase, which I entered. Then I could run cap production invoke COMMAND="hostname" and cap production deploy without ever entering my password.

I do have ssh_options[:forward_agent] = true set.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜