Cannot open file 'svn / repo / db / txn-current-lock': permission denied

I installed Linux Server and installed Apache and SVN and dav_svn on it. Now when I try to upload to https://xxxx:x/svn/repo using Tortoise SVN, I get

 Can't open file '/server/svn/repo/db/txn-current-lock': Permission denied 

I configured my SSL correctly (I can verify no problems even remotely due to port forwarding).

I assume that this is due to Linux belonging to the repository folders, how do I install this / what commands?

+47
svn apache
Jun 06 '09 at 18:20
source share
8 answers

This is a common problem. You almost certainly run into permission problems. To solve this problem, make sure the apache user has read / write access to the entire repository. For this, chown -R apache:apache * , chmod -R 664 * for everything that is in your svn repository.

Also see here and here if you are still stuck.




Refresh to answer additional OP question in comments:

Line "664" is an octal (base 8) representation of permissions. There are three numbers here that represent permissions for the owner, group, and everyone else (sometimes called the "world") respectively for this file or directory.

Note that each basic 8-bit digit can be represented by three bits (000 for "0" - "111" for "7"). Each bit means something:

  • first bit: read permissions
  • second bit: write permissions
  • third bit: execute permissions

For example, 764 in a file would mean that:

  • owner (first digit) has the right to read / write / execute (7)
  • group (second digit) has read / write permission (6)
  • everyone else (third digit) read (4) permission

Hope this clears up!

+67
Jun 06 '09 at 18:31
source share

This is a resolution issue. These are not the "classic" read and write permissions of the apache user, but selinux one.

Apache cannot write files marked as httpd_sys_content_t ; only apache can read them.

You have 2 options:

  • mark svn repository files as httpd_sys_content_rw_t :

     chcon -R -t httpd_sys_content_rw_t /path/to/your/svn/repo 
  • set selinux boolean httpd_unified --> on

     setsebool -P httpd_unified=1 

I prefer the second opportunity. You can play also with other selinux boolean related to httpd :

 getsebool -a | grep httpd 
+13
May 29 '11 at 11:08
source share

I also had this problem recently, and it was SELinux that caused it. I tried to send a post-commit subversion campaign to notify Jenkins that the code had changed, so Jenkins built and deployed Nexus.

I needed to do the following to make it work.

1) First I checked if SELinux is enabled:

  less /selinux/enforce 

This will result in output 1 (for turning on) or 0 (for turning off)

2) Temporarily disable SELinux:

  echo 0 > /selinux/enforce 

Now check if it works now.

3) Enable SELinux:

  echo 1 > /selinux/enforce 

Change the policy for SELinux.

4) First view the current configuration:

  /usr/sbin/getsebool -a | grep httpd 

This will give you: httpd_can_network_connect -> off

5) Turn this feature on, and your post commit will work with SELinux:

  /usr/sbin/setsebool -P httpd_can_network_connect on 

Now it should work again.

+3
Mar 14 '13 at 11:52
source share

e.g. debian

 sudo gpasswd -a svn-admin www-data sudo chgrp -R www-data svn/ sudo chmod -R g=rwsx svn/ 
+1
Feb 17 2018-12-17T00:
source share

In addition to repository permissions, the /tmp must also be writable by all users.

0
Apr 29 '12 at 18:44
source share

I had this problem

  • Having multiple users using the same repo caused a problem.
  • Log out of another user’s evey using repo

Hope this helps

0
Jul 16 '13 at 12:05
source share

3 steps you can follow

  •  chmod -R 775 <repopath> --->permissions for repository 
  •  chown -R apache:apache <repo path> ---> change owner as like svn conf file 
  •  chcon -R -t httpd_sys_content_t /<repo path> ----> change security context for svn repositary 
0
May 18 '17 at 5:34 a.m.
source share

Try disabling SELinux with this command /usr/sbin/setenforce 0 . In my case, he solved the problem.

-one
Jun 14 '10 at 16:19
source share



All Articles