Capistrano/svn repository problem

I’ve recently been attempting to deploy my application (using Apache,
Mongrel and Capistrano on a Ubuntu box) and have hit a problem trying to
set :repository in deploy.rb. (I have been following chapter 27 in AWDwR
v2, and various online resources.)

The structure on the server is as follows:

  • rails app in /home/tim/rails/test_project
  • subversion repository in /home/tim/svn/test_project/trunk

My deploy.rb has the following lines

set :application, “test_project”
set :user, “tim”
set :repository,
“http://#{user}@[subdomain].[domain]/home/#{user}/svn/#{application}/trunk”
set :deploy_to, “/home/#{user}/rails/#{application}”
set :mongrel_conf, “config/mongrel_cluster.yml”

When I run rake remote:cold_deploy I get

– snip –

  • querying latest revision…
    svn: PROPFIND request failed on ‘/’
    svn: PROPFIND of ‘/’: 405 Method Not Allowed
    (http://ctru.sheffield.ac.uk)
    – end snip –

I’ve also tried changing the :repository value to
“svn://#{user}@[subdomain].[domain]/home/#{user}/svn/#{application}/trunk”
but get this error instead:

– snip –
svn: Can’t connect to host ‘ctru.sheffield.ac.uk’: No connection could
be made b
ecause the target machine actively refused it.
– end snip –

Does anyone have any idea where I’m going wrong? I’m new to Capistrano
(and also Subversion) so I’ve probably done something silly somewhere.

Thank you.

Tim C. wrote:

Hi Tim,

“http://#{user}@[subdomain].[domain]/home/#{user}/svn/#{application}/trunk”

Firstly do you liteally have [subdomain].[domain] as your repository ?
AT first I sssumed they were placeholder so as not to give it away to us
on the list, but since you later mention the domain, I’m guessing you
actually have [subdomain].[domain] in your :repository.

If so, that’s wrong :slight_smile: If not, my mistake :slight_smile:

Second, assuming you have the correct url in there, the subversion
repositrory would have to actually be shared over Apache. DO you know
for sure thats the case ?

If you type

“http://#{user}@[subdomain].[domain]/home/#{user}/svn/#{application}/trunk”

all of that with the placeholders filled in, do you see anything?

If not, it’s likely that there’s no web-accessible repository.

If you’re deploying to the same physical machine that the repository is
on, you could replace the :repository with a file:// url

file:///home/tim/svn/test_project/trunk

And try that ?

Alan

Alan F. wrote:

Tim C. wrote:

Hi Tim,

“http://#{user}@[subdomain].[domain]/home/#{user}/svn/#{application}/trunk”

Firstly do you liteally have [subdomain].[domain] as your repository ?
AT first I sssumed they were placeholder so as not to give it away to us
on the list, but since you later mention the domain, I’m guessing you
actually have [subdomain].[domain] in your :repository.

If so, that’s wrong :slight_smile: If not, my mistake :slight_smile:

Thankfully it’s your mistake! :wink: But it’s my fault: I was trying to
hide the domain with the placeholders but then forgot to replace the
text fed back to me on the terminal. Oops. (So, just to clarify, I’d
actually written ctru.sheffield.ac.uk.)

Second, assuming you have the correct url in there, the subversion
repositrory would have to actually be shared over Apache. DO you know
for sure thats the case ?

No. Should I share it? And how might I do this?

If you type

“http://#{user}@[subdomain].[domain]/home/#{user}/svn/#{application}/trunk”

all of that with the placeholders filled in, do you see anything?

No. I get a 404 ( “the requested URL … was not found on this server”).

If not, it’s likely that there’s no web-accessible repository.

How should I go about changing this?

If you’re deploying to the same physical machine that the repository is
on, you could replace the :repository with a file:// url

file:///home/tim/svn/test_project/trunk

And try that ?

I am deploying on the same physical machine, but “rake
remote:cold_deploy” yields

svn: Unable to open an ra_local session to URL
svn: Unable to open repository ‘file:///home/tim/svn/test_project/trunk’

Thank you very much for your help.

Tim C. wrote:

Thankfully it’s your mistake! :wink: But it’s my fault: I was trying to
hide the domain with the placeholders but then forgot to replace the
text fed back to me on the terminal. Oops. (So, just to clarify, I’d
actually written ctru.sheffield.ac.uk.)

OK :slight_smile: Good.

No. Should I share it? And how might I do this?

Its the best way to get your svn repository accessible from anywhere.
Do you have control of that web server ? Can you install modules ? If
so, you can do it, but it;s probably beyond the scope of this mailing
list :slight_smile:

I’m not clear “who I’m talking to”, if you know what I mean :slight_smile:

If you’re a student at the college with no real access to this kind of
infrastructure, just a normal account, you’re probably not going to
really get much further going this route.

If, in fact, you can admin all this stuff, you should go get the
Pragmatic Version Control book by Mike Mason (instant PDF purchase!)
which is a fantastic help in getting subversion installed, configured
and shared.

So…that all said, regardless of Apache, I’d have thought we could get
cap to talk to the local svn repository (the cap process runs on the
server, not the client, so when it runs it should be able to see your
repos).

If you’re deploying to the same physical machine that the repository is
on, you could replace the :repository with a file:// url

file:///home/tim/svn/test_project/trunk

And try that ?

I am deploying on the same physical machine, but “rake
remote:cold_deploy” yields

svn: Unable to open an ra_local session to URL
svn: Unable to open repository ‘file:///home/tim/svn/test_project/trunk’

OK. If you ssh into your account and cd into /home/tim/svn and ls,
what do you see ? Is there definitely an svn repository there ?
Created with svnadmin ?

Is it read and writable by you ?

while you’re sshed in,
mkdir /home/tim/workingcopy
cd /home/tim/workingcopy
svn co file:///home/tim/svn/test_project/trunk test_project

Can you successfully checkout the project ?

Thank you very much for your help.

Absolutely no bother. I read the list online, rather than email, which
means it may be a while between me replying, you replying and me reading
again :slight_smile: If you dont hear from me, you can mail me on gmail
(alancfrancis) and give me a poke.

Alan