Re: Bug: apache/mod_svn intermittently creates transaction dirs with incorrect permissions or ownership such that the transaction breaks.

Michael Sinz <[email protected]> Sat, 17 Sep 2005 06:57:34 -0400
Newsgroups gmane.comp.version-control.subversion.devel,gmane.mail.eyebrowse.user
Message-ID <[email protected]>
John Duprey wrote:
> I'm about to file a subversion bug in relation to apache/mod_svn 
> intermittently creating transaction dirs with incorrect permissions or 
> ownership such that the transaction breaks.
> 
> Many times during the day commits are failing with an error message like 
> the following:
> 
> /[Wed Aug 31 12:55:55 2005] [error] [client 192.189.224.121 
> <http://192.189.224.121><http://192.189.224.121 
> <http://192.189.224.121/>>] /
>   /Could not create activity /
>   //svn/ResultsPlus/!svn/act/a24ba835-0155-2042-a734-13818c448007. [500, 
> #0] /
>   /[Wed Aug 31 12:55:55 2005] [error] [client 192.189.224.121 
> <http://192.189.224.121><http://192.189.224.121 
> <http://192.189.224.121/>>] /
>   /could not begin a transaction [500, #13] /
>   /[Wed Aug 31 12:55:55 2005] [error] [client 192.189.224.121 
> <http://192.189.224.121><http://192.189.224.121 
> <http://192.189.224.121/>>] /
>   /Can't open file 
> '/svnroot/repos/ResultsPlus/db/transactions/90-1.txn/node.0.0': /
>   /Permission denied [500, #13]
> /
> Inspection on the server side reveals one of 2 scenarios:
> 
>    1. The transaction directory (e.g.
>       /svnroot/repos/reposname/db/transactions/90-1.txn) has the wrong
>       permissions and cannot be populated by the apache user (apache) -
>       i.e. drw-rwSrw-
>    2. The props file in the transaction directory (e.g.
>       /svnroot/repos/reposname/db/transactions/90-1.txn/props) is owned
>       by the root user and ONLY user has write permissions
> 
> If the commit is retried, it may or may not succeed.  To temporarily fix 
> the problem, I must restart apache, and delete the broken transaction 
> directories.
> 
> I am now running the latest stable apache(httpd-2.0.54) and 
> subversion(subversion-1.2.3) built from scratch.  (This problem was 
> first observed with prebuilt RPMS.)  I am running Intel RedHat 
> Enterprise Server 3 (rhel-3).  I have audited the system extensively in 
> an effort to identify any external processes that could be causing this 
> problem and found now.
> 
> I have a little bash script that will repeatedly modify, commit, and 
> sleep 1 second that tests subversion.  I can reproduce this error within 
> 10 - 30 commits.  I posted this problem before 

Could you please send the script - I wrote my own "bash the server hard"
script and other than finding an annoying behavior of "svn mkdir" it has
yet to show a problem.  (I only did 9000 or so revisions with it, many in
parallel, and no problems)  All over HTTP/DAV

PS - here is the script I ran - it is *very* crude but it did the job...

PPS - once I get some time, I will investigate the svn mkdir problem - basically,
it fails sometimes but not because of the directory already existing but with
a message that says that "." is out of date - which can not be true since I
have not even checked anything out yet...

-- 
Michael Sinz                     Technology and Engineering Director/Consultant
"Starting Startups"                                mailto:[email protected]
My place on the web                            http://www.sinz.org/Michael.Sinz

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
test.sh (application/x-sh, 1.4 KB)
#!/bin/sh

## A simple loop to just keep making more and more revisions to
## this file in the repository

## Note that the repository in this case is set up already
## and has /trunk (at least)
REPO='http://svn.sinz.org:8001/svn/test'

error()
{
   echo "$*"
   exit 1
}

makeRevs()
{
   dir="svn-test-`date '+%Y-%m-%d_%H-%M-%S'`_$1"
   cd /tmp
   mkdir $dir || error "Failed to create $dir in /tmp"
   cd $dir || error "Failed to cd /tmp/$dir"
   rdir="$REPO/trunk/$dir"
   echo "Creating repository directory $rdir"
   svn mkdir -q -m "Another test thread: $1" "$rdir" || error "Failed to create $rdir in repository"
   sleep 5
   echo "checking out repository directory $rdir"
   svn co -q "$rdir" . || error "Failed to check out $rdir"
   sleep 5
   revs=0
   echo "Starting 100 revisions into $rdir"
   echo "Starting: `date`" >test.txt
   cp test.txt other.txt
   cp other.txt last.txt
   svn add -q test.txt other.txt last.txt

   while [ "$revs" -lt "100" ]; do
      let "revs = $revs + 1"
      date >> test.txt
      tail -20 test.txt > other.txt
      tail -10 other.txt > last.txt
      head -5 other.txt >> last.txt
      svn commit -q -m "Testing $1 another revision: $revs"
   done

   cd /tmp
   rm -rf $dir
}

makeRevs 1 &
sleep 2
makeRevs 2 &
sleep 2
makeRevs 3 &
sleep 2
makeRevs 4 &
sleep 2
makeRevs 5 &
sleep 2
makeRevs 6 &
sleep 2
makeRevs 7 &
sleep 2
makeRevs 8 &
sleep 2
makeRevs 9 &
wait
echo "All done..."