You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Barry Scott <ba...@barrys-emacs.org> on 2024/12/13 17:09:08 UTC

Can't set permissions on 'barrys-sources/db/revs/2': Operation not permitted

I have a svn repo hosted on a Fedora server that I access via http: using
mod_dav_svn-1.14.4-1.fc41.x86_64.

The repo has 1999 revs in it but fails to create rev 2000 with these errors
in the httpd error log:

[dav:error] An error occurred while committing the transaction.  [500, #1]
[dav:error] Can't set permissions on '/shared/SourceControl/barrys-sources/db/revs/2'  [500, #1]
[dav:error] Can't set permissions on '/shared/SourceControl/barrys-sources/db/revs/2': Operation not permitted  [500, #1]

As use apache I can create and delete a the file

/shared/SourceControl/barrys-sources/db/revs/2/tmp

I have tried to svnadmin dump and svnadmin load to see if that makes a difference.
But the problem is identical on the old and new repos.

What do I need to investigate and fix to allow rev 2000?

Barry


Re: Can't set permissions on 'barrys-sources/db/revs/2': Operation not permitted

Posted by Barry Scott <ba...@barrys-emacs.org>.

> On 15 Dec 2024, at 15:52, Nathan Hartman <ha...@gmail.com> wrote:
> 
> (Apologies for the duplicate; I meant to respond to the users@ list
> but omitted it the first time...)
> 
> On Fri, Dec 13, 2024 at 12:10 PM Barry Scott <ba...@barrys-emacs.org> wrote:
>> 
>> I have a svn repo hosted on a Fedora server that I access via http: using
>> mod_dav_svn-1.14.4-1.fc41.x86_64.
>> 
>> The repo has 1999 revs in it but fails to create rev 2000 with these errors
>> in the httpd error log:
>> 
>> [dav:error] An error occurred while committing the transaction.  [500, #1]
>> [dav:error] Can't set permissions on '/shared/SourceControl/barrys-sources/db/revs/2'  [500, #1]
>> [dav:error] Can't set permissions on '/shared/SourceControl/barrys-sources/db/revs/2': Operation not permitted  [500, #1]
>> 
>> As use apache I can create and delete a the file
>> 
>> /shared/SourceControl/barrys-sources/db/revs/2/tmp
>> 
>> I have tried to svnadmin dump and svnadmin load to see if that makes a difference.
>> But the problem is identical on the old and new repos.
>> 
>> What do I need to investigate and fix to allow rev 2000?
>> 
>> Barry
> 
> 
> Hi Barry,
> 
> I would check permissions and ownership

I had set the ownership with `chown -R apache: <repo-dir>` so
assumed that had set everything to allow apache user to do what it wants.

I could not find any file with the wrong permissions.

What "fixed" it was using sudo svn mkdir file:///<repo-dir>/Test <file:////%3Crepo-dir%3E/Test>
to force the creation of a rev 2000. Then I fixed the perms that using
root changed the revs/2 dir and the 2000 file.

I did this on the svnadmin loaded new repos.

After that apache user can create revs.

I still have the original "bad" repo as-is and it does not have any
permission issue I can see.

> 
> It looks like you already verified that user 'apache' can create a
> file in in the db/revs/2 subdirectory. However, only the owner* of a
> file or directory can change its permissions. Is 'apache' the owner of
> the '2' subdirectory?
> 
> Since it worked until revision 1999, who is the owner of the '1'
> subdirectory (which contains revs 1000-1999) and how are its
> permissions?
> 
> Also who is the owner of the parent 'revs' subdirectory and how are
> its permissions?
> 
> It's possible that some time in the past, after revision 1000 but
> before now, that the ownership of these directories changed for some
> reason. Software updates? Moving things to a new hard drive? A
> permissions check that automatically "fixed" things? It wasn't noticed
> until now because the '2' subdirectory isn't created until revision
> 2000.

I have to assume that is the case but I cannot see the error and it my mistake.

All files are owned by apache:apache

Here is ll of the original bad repo:

$ ll barrys-sources.bad/db
total 2680
-rw-r--r--. 1 apache apache       5 2024-12-13 15:49:15 current
-r--r--r--. 1 apache apache      22 2011-05-22 13:26:57 format
-rw-r--r--. 1 apache apache    1920 2011-05-22 13:26:57 fsfs.conf
-rw-r--r--. 1 apache apache       5 2011-05-22 13:26:57 fs-type
drwxr-sr-x. 6 apache apache    4096 2016-06-19 20:31:18 locks/
-rw-r--r--. 1 apache apache       2 2011-05-22 13:26:57 min-unpacked-rev
-rw-r--r--. 1 apache apache 2690048 2024-12-13 15:49:15 rep-cache.db
-rw-r--r--. 1 apache apache       0 2024-12-13 15:49:15 rep-cache.db-journal
drwxr-sr-x. 4 apache apache    4096 2016-08-10 16:30:28 revprops/
drwxr-sr-x. 5 apache apache    4096 2024-12-13 15:49:45 revs/
drwxr-sr-x. 2 apache apache    4096 2024-12-13 16:19:04 transactions/
-rw-r--r--. 1 apache apache       4 2024-12-13 16:19:01 txn-current
-rw-r--r--. 1 apache apache       0 2011-05-22 13:26:57 txn-current-lock
drwxr-sr-x. 2 apache apache    4096 2024-12-13 16:19:04 txn-protorevs/
-rw-r--r--. 1 apache apache      37 2011-05-22 13:43:56 uuid
-rw-r--r--. 1 apache apache       0 2011-05-22 13:26:57 write-lock

$ ll barrys-sources.bad/db/revs
total 44
drwxr-sr-x. 2 apache apache 20480 2016-07-22 10:28:14 0/
drwxr-sr-x. 2 apache apache 20480 2024-12-13 15:49:15 1/
drwxr-sr-x. 2 apache apache  4096 2024-12-13 15:49:45 2/

FYI I have selinux in permissive mode so that does not have any effect.


> 
> [*] It's not strictly true that *only* the owner of a file or
> directory may change its permissions. The root user may also do so;
> however, please *don't* run the server as root!

Now that would be a terrible idea!

Barry

> 
> Hope this helps,
> Nathan
> 


Re: Can't set permissions on 'barrys-sources/db/revs/2': Operation not permitted

Posted by Nathan Hartman <ha...@gmail.com>.
(Apologies for the duplicate; I meant to respond to the users@ list
but omitted it the first time...)

On Fri, Dec 13, 2024 at 12:10 PM Barry Scott <ba...@barrys-emacs.org> wrote:
>
> I have a svn repo hosted on a Fedora server that I access via http: using
> mod_dav_svn-1.14.4-1.fc41.x86_64.
>
> The repo has 1999 revs in it but fails to create rev 2000 with these errors
> in the httpd error log:
>
> [dav:error] An error occurred while committing the transaction.  [500, #1]
> [dav:error] Can't set permissions on '/shared/SourceControl/barrys-sources/db/revs/2'  [500, #1]
> [dav:error] Can't set permissions on '/shared/SourceControl/barrys-sources/db/revs/2': Operation not permitted  [500, #1]
>
> As use apache I can create and delete a the file
>
> /shared/SourceControl/barrys-sources/db/revs/2/tmp
>
> I have tried to svnadmin dump and svnadmin load to see if that makes a difference.
> But the problem is identical on the old and new repos.
>
> What do I need to investigate and fix to allow rev 2000?
>
> Barry


Hi Barry,

I would check permissions and ownership.

It looks like you already verified that user 'apache' can create a
file in in the db/revs/2 subdirectory. However, only the owner* of a
file or directory can change its permissions. Is 'apache' the owner of
the '2' subdirectory?

Since it worked until revision 1999, who is the owner of the '1'
subdirectory (which contains revs 1000-1999) and how are its
permissions?

Also who is the owner of the parent 'revs' subdirectory and how are
its permissions?

It's possible that some time in the past, after revision 1000 but
before now, that the ownership of these directories changed for some
reason. Software updates? Moving things to a new hard drive? A
permissions check that automatically "fixed" things? It wasn't noticed
until now because the '2' subdirectory isn't created until revision
2000.

[*] It's not strictly true that *only* the owner of a file or
directory may change its permissions. The root user may also do so;
however, please *don't* run the server as root!

Hope this helps,
Nathan