Mailing List Archive

Trac interaction with Subversion
All-

I have been sucessfully using Subversion for months now and have built
up a substantial repository. Although the WebDAV parts are installed,
all my users access the repo with the file:/// URL. I have Subversion
1.0.1 installed.

I just recently installed Trac 0.7.rc1, and it appears to be somehow
trashing my repository. Here is the error a file:/// using client gets
after you've browsed the repo with Trac a few times:

bash-2.05b$ svn update
subversion/libsvn_ra_local/ra_plugin.c:161: (apr_err=180001)
svn: Unable to open an ra_local session to URL
subversion/libsvn_ra_local/split_url.c:109: (apr_err=180001)
svn: Unable to open repository
'file:///usr/local/svn/ipiEmbeddedSoftware/trunk/
emsw'
subversion/libsvn_fs/bdb/bdb-err.c:61: (apr_err=160029)
svn: Berkeley DB error while opening environment for filesystem
/usr/local/svn/i
piEmbeddedSoftware/db:
DB_RUNRECOVERY: Fatal error, run database recovery

I can do an svnadmin recover on the database, but this all means
downtime... I've read Chapter 6 of the SVN book, but nothing
immediately jumped out at me as a way to force Trac and the local users
to play nice together... Anybody out there have this working and also
be willing to share their configuration? Does Trac really need write
access to the Subversion repo? I tried making the Apache user part of a
group with read-only UNIX access to the repository, but Trac gives me a
Permission Denied when set like that...

Thanks in advance for support...

George Pulig
Lead Network Engineer
Ciena - gpulig@ciena.com
Trac interaction with Subversion [ In reply to ]
On Thu, May 20, 2004 at 12:17:07PM -0400, G. Pulig wrote:
> I can do an svnadmin recover on the database, but this all means
> downtime... I've read Chapter 6 of the SVN book, but nothing
> immediately jumped out at me as a way to force Trac and the local users
> to play nice together... Anybody out there have this working and also
> be willing to share their configuration? Does Trac really need write
> access to the Subversion repo? I tried making the Apache user part of a
> group with read-only UNIX access to the repository, but Trac gives me a
> Permission Denied when set like that...

You need write access to the Subversion repository to read it. This
has nothing to do with Trac.

Make sure you're not using file:/// access across any kind of network
filesystem; if so, you should be using svnserve or mod_dav_svn
instead.

--
=Nicholas Riley <njriley@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
Re: Trac interaction with Subversion [ In reply to ]
Nicholas Riley wrote:
> On Thu, May 20, 2004 at 12:17:07PM -0400, G. Pulig wrote:
>
>> I can do an svnadmin recover on the database, but this all means
>>downtime... I've read Chapter 6 of the SVN book, but nothing
>>immediately jumped out at me as a way to force Trac and the local users
>>to play nice together... Anybody out there have this working and also
>>be willing to share their configuration? Does Trac really need write
>>access to the Subversion repo? I tried making the Apache user part of a
>>group with read-only UNIX access to the repository, but Trac gives me a
>>Permission Denied when set like that...
>
>
> You need write access to the Subversion repository to read it. This
> has nothing to do with Trac.
>
> Make sure you're not using file:/// access across any kind of network
> filesystem; if so, you should be using svnserve or mod_dav_svn
> instead.
>
Hi Nicholas-

Thank you for the quick response! Thanks for the clarification on the
readability of Subversion, I can correct that. I'm not using file:///
over the network, it's all local to the same server. I made sure to
heed the NFS warnings when I did the Subversion install!

Any idea how I can tighten down the permissions for Trac in Apache so
it doesn't trounce my svn client users and my database? Other than what
is in INSTALL, are there any other special configurations I can do for Trac?

G
Re: Trac interaction with Subversion [ In reply to ]
On Thu, May 20, 2004 at 01:55:22PM -0400, G. Pulig wrote:
> Any idea how I can tighten down the permissions for Trac in
> Apache so it doesn't trounce my svn client users and my database?
> Other than what is in INSTALL, are there any other special
> configurations I can do for Trac?

You might try setting the umask in trac.cgi. Change:

try:
import trac.core
trac.core.cgi_start()

to:

try:
import trac.core
import os
os.umask(0)
trac.core.cgi_start()

This should ensure that Subversion doesn't reset the permissions on
the Subversion BDB files.

--
=Nicholas Riley <njriley@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
Re: Trac interaction with Subversion [ In reply to ]
Nicholas Riley wrote:
> On Thu, May 20, 2004 at 01:55:22PM -0400, G. Pulig wrote:
>
>> Any idea how I can tighten down the permissions for Trac in
>>Apache so it doesn't trounce my svn client users and my database?
>>Other than what is in INSTALL, are there any other special
>>configurations I can do for Trac?
>
>
> You might try setting the umask in trac.cgi. Change:
>
> try:
> import trac.core
> trac.core.cgi_start()
>
> to:
>
> try:
> import trac.core
> import os
> os.umask(0)
> trac.core.cgi_start()
>
> This should ensure that Subversion doesn't reset the permissions on
> the Subversion BDB files.
>
Hi Nicholas-

That doesn't seem to do it... I can reproduce the problem pretty
readily... To test this, for example, I removed my Subversion view and
then started a file:/// checkout of the repository. With the above
changes in the trac.cgi file, I brought up Trac and clicked on
Timelines. The minute I did that, my checkout window popped up with:

subversion/libsvn_fs/bdb/bdb-err.c:61: (apr_err=160029)
svn: Berkeley DB error while beginning Berkeley DB transaction for
filesystem /usr/local/svn/ipiEmbeddedSoftware/db:
DB_RUNRECOVERY: Fatal error, run database recovery

And I had to recover my database... Any other things I could look at?
Again, thank you for helping me with this!

G
Re: Trac interaction with Subversion [ In reply to ]
G. Pulig wrote:
> Nicholas Riley wrote:
>
>> On Thu, May 20, 2004 at 01:55:22PM -0400, G. Pulig wrote:
>>
>>> Any idea how I can tighten down the permissions for Trac in
>>> Apache so it doesn't trounce my svn client users and my database?
>>> Other than what is in INSTALL, are there any other special
>>> configurations I can do for Trac?
>>
>>
>>
>> You might try setting the umask in trac.cgi. Change:
>>
>> try:
>> import trac.core
>> trac.core.cgi_start()
>>
>> to:
>>
>> try:
>> import trac.core
>> import os
>> os.umask(0)
>> trac.core.cgi_start()
>>
>> This should ensure that Subversion doesn't reset the permissions on
>> the Subversion BDB files.
>>
> Hi Nicholas-
>
> That doesn't seem to do it... I can reproduce the problem pretty
> readily... To test this, for example, I removed my Subversion view and
> then started a file:/// checkout of the repository. With the above
> changes in the trac.cgi file, I brought up Trac and clicked on
> Timelines. The minute I did that, my checkout window popped up with:
>
> subversion/libsvn_fs/bdb/bdb-err.c:61: (apr_err=160029)
> svn: Berkeley DB error while beginning Berkeley DB transaction for
> filesystem /usr/local/svn/ipiEmbeddedSoftware/db:
> DB_RUNRECOVERY: Fatal error, run database recovery
>
> And I had to recover my database... Any other things I could look
> at? Again, thank you for helping me with this!
>
> G
Hi Nicholas-

I was rereading your post, and I think your track about permissions was
correct... In my case, even though my local svn client users are part
of the UNIX group with write permissions to the repository, their main
group is not the svn group. Their log files inside the repository
reflect this.

I added the Apache user to the primary user group, and now, at least
with a test repository, I haven't been able to reproduce the crash...
I'll test it more tomorrow and see.

Thanks!

G