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

前端 未结 8 910
花落未央
花落未央 2020-12-07 13:20

I have set up a Linux Server and installed Apache and SVN and dav_svn on it. Now, when I try to upload to https://x.x.x.x:x/svn/repo with Tortoise SVN I get

相关标签:
8条回答
  • Try to disable SELinux by this command /usr/sbin/setenforce 0. In my case it solved the problem.

    0 讨论(0)
  • 2020-12-07 13:50

    It's permission problem. It is not "classic" read/write permissions of apache user, but selinux one.

    Apache cannot write to files labeled as httpd_sys_content_t they can be only read by apache.

    You have 2 possibilities:

    1. label svn repository files as httpd_sys_content_rw_t:

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

      setsebool -P httpd_unified=1
      

    I prefer 2nd possibility. You can play also with other selinux booleans connected with httpd:

    getsebool -a | grep httpd
    
    0 讨论(0)
  • 2020-12-07 13:51

    for example on debian

    sudo gpasswd -a svn-admin www-data
    sudo chgrp -R www-data svn/
    sudo chmod -R g=rwsx svn/
    
    0 讨论(0)
  • 2020-12-07 13:52

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

    0 讨论(0)
  • 2020-12-07 13:53

    This is a common problem. You're almost certainly running into permissions issues. To solve it, make sure that the apache user has read/write access to your entire repository. To do that, chown -R apache:apache *, chmod -R 664 * for everything under your svn repository.

    Also, see here and here if you're still stuck.


    Update to answer OP's additional question in comments:

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

    Notice that each base 8 digit can be represented with 3 bits (000 for '0' through 111 for '7'). Each bit means something:

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

    For example, 764 on a file would mean that:

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

    Hope that clears things up!

    0 讨论(0)
  • 2020-12-07 13:54

    I just had this problem

    1. Having multiple user using the same repo caused the problem
    2. Logout evey other user using the repo

    Hope this helps

    0 讨论(0)
提交回复
热议问题