[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Possible Bug Master/Slave repository with a 502 Bad Gateway. Not a HTTP/HTTPS translation problem

From: Jonathan Petrush <jonpetrush_at_petrush.com>
Date: Wed, 18 Mar 2009 22:40:15 -0400

The following are the specifications of the error:

SERVER1 Master SVN Server compiled using
subversion_1.5.6/apache_2.22.11/ruby_1.9.1p0/neon_0.28.3/apr_1.3.3/apr-iconv_1.2.1/apr-util_1.3.4/db_4.7.25/gsasl_0.2.29/jdk_1.6.012

configured and built through:

./configure --prefix=/opt/lampp --with-apr=/usr --with-apr-util=/usr
--with-apxs=/opt/lampp/bin/apxs --with-zlib=/usr/lib
--enable-experimental-libtool --with-jdk=/usr/src/jdk1.6.0_12
--with-ssl --with-sasl=/usr --with-berkeley-db=/usr/local/BerkeleyDB.4.7

compiler: GCC 4.1.2
arch: i686
Linux Kernel: 2.6.21.5 (SMP) * 2

Access through dav_svn through apache
Replication to slaves through svnsync post commit hooks

Operating System: Slackware 12.2
httpd.conf:
<Location /ivr>
     Order allow,deny
     Allow from all
     DAV svn
     SVNPath /raid/svn/repository/ivr
     AuthType Basic
     AuthName "IVR Repository"
     AuthUserFile /raid/svn/conf/svn-auth-file-eng
     Require valid-user
</Location>

including modules (of question)

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

SERVER2 Slave SVN Server compiled using
subversion_1.5.6/apache_2.22.11/ruby_1.9.1p0/neon_0.28.3/apr_1.3.3/apr-iconv_1.2.1/apr-util_1.3.4/db_4.7.25/gsasl_0.2.29/jdk_1.6.012

configured and built through:

./configure --prefix=/opt/lampp --with-apr=/usr --with-apr-util=/usr
--with-apxs=/opt/lampp/bin/apxs --with-zlib=/usr/lib
--enable-experimental-libtool --with-jdk=/usr/src/jdk1.6.0_12
--with-ssl --with-sasl=/usr --with-berkeley-db=/usr/local/BerkeleyDB.4.7

compiler: GCC 4.1.2
arch: i686
Linux Kernel: 2.6.21.5 (SMP) * 4

Access through dav_svn through apache
Blocking of prerevprops changes to anything but svnsync account

Operating System: Slackware 12.0
httpd.conf:

<Location /ivr>
     Order allow,deny
     Allow from all
     DAV svn
     SVNPath /opt/svn/repository/ivr
     SVNMasterURI http://masterrepo/ivr
     AuthType Basic
     AuthName "IVR Repository"
     AuthUserFile /opt/svn/conf/svn-auth-file
     Require valid-user
   </Location>

including modules (of question)

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

/////////////////////////////////////

The repositories were set up at fsfs type.
I have been running a mirroring repository for quite some time holding
approx 78GB combined data. There have never been any issues with any
commits until recently.

It should be noted that no issue exists if a commit is made directly
to the master server, only errors occur when a commit is made to a
slave repository which forwards to the master server. I have found a
keyword that causes the commit to comeback with a 502 Gateway error.

Scenario and it can be reproduced and test on your own to verify that
this is the case:

Set up a master repository.
Replicate master repository to slave repository location.
using apache dav_svn style access: ie: svn co http://server/trunk
make sure slave server is set with the option SVNMasterURI to pass all
commit traffic to the master server, and not to try to commit it
localy completely destabalizing the slave server. (should have a
prerevprops file in hooks the explicitly disallows this)

Now create a new working directory.
Import this into SVN
Checkout this working directory from the slave repository (assuming
all your scripts are working properly )to start using your working
directory.
now create a file in this working directory:
#touch randfile
add it to be committed
#svn add --force .
commit it
#svn ci -m "test"

It will commit properly
Everything works perfectly.
now here is where the failure comes.
edit the randfile

insert into the file the following:
/bin/kill
now save the file and try to commit it again:
#svn ci -m "test2"

FAILED: You will get a:

Transmitting file data .svn: Commit failed (details follow):
svn: Server sent unexpected return value (502 Bad Gateway) in response
to PUT request for.....

Now modify the file by putting letters in front of and behind the /bin/kill
try committing again:
#svn ci -m "test3"

FAILED: You will still get a:

Transmitting file data .svn: Commit failed (details follow):
svn: Server sent unexpected return value (502 Bad Gateway) in response
to PUT request for.....

now modify the file again one last time by altering the spelling of kill ie:
/bin/kil
now save the file and try commiting
#svn ci -m "test4"

Success. Notice it commit properly.
Now I was staring at the apache logfiles while this was happening the
following was the result on the slaveserver:

[Wed Mar 18 22:02:59 2009] [error] [client xxx.xxx.xxx.xxx]
(104)Connection reset by peer: proxy: error reading status line from
remote server masterrepo

[Wed Mar 18 22:02:59 2009] [error] [client xxx.xxx.xxx.xxx] proxy:
Error reading from remote server returned by
/ivr/!svn/wrk/b2fd0c12-ff99-b94c-8718-107905d5d628/trunk/ga0/etc/logrotate.d/k.txt

xxx.xxx.xxx.xxx - svnuser [18/Mar/2009:22:02:59 -0400] "PUT
/ivr/!svn/wrk/b2fd0c12-ff99-b94c-8718-107905d5d628/trunk/ga0/etc/logrotate.d/k.txt HTTP/1.1" 200
-

xxx.xxx.xxx.xxx - - [18/Mar/2009:22:02:59 -0400] "PUT
/ivr/!svn/wrk/b2fd0c12-ff99-b94c-8718-107905d5d628/trunk/ga0/etc/logrotate.d/k.txt HTTP/1.1" 502
1406

xxx.xxx.xxx.xxx - svnuser [18/Mar/2009:22:02:59 -0400] "DELETE
/ivr/!svn/act/b2fd0c12-ff99-b94c-8718-107905d5d628 HTTP/1.1" 204 -

/////////////////////////

Everything commits so far. Even having the file names as /bin/kill,
but if there is any clearline text that has /bin/kill the commit will
fail.

This has been reproduced on various other systems, but would like to
know if anyone has seen or heard of this before, and can confirm my
results, or denounce my results. As an additional note. svn commiting
dirrectly to the master server even using the dav_svn does not exhibit
these problems. Which leads me to believe it might be something with
mod_proxy in apache.

Any help would be great.

~jonathan
jonpetrush_at_petrush.com
Received on 2009-03-19 04:38:51 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.