# Capistrano 2.1 ssh/svn checkout problem

**URL:** <https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386>\
**Category:** Deployment\
**Created:** [December 17, 2007, 10:09am UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386 "2007-12-17T10:09:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [December 17, 2007, 10:09am UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/1 "2007-12-17T10:09:00Z")

</div>

Hi,  
I’m trying to deploy via Capistrano 2.1

I have the SVN repos. on the same deployed server.

In my deploy.rb:  
I tried this  
set :repository, “file:///home/#{user}/svn\_repos/trunk”

This gives an error of:

- executing `deploy:update\_code’  
svn: Unable to open an ra\_local session to URL  
svn: Unable to open repository ‘file:///…’

2nd attempt(where custom\_ssh is defined in subversion’s config file  
for setting a custom port ):  
set :repository, “svn+custom\_ssh://#{user}@#{domain}/home/#{user}/  
svn\_repos/trunk” # The repository location for svn+ssh access

this gives just locks up on:

- executing “svn checkout -q -r241 svn+custom\_ssh://SERVER”  
If i execute this command on a separate machine, it checks it out fine  
but if it try this command on the machine where the repos lies, it  
just freezes.

Has anyone else had this issue trying cap. deploy with the svn repos  
on the same machine?

I would think the first attempt should work because if it is trying to  
checkout from the same machine, the svn checkout file://… method  
should be local.

Thanks  
Tommy

---

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [December 17, 2007, 3:22pm UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/2 "2007-12-17T15:22:48Z")

</div>

The default deployment mechanism of Capistrano requires that the  
repository be accessible both on the box you are deploying from (so  
that the current revision can be queried) and on the boxes you are  
deploying to (to check out the code there).

- Jamis

---

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [December 17, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/3 "2007-12-17T19:56:25Z")

</div>

right it is accessible, . the svn repos is on same machine as the  
production.

On my local machine, it can query it fine and gets the version number  
fine using this option:  
set :repository, “svn+custom\_ssh://#{user}@#{domain}/home/#{user}/  
svn\_repos/trunk” # The repository location for svn+ssh access

but when I do this, it locks up on this command when it tries to check  
it out on the production machine:

- executing “svn checkout -q -r241 svn+custom\_ssh://SERVER”

Any ideas?

thanks,  
tommy

---

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [December 22, 2007, 9:29pm UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/4 "2007-12-22T21:29:53Z")

</div>

t chheng wrote:

> More clarification, this is the expected behavior I want it to do:
> 
> On my local machine, call `svn info file:///home/jobs/svn\_repos/trunk  
> -rHEAD svn+custom\_ssh://#{user}@#{domain}/home/#{user}/svn\_repos/  
> trunk’ to get the current version.
> 
> When Capistrano logins into the production machine, call svn export -  
> q -r241 file:///home/#{user}/svn\_repos/trunk /home/#{user}/apps/  
> #{app}/releases/20071217190026 && (echo 241 \> /home/#{user}/apps/  
> #{app}/releases/20071217190026/REVISION)
> 
> These are the sets of commands can that run.  
> What it actually does:  
> When Capistrano logins into the production machine, it tries to do:  
> svn export -q -r241 svn+custom\_ssh://#{user}@#{domain}/home/#{user}/  
> svn\_repos/trunk /home/#{user}/apps/#{app}/releases/20071217190026 &&  
> (echo 241 \> /home/#{user}/apps/#{app}/releases/20071217190026/  
> REVISION)
> 
> Which it fails because it is trying to ssh on the same machine.
> 
> - 
> 
> Thanks,  
> Tommy

Tommy,  
I am a bit further behind you and I wonder if you resolved this issue. I  
too have the logical configuration where my svn repo is on the  
deployment machine. I tried both the file:/// which logically should not  
work becuase svn is relative to the local machine (windows) where I am  
running capistrano and doing development. The svn+custom\_ssh method also  
fails though I did not see the problem of “…trying to ssh on the same  
machine.” What happens here is that it simply is not recognising my  
putty configuration file. So the svn+custom\_ssh works for finding and  
reading the repo but not saving files back.  
any wisdom welcome  
cheers

---

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [December 17, 2007, 8:09pm UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/5 "2007-12-17T20:09:55Z")

</div>

More clarification, this is the expected behavior I want it to do:

On my local machine, call `svn info file:///home/jobs/svn\_repos/trunk  
-rHEAD svn+custom\_ssh://#{user}@#{domain}/home/#{user}/svn\_repos/  
trunk’ to get the current version.

When Capistrano logins into the production machine, call svn export -  
q -r241 file:///home/#{user}/svn\_repos/trunk /home/#{user}/apps/  
#{app}/releases/20071217190026 && (echo 241 \> /home/#{user}/apps/  
#{app}/releases/20071217190026/REVISION)

These are the sets of commands can that run.  
What it actually does:  
When Capistrano logins into the production machine, it tries to do:  
svn export -q -r241 svn+custom\_ssh://#{user}@#{domain}/home/#{user}/  
svn\_repos/trunk /home/#{user}/apps/#{app}/releases/20071217190026 &&  
(echo 241 \> /home/#{user}/apps/#{app}/releases/20071217190026/  
REVISION)

Which it fails because it is trying to ssh on the same machine.

- 

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [January 5, 2008, 2:05am UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/6 "2008-01-05T02:05:10Z")

</div>

Hey,  
Sorry but I wasn’t able to find a solution with capistrano. As a  
workaround, I just used a simple bash script that runs all the  
commands needed to deploy updates.  
Let me know if you have any success.

Tommy

On Dec 22 2007, 12:29 pm, Gordon Tibbitts \<ruby-forum-incom…@andreas-

---

<div class="post-metadata">

**Author:** ![t\_chheng](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/cab0a1/32.png) [@t\_chheng](https://www.ruby-forum.com/u/t_chheng)\
**Post date:** [January 8, 2008, 1:41am UTC](https://www.ruby-forum.com/t/capistrano-2-1-ssh-svn-checkout-problem/123386/7 "2008-01-08T01:41:38Z")

</div>

t chheng wrote:

> Hey,  
> Sorry but I wasn’t able to find a solution with capistrano. As a  
> workaround, I just used a simple bash script that runs all the  
> commands needed to deploy updates.  
> Let me know if you have any success.
> 
> Tommy
> 
> On Dec 22 2007, 12:29 pm, Gordon Tibbitts \<ruby-forum-incom…@andreas-

Yes, That is exactly what I resorted to. I think that if I have a unix  
to unix or Max(unix) to Linux(unix) configuration it probably would  
work. Microsoft is the culprit here I think.  
Cheers  
Gordon
