# Can't do cap setup

**URL:** <https://www.ruby-forum.com/t/cant-do-cap-setup/106141>\
**Category:** Deployment\
**Created:** [June 6, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/cant-do-cap-setup/106141 "2007-06-06T20:51:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanstorck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e99b99/32.png) [@ivanstorck](https://www.ruby-forum.com/u/ivanstorck)\
**Post date:** [June 6, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/cant-do-cap-setup/106141/1 "2007-06-06T20:51:03Z")

</div>

This is the first time I’m trying out capistrano, so I’m sure there’s  
something I simple I’m missng.

I can ssh to the server using a public rsa key just fine. The username  
is the same on my laptop as on the server.

ivan:10:40 AM:writr\> cap setup

- executing task setup
- executing “umask 02 &&\n mkdir -p /var/www/writr.com  
/var/www/writr.com/releases /var/www/writr.com/shared  
/var/www/writr.com/shared/system &&\n mkdir -p  
/var/www/writr.com/shared/log &&\n mkdir -p  
/var/www/writr.com/shared/pids”  
servers: [“[www.writr.com](http://www.writr.com)”]  
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/agent.rb:70:in  
`initialize': No such file or directory - /tmp/501/SSHKeychain.socket (Errno::ENOENT) from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/agent.rb:70:in `connect!’  
from  
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/services.rb:56:in  
`register_services' from /usr/local/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/service-point.rb:122:in `instance’  
from  
/usr/local/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/container.rb:308:in  
`[]' from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/services.rb:70:in `open’  
from  
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/userkeys.rb:232:in  
`ensure_agent' from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/userkeys.rb:127:in `identities’  
from  
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-1.1.1/lib/net/ssh/userauth/methods/publickey.rb:50:in  
`authenticate' ... 13 levels... from /usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/cli.rb:239:in `execute!’  
from  
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/lib/capistrano/cli.rb:12:in  
`execute!’  
from  
/usr/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/bin/cap:11  
from /usr/local/bin/cap:18

Thanks for any help!

---

<div class="post-metadata">

**Author:** ![ivanstorck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e99b99/32.png) [@ivanstorck](https://www.ruby-forum.com/u/ivanstorck)\
**Post date:** [June 6, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/cant-do-cap-setup/106141/2 "2007-06-06T23:00:37Z")

</div>

I also tried deleting my keys, on the laptop and the server, and then  
running cap setup. It seems to be re-adding a ssh-dss key from somewhere  
into my local known\_hosts. Not sure why

---

<div class="post-metadata">

**Author:** ![ivanstorck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e99b99/32.png) [@ivanstorck](https://www.ruby-forum.com/u/ivanstorck)\
**Post date:** [June 7, 2007, 6:39pm UTC](https://www.ruby-forum.com/t/cant-do-cap-setup/106141/3 "2007-06-07T18:39:11Z")

</div>

Well, I found the solution and hopefully others will find this thread if  
they are stuck too.

thanks to [http://www.deheus.net/petrik/blog/post/124/](http://www.deheus.net/petrik/blog/post/124/)

"You can temporarily fix this in the console by typing: unset  
SSH\_AUTH\_SOCK "

so it works, but I don’t understand why.

---

<div class="post-metadata">

**Author:** ![ivanstorck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/e99b99/32.png) [@ivanstorck](https://www.ruby-forum.com/u/ivanstorck)\
**Post date:** [June 8, 2007, 11:45am UTC](https://www.ruby-forum.com/t/cant-do-cap-setup/106141/4 "2007-06-08T11:45:51Z")

</div>

> "You can temporarily fix this in the console by typing: unset  
> SSH\_AUTH\_SOCK "
> 
> so it works, but I don’t understand why.

I’m sure someone will correct me if I’m wrong, but my guess would be  
that at some point, you had an ssh-agent running. ssh-agent is a  
process which holds your private keys in memory, so that you  
authenticate them once and then you don’t have to type your ssh  
passphrase again (until the next time you reboot, or close down the  
ssh-agent). See ‘man ssh-agent’ for details.

ssh-agent creates an SSH\_AUTH\_SOCK environment variable, which holds  
the socket number that any ssh processes can use to communicate with  
the ssh-agent. It sounds as if you had an ssh-agent running at some  
point, but that it shut down for some reason. So, there was a left-  
over SSH\_AUTH\_SOCK environment variable, but no agent listening on  
that socket.

So, when cap tries to use ssh to connect to your server, ssh tries to  
talk to an ssh-agent that isn’t there, and it fails. By unsetting  
SSH\_AUTH\_SOCK, ssh processes will not try to connect to the missing  
agent, and will fall back to negotiating the connection themselves,  
which works fine.

Of course, I could be talking utter rubbish!

Cheers

David
