You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Jay Freeman (saurik)" <sa...@saurik.com> on 2001/12/04 08:50:24 UTC

OK, so copy is supposed to work now? (as it still isn't, hehe)

OK, I just got and installed Subversion r590 (still using Apache 2.0b28,
the latest released beta. is that a problem?), and am trying to do a
copy:
 
[root(2)@dreadnought evil]# rm -rf /cvs/svn/ninetjer         
[root(2)@dreadnought evil]# svnadmin create /cvs/svn/ninetjer
[root(2)@dreadnought evil]# chown -R apache.apache /cvs/svn/ninetjer 
[root(2)@dreadnought evil]# su saurik
[saurik(3)@dreadnought evil]$ svn co http://www.saurik.com:423/ninetjer
saurik's password: 
 
[saurik(3)@dreadnought evil]$ cd ninetjer 
[saurik(3)@dreadnought ninetjer]$ svn mkdir syn
A          syn
[saurik(3)@dreadnought ninetjer]$ svn commit
Adding          /home/saurik/evil/ninetjer/syn
Commit succeeded.
[saurik(3)@dreadnought ninetjer]$ svn cp syn ack
A          ack
[saurik(3)@dreadnought ninetjer]$ svn commit
 
svn_error: #21075 : <RA layer's server request failed>
  commit failed: wc locks and tmpfiles have been removed.
 
svn_error: #21075 : <RA layer's server request failed>
  commit failed: while sending tree-delta to repos.
 
svn_error: #21075 : <RA layer's server request failed>
  COPY request failed for 'ack'
[saurik(3)@dreadnought ninetjer]$
 
Nothing was added to my error_log, and the access_log is registering the
following:
 
209.224.199.248 - saurik [04/Dec/2001:02:36:07 -0600] "CHECKOUT
/ninetjer/$svn/ver/0.0/ HTTP/1.1" 201 321
209.224.199.248 - saurik [04/Dec/2001:02:36:07 -0600] "PROPFIND
/ninetjer/syn HTTP/1.1" 207 498
209.224.199.248 - saurik [04/Dec/2001:02:36:07 -0600] "PROPFIND
/ninetjer/$svn/vcc/default HTTP/1.1" 207 397
209.224.199.248 - saurik [04/Dec/2001:02:36:07 -0600] "COPY
/ninetjer/$svn/bc/1//syn HTTP/1.1" 502 279
 
I'm not really sure what else is of use to know for this one. (from what
I can tell, dav_svn_copy_resource isn't even being called, but I might
be misusing gdb).
Error 502 sounds freaky. gateway failure?
 
Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Greg Stein <gs...@lyra.org>.
On Tue, Dec 04, 2001 at 03:05:40PM -0600, Jay Freeman (saurik) wrote:
> Joe:
> 
> Then why would my checkout work?  Note that everything worked until the
> COPY command got sent during the commit operation.

Because those other operations don't look at the server name in the same
way. The COPY command has a specific precondition.

> I'm not using VirtualHost, nor do I even have ServerName set.  This is a
> stock Apache 2.0 configuration dedicated to testing Subversion with only
> three changes: User/Group, Listen on 423 instead of 80, and the SVN
> configuration for /ninetjer to /cvs/svn/ninetjer.  Pretty much anything
> coming in on port 423 should do...

Not where COPY is concerned. In that case, the server needs to know it is
called "www.saurik.com". Put the ServerName in there and it should be fine.

If you want a detailed explanation of "why", then we can get into that. If
you just want to get running, then add the ServerName.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
Joe:

Then why would my checkout work?  Note that everything worked until the
COPY command got sent during the commit operation.

I'm not using VirtualHost, nor do I even have ServerName set.  This is a
stock Apache 2.0 configuration dedicated to testing Subversion with only
three changes: User/Group, Listen on 423 instead of 80, and the SVN
configuration for /ninetjer to /cvs/svn/ninetjer.  Pretty much anything
coming in on port 423 should do...

I just upgraded with the changes that were posted since yesterday, and
still have the problem :(.  I have semi-automated my testing of it :-P.
Does it work for you?  What specific version of Apache are you using?

[root(2)@dreadnought evil]# make
rm -rf /cvs/svn/ninetjer
svnadmin create /cvs/svn/ninetjer
chown apache.apache -R /cvs/svn/ninetjer
rm -rf ninetjer
su -c "svn co http://www.saurik.com:423/ninetjer" saurik
saurik's password: 

cd ninetjer; touch bob; svn add bob; svn commit
A          bob
Adding          /home/saurik/evil/ninetjer/bob
Commit succeeded.
cd ninetjer; svn cp bob tom; svn commit
A          tom

svn_error: #21075 : <RA layer's server request failed>
  commit failed: wc locks and tmpfiles have been removed.

svn_error: #21075 : <RA layer's server request failed>
  commit failed: while sending tree-delta to repos.

svn_error: #21075 : <RA layer's server request failed>
  COPY request failed for 'tom'
make: *** [testcopy] Error 1

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

-----Original Message-----
From: Joe Orton [mailto:joe@manyfish.co.uk] 
Sent: Tuesday, December 04, 2001 4:56 AM
To: svn-dev
Subject: Re: OK, so copy is supposed to work now? (as it still isn't,
hehe)

On Tue, Dec 04, 2001 at 02:50:24AM -0600, Jay Freeman (saurik) wrote:
> 209.224.199.248 - saurik [04/Dec/2001:02:36:07 -0600] "COPY
> /ninetjer/$svn/bc/1//syn HTTP/1.1" 502 279
>  
> I'm not really sure what else is of use to know for this one. (from
what
> I can tell, dav_svn_copy_resource isn't even being called, but I might
> be misusing gdb).
> Error 502 sounds freaky. gateway failure?

This means you are referring to the server by a hostname which Apache
doesn't know about - use the same name as in the ServerName directive in
your httpd.conf. If you have a VirtualHost set up, you can add a
"ServerAlias other.hostname.com" so that apache knows about that
hostname too.

Regards,

joe


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Joe Orton <jo...@manyfish.co.uk>.
On Tue, Dec 04, 2001 at 02:50:24AM -0600, Jay Freeman (saurik) wrote:
> 209.224.199.248 - saurik [04/Dec/2001:02:36:07 -0600] "COPY
> /ninetjer/$svn/bc/1//syn HTTP/1.1" 502 279
>  
> I'm not really sure what else is of use to know for this one. (from what
> I can tell, dav_svn_copy_resource isn't even being called, but I might
> be misusing gdb).
> Error 502 sounds freaky. gateway failure?

This means you are referring to the server by a hostname which Apache
doesn't know about - use the same name as in the ServerName directive in
your httpd.conf. If you have a VirtualHost set up, you can add a
"ServerAlias other.hostname.com" so that apache knows about that
hostname too.

Regards,

joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2001-12-06 at 04:06, Karl Fogel wrote:
> Greg Stein <gs...@lyra.org> writes:
> > The latter, and yes: it has been biting people periodically, so some doc
> > and/or FAQ would be Goodness.

A FAQ entry is nice, but in the long run, if we can't make the hostname
dependency go away, we need to make sure that our error message is
better.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Dec 06, 2001 at 01:20:46PM -0600, Karl Fogel wrote:
> "Jay Freeman \(saurik\)" <sa...@saurik.com> writes:
> > OK, I can try to do something like that tomorrow.
> > 
> > BTW, how does that, the process of updating the website, work (if
> > someone wouldn't mind explaining, and has the time to, I'm quite
> > curious)?  I write up a patch for project_faq.html, send it to the list,
> > and it gets merged.  Then, does someone else check it out and upload it
> > to the website, or is there some spiffy Subversion way of having a URL
> > map directly into the HEAD of a repository through the magic of mod_dav?

try: http://svn.collab.net/repos/svn/trunk/autogen.sh

That's the HEAD for autogen.sh. In essence, you can use your Subversion
repository as a live website.

[ there are issues with things like Apache not looking for index.html, but
  we'll get those sorted out later ]

Want some *real* fun? Have people check in/out of (say) /repos/site, and set
of a second Location/SVNPath block to refer to the same SVN repository. On
that Location, turn on Server Side Includes or PHP. Woo!

[ strictly speaking, it might even be possible to do SSI on the actual
  repository because I don't think the SVN client ever does a GET from
  there. Hmm... actually, it does in some cases. But hey... ]

It is also possible to use mod_rewrite to turn /somepage.html into
/repos/project/www/somepage.html

> > Last I can find is back at the end of October when people were asked to
> > commit things to the CVS repository _as well as_ the Subversion
> > repository so the website could be updated... is that still the case?
> > (I am setting up a web page for a project I'm planning on putting in a
> > Subversion repository, and if there is a nice way to automate web page
> > sync'ing I'd love to know about it :-P.)

As mentioned above, you can publish right out of a Subversion repository. If
you believe you're going to have a heavy load, and want to avoid smacking
the Subversion DB on each request, then you can use a hook script to do an
"svn update" on a web-published working copy each time somebody commits
something to the web pages in your repository.

>...
> There is a way of having URLs that map directly to the HEAD in the
> repository, though; maybe we should have some of our links work that
> way.  Greg Stein?

We're doing that for some of the "documents" on tigris.org. But the builtin
pages on the site can't really reference stuff from a different box as far
as I know. Thus, the need for a working copy there.

"There is a way" is simple and described above. There is also a way to refer
to a specific revision of a file, but that isn't officially supported except
for a WebDAV/DeltaV client.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
"Jay Freeman \(saurik\)" <sa...@saurik.com> writes:
> OK, I can try to do something like that tomorrow.
> 
> BTW, how does that, the process of updating the website, work (if
> someone wouldn't mind explaining, and has the time to, I'm quite
> curious)?  I write up a patch for project_faq.html, send it to the list,
> and it gets merged.  Then, does someone else check it out and upload it
> to the website, or is there some spiffy Subversion way of having a URL
> map directly into the HEAD of a repository through the magic of mod_dav?
> Last I can find is back at the end of October when people were asked to
> commit things to the CVS repository _as well as_ the Subversion
> repository so the website could be updated... is that still the case?
> (I am setting up a web page for a project I'm planning on putting in a
> Subversion repository, and if there is a nice way to automate web page
> sync'ing I'd love to know about it :-P.)

We're no longer doing duplicate commits into the CVS repository -- the
web site gets updated right out of Subversion.  Jason Robbins set up a
web form with a magic button; when an appropriately authenticated
person presses that button, the web site (which is an svn working
copy) updates itself. :-)

There is a way of having URLs that map directly to the HEAD in the
repository, though; maybe we should have some of our links work that
way.  Greg Stein?

-K

> -----Original Message-----
> From: Karl Fogel [mailto:kfogel@newton.ch.collab.net] 
> Sent: Thursday, December 06, 2001 3:06 AM
> To: Greg Stein
> Cc: Jay Freeman (saurik); 'svn-dev'
> Subject: Re: OK, so copy is supposed to work now? (as it still isn't,
> hehe)
> 
> Greg Stein <gs...@lyra.org> writes:
> > The latter, and yes: it has been biting people periodically, so some
> doc
> > and/or FAQ would be Goodness.
> 
> +1
> 
> Jay, if you can write up a patch for the project_faq.html, we'll add
> it.
> 
> -K
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
Karl:

OK, I can try to do something like that tomorrow.

BTW, how does that, the process of updating the website, work (if
someone wouldn't mind explaining, and has the time to, I'm quite
curious)?  I write up a patch for project_faq.html, send it to the list,
and it gets merged.  Then, does someone else check it out and upload it
to the website, or is there some spiffy Subversion way of having a URL
map directly into the HEAD of a repository through the magic of mod_dav?
Last I can find is back at the end of October when people were asked to
commit things to the CVS repository _as well as_ the Subversion
repository so the website could be updated... is that still the case?
(I am setting up a web page for a project I'm planning on putting in a
Subversion repository, and if there is a nice way to automate web page
sync'ing I'd love to know about it :-P.)

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

-----Original Message-----
From: Karl Fogel [mailto:kfogel@newton.ch.collab.net] 
Sent: Thursday, December 06, 2001 3:06 AM
To: Greg Stein
Cc: Jay Freeman (saurik); 'svn-dev'
Subject: Re: OK, so copy is supposed to work now? (as it still isn't,
hehe)

Greg Stein <gs...@lyra.org> writes:
> The latter, and yes: it has been biting people periodically, so some
doc
> and/or FAQ would be Goodness.

+1

Jay, if you can write up a patch for the project_faq.html, we'll add
it.

-K


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
I think this works better as an addition to server_setup.html:

Index: ./server_setup.html
===================================================================
--- ./.svn/text-base/server_setup.html.svn-base Sat Dec  1 01:46:28 2001
+++ ./server_setup.html Fri Dec  7 01:29:34 2001
@@ -103,7 +103,18 @@
     Make sure that the user 'nobody' (or whatever UID the httpd
     process runs as) is able to read the berkeley db files.
 
-9.  Now fire up apache 2.0:
+9.  In order for 'svn cp' to work (which is actually implemented as a
+    DAV COPY command), mod_dav needs to be able to be able to determine
+    the hostname of the server.  A standard way of doing this is to use
+    Apache's ServerName directive to set the server's hostname.  Edit
+    your /usr/local/apache2/conf/httpd.conf to include:
+
+          ServerName svn.myserver.org
+
+    If you are using virtual hosting through Apache's NameVirtualHost
+    directive this will not be an issue.
+
+10. Now fire up apache 2.0:
 
            /usr/local/apache2/bin/apachectl stop
            /usr/local/apache2/bin/apachectl start
@@ -111,7 +122,7 @@
     Check /usr/local/apache2/logs/error_log to make sure it started
     up okay.
 
-10. Finally, try doing a network checkout from the repository:
+11. Finally, try doing a network checkout from the repository:
 
           svn co http://localhost/svn/repos -d wc

Sincerely,
Jay Freeman (saurik)
saurik@saurik.com

-----Original Message-----
From: Karl Fogel [mailto:kfogel@newton.ch.collab.net] 
Sent: Thursday, December 06, 2001 3:06 AM
To: Greg Stein
Cc: Jay Freeman (saurik); 'svn-dev'
Subject: Re: OK, so copy is supposed to work now? (as it still isn't,
hehe)

Greg Stein <gs...@lyra.org> writes:
> The latter, and yes: it has been biting people periodically, so some
doc
> and/or FAQ would be Goodness.

+1

Jay, if you can write up a patch for the project_faq.html, we'll add
it.

-K


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Stein <gs...@lyra.org> writes:
> The latter, and yes: it has been biting people periodically, so some doc
> and/or FAQ would be Goodness.

+1

Jay, if you can write up a patch for the project_faq.html, we'll add
it.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by Greg Stein <gs...@lyra.org>.
On Tue, Dec 04, 2001 at 03:49:23PM -0600, Jay Freeman (saurik) wrote:
>...
> OK, I've been able to track this down farther.  It gets into

hehe. I coulda saved you a lot of time on this one :-)  Didn't think you'd
actually go this far... woo.

>...
> BTW, I think someone tried to run the reproduction against my server
> while I was debugging it, so if someone got some strange results, you
> know why :).

*laf*

>...
> Yep, I added the following to my httpd.conf and it works now:
>  
> ServerName www.saurik.com:423
>  
> Is this a bug in DAV?  Maybe a limitation of COPY's where it _needs_ a
> name to be given somewhere?  If the latter, this should be specified in
> the Subversion server_setup file, as I know I don't know that much about
> what allows DAV to do it's magic :-P.

The latter, and yes: it has been biting people periodically, so some doc
and/or FAQ would be Goodness.

Note that the need for a ServerName depends a lot upon the local config.
Apache will do a reverse lookup to find its name, but if that doesn't match
the one you're accessing with...

> Why is svn even sending the host in the URL again?  Can't it just send
> an absolute path to the server?  The comment about "must_be_absolute" is
> rather vague.

There are two URLs in a COPY request. The Request-URI and the Destination:
header. The Destination header *requires* an absolute, fully-qualified URL.
mod_dav then checks to ensure that the host in that URL matches the server
that you connected to (mod_dav does not provide for cross-server copies or
moves). WebDAV (RFC 2518) specifies that 502 (Bad Gateway) be returned for
these kinds of copies/moves.

I may be summarizing a bit too much here, so feel free to ask more Q's if
necessary.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: OK, so copy is supposed to work now? (as it still isn't, hehe)

Posted by "Jay Freeman (saurik)" <sa...@saurik.com>.
OK, I've been able to track this down farther.  It gets into
dav_method_copymove, and is able to do the svn_get_resource fine.
However, when it goes later and calls dav_lookup_uri on dest it fails.
 
(gdb) print dest
$29 = 0x8134721
"http://www.saurik.com:423/ninetjer/$svn/wrk/349975ba-d11d-b211-8a60-f50
ace7541fa//tom"
 
The line of code is:
lookup = dav_lookup_uri(dest, r, 1 /* must_be_absolute */);
 
The lookup.rnew == NULL test fails, and the .err.status !=
HTTP_BAD_REQUEST, so it falls through to:
 
 return dav_error_response(r, lookup.err.status, lookup.err.desc);
 
*adds another break point*
 
BTW, I think someone tried to run the reproduction against my server
while I was debugging it, so if someone got some strange results, you
know why :).
 
God damn it... lo and behold:
 
280         if (comp.hostname != NULL &&
281             !ap_matches_request_vhost(r, comp.hostname, port)) {
282             result.err.status = HTTP_BAD_GATEWAY;
283             result.err.desc = "Destination URI refers to a different
server.";
284             return result;
285         }
 
 
It DOES think it is on a different server, just like Joe said... why is
it talking about "vhost"s... I don't have any vhosts....
 
*steps into that evil, evil apr_matches_request_vhost function*
 
OK, it's comparing
 
"www.saurik.com", 423
 
against
 
"", 0
 
 
It has a special check to know that if sar->host_port is 0 it is a match
(as it doesn't matter at that point), but there _isn't_ any special case
code for "".
 
After it does that, it verifies that the port MUST match before doing
the last ditch effort of running matches_alias, and returns 0.
 
Yep, I added the following to my httpd.conf and it works now:
 
ServerName www.saurik.com:423
 
Is this a bug in DAV?  Maybe a limitation of COPY's where it _needs_ a
name to be given somewhere?  If the latter, this should be specified in
the Subversion server_setup file, as I know I don't know that much about
what allows DAV to do it's magic :-P.
 
Why is svn even sending the host in the URL again?  Can't it just send
an absolute path to the server?  The comment about "must_be_absolute" is
rather vague.
 
Sincerely,
Jay Freeman (saurik)
saurik@saurik.com
 
-----Original Message-----
From: Jay Freeman (saurik) [mailto:saurik@saurik.com] 
Sent: Tuesday, December 04, 2001 2:50 AM
To: svn-dev
Subject: OK, so copy is supposed to work now? (as it still isn't, hehe)
 
OK, I just got and installed Subversion r590 (still using Apache 2.0b28,
the latest released beta. is that a problem?), and am trying to do a
copy:
 
.
 
I'm not really sure what else is of use to know for this one. (from what
I can tell, dav_svn_copy_resource isn't even being called, but I might
be misusing gdb).
Error 502 sounds freaky. gateway failure?
 
Sincerely,
Jay Freeman (saurik)
saurik@saurik.com