SubversionException: 13 - Can't open file '/var/rancid/SVN/format': Permission denied

2,120 views
Skip to first unread message

Aaron Claessens

unread,
Nov 5, 2015, 5:12:41 PM11/5/15
to Trac Users
I'm struggling with what would seem to be a permission issue ... 

Cent OS 7 + Apache + Trac 1.0 + SVN

I've gave apache group permissions to the directory, when that didn't work I chmod 777 the whole thing ... still no luck 

SELinux is disabled

I had to punt a bit on the http conf as the guide I was using has everything in root and I have other things on the server ... so it might be an issue in there


<VirtualHost my.host:80>
        <Location /bob>
           SetHandler mod_python
           PythonInterpreter main_interpreter
           PythonHandler trac.web.modpython_frontend
           #PythonPath "sys.path + ['/var/trac/netconf']"
           PythonOption TracEnv /var/trac/netconf
           PythonOption TracEnvParentDir /var/trac/netconf
           PythonOption TracUriRoot /bob
            # PythonOption TracEnvIndexTemplate /var/local/trac/templates/index-template.html
           PythonOption TracLocale en_US.UTF8
           PythonOption PYTHON_EGG_CACHE /tmp
           Order allow,deny
           Allow from all
        </Location>
        <Location /login>
          AuthType Basic
          AuthName "Netconf"
          AuthUserFile /var/trac/netconf/.htpasswd
          Require valid-user
        </Location>
</VirtualHost>


I'm missing something simple I'm sure ... but some help would be appreciated

Thanks


RjOllos

unread,
Nov 5, 2015, 5:44:20 PM11/5/15
to Trac Users
On Thursday, November 5, 2015 at 2:12:41 PM UTC-8, Aaron Claessens wrote:
I'm struggling with what would seem to be a permission issue ... 

Cent OS 7 + Apache + Trac 1.0 + SVN

I've gave apache group permissions to the directory, when that didn't work I chmod 777 the whole thing ... still no luck 

What is the ownership and permissions of the file /var/rancid/SVN/format?

If /var/rancid/SVN is a valid Subversion repository, then to my knowledge all the files within that directory need the owner and group to be www-data (or perhaps the equivalent of www-data is the apache user on CentOS? ... I'm not sure since I've only used Debian-like systems for many years).

- Ryan

Aaron Claessens

unread,
Nov 5, 2015, 6:13:22 PM11/5/15
to Trac Users

-rw-rw-r-- 1 apache apache    2 Nov  3 10:12 format

The whole sub directory is like that ... 

I think that apache should be the equivalent of www-data

Aaron

Ryan Ollos

unread,
Nov 5, 2015, 6:26:55 PM11/5/15
to Trac Users
On Thu, Nov 5, 2015 at 3:13 PM, Aaron Claessens <aaron.c...@gmail.com> wrote:

-rw-rw-r-- 1 apache apache    2 Nov  3 10:12 format

The whole sub directory is like that ... 

I think that apache should be the equivalent of www-data

Aaron

When is that error seen? When browsing the repository? 

Are you able to log into Trac and access realms other than /browser?

Aaron Claessens

unread,
Nov 5, 2015, 7:40:40 PM11/5/15
to Trac Users, ryan.j...@gmail.com

Humm ... maybe this is related to the apache config ...  should I be seeing a login? 

I go to http://server/bob  ... I never see a login; a screen loads and I see the error. 

Thanks
screen.png

Ryan Ollos

unread,
Nov 5, 2015, 8:02:43 PM11/5/15
to Aaron Claessens, Trac Users
On Thu, Nov 5, 2015 at 4:40 PM, Aaron Claessens <aaron.c...@gmail.com> wrote:

Humm ... maybe this is related to the apache config ...  should I be seeing a login? 

I go to http://server/bob  ... I never see a login; a screen loads and I see the error. 

Thanks

I'm guessing CentOS 7 has Apache 2.4. If that's the case, you'll need to modify the Apache configuration to use the "Require all granted" directive rather than "Order allow, deny; Allow from all". I've updated the documentation for Apache 2.4 to show this:

Second, I think you should look at the paths in your Location directives. If you are accessing the Trac instance at http://domain.com/bob, then the second directive should be <Location /bob/login>. Alternatively you could change the first Location directive to <Location />, if you are accessing Trac at http://domain.com/

You don't need to specify both TracEnvParentDir and TracEnvDir. If you are running a single Trac project you can just use the latter.
 

Aaron Claessens

unread,
Nov 5, 2015, 9:14:32 PM11/5/15
to Trac Users, aaron.c...@gmail.com, ryan.j...@gmail.com

Thanks ... I caught the "/login" as I was going through it again and was able to get to the admin console ... but the other updates haven't made a difference ... 

<VirtualHost *:80>
        <Location /bob>
           SetHandler mod_python
           PythonInterpreter main_interpreter
           PythonHandler trac.web.modpython_frontend
           #PythonPath "sys.path + ['/var/trac/netconf']"
           PythonOption TracEnv /var/trac/netconf
           #PythonOption TracEnvParentDir /var/trac/netconf
           PythonOption TracUriRoot /bob
            # PythonOption TracEnvIndexTemplate /var/local/trac/templates/index-template.html
           PythonOption TracLocale en_US.UTF8
           PythonOption PYTHON_EGG_CACHE /tmp
           Require all granted
        </Location>
        <Location /bob/login>
          AuthType Basic
          AuthName "Netconf"
          AuthUserFile /var/trac/netconf/.htpasswd
          Require valid-user
        </Location>
</VirtualHost>

RjOllos

unread,
Nov 5, 2015, 9:51:31 PM11/5/15
to Trac Users
>Thanks ... I caught the "/login" as I was going through it again and was able to get to the admin console ... but the other updates haven't made a difference ...

Does that mean you can authenticate and you see the main nav bar? Can you post a screen capture of what you see now?

Aaron Claessens

unread,
Nov 6, 2015, 7:58:11 AM11/6/15
to Trac Users
Yes .. I was able to authenticate and get to the nav bar ... but still no real "data"
admin_acreen.png
main_screen.png

Ryan Ollos

unread,
Nov 6, 2015, 8:25:39 AM11/6/15
to Trac Users
On Fri, Nov 6, 2015 at 4:58 AM, Aaron Claessens <aaron.c...@gmail.com> wrote:
Yes .. I was able to authenticate and get to the nav bar ... but still no real "data"

I'm unsure what the issue might be if it's not a straightforward permission issue. What version of Subversion are you running? (use "svn --version" to check)

You could try adding an entry in your virtualhost config for serving Subversion over HTTP, and then check if Subversion can be browsed over HTTP. The configuration shown in this post looks correct:
The author of the post reports the same issue as you, but the cause he found sounds bogus to me.

You could also try removing the repository configuration from Trac (by commenting it out, assuming you've defined it in trac.ini), just to confirm that Trac works correctly aside from this issue with Subversion.

- Ryan

Aaron Claessens

unread,
Nov 6, 2015, 10:10:28 AM11/6/15
to Trac Users
Got the main part ... 

it was a permission issue ... 

/var/rancid/SVN was setup correctly, but with my lack of understanding ... /var/rancid needed to be owned by apache 

Now ... I need to get some authentication going on it as when I go to server/bob it just lets me in

Thanks!

RjOllos

unread,
Nov 10, 2015, 2:24:15 PM11/10/15
to Trac Users
On Friday, November 6, 2015 at 7:10:28 AM UTC-8, Aaron Claessens wrote:
Got the main part ... 

it was a permission issue ... 

/var/rancid/SVN was setup correctly, but with my lack of understanding ... /var/rancid needed to be owned by apache 

Now ... I need to get some authentication going on it as when I go to server/bob it just lets me in

Thanks!

Good find! I've seen that issue a number of times in the past, but still it didn't come to mind when considering your issue.

Feel free to post here again if you have any trouble setting up the authentication.

- Ryan 
Reply all
Reply to author
Forward
0 new messages