You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Chris Stäbler <ch...@googlemail.com> on 2012/06/17 15:41:30 UTC

commit with exit code 255

Hello together,

 

a few days ago I set up a subversionserver. Now I wanted to check every
commit for some conventions. I tried it with an pre-commit hook but always
get the following error when I try to commit something:

 

      Some of selected resources were not committed.

      svn: E165001: Commit failed (details follow):

 

      svn: E165001: Commit failed (details follow):

      svn: E165001: Commit blocked by pre-commit hook (exit code 255) with
no output.

      svn: E175002: MERGE of '/svn/firstrepo/repotest/trunk': 409 Conflict
(http://...)

 

Here is the content of my pre-commit script:

 

      #!/bin/sh

      REPOS=”$1”

      TXN=”$2”

      echo “something for the output” 1>&2

      #cancel all commits for tests…

      exit 1

 

 

Every user has executerights for the hook.

I use svnserver version 1.6.8. 

Even with disabled firewall I can’t commit something (even from the
subversionserver itself)

 

What is wrong in my “configuration”?

Thanks for help


Re: commit with exit code 255

Posted by Chris Stäbler <ch...@googlemail.com>.
>
> Are you sure you've set the ownership *and* permissions *and* SELinux
> security context correctly for /var/www/svn *and* all of its contents
> recursively?
>
>
>
Hey even after I owned the whole svn folder by apache again and gave every
user read,write and execute rights it was not working.
When I set Selinux to permissive it worked. So it is 100% a problem of my
selinux configuration. but I don't know what exactly... (I set the
securitycontext for all files under /var/www/svn recursively to
httpd_sys_content_t).

Re: commit with exit code 255

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 18, 2012, at 12:44, Chris Stäbler wrote:

> I tried it and it solved it in the first moment. But now I get the following
> message when I try to commit:
> 
> svn: E204900: Commit failed (details follow):
> svn: E204900: Can't open file '/var/www/svn/firstrepo/db/txn-current-lock':
> Permission denied
> svn: E175002: MKACTIVITY of
> '/svn/firstrepo/!svn/act/889ead00-3801-0010-a8fd-51f4a60835a4': 500 Internal
> Server Error (http://... )
> 
> Even when I give every user read, write and execute rights (what's actually
> pretty stupid) I can't commit?

Are you sure you've set the ownership *and* permissions *and* SELinux security context correctly for /var/www/svn *and* all of its contents recursively?



AW: commit with exit code 255

Posted by Chris Stäbler <ch...@googlemail.com>.
Hey

I tried it and it solved it in the first moment. But now I get the following
message when I try to commit:

svn: E204900: Commit failed (details follow):
svn: E204900: Can't open file '/var/www/svn/firstrepo/db/txn-current-lock':
Permission denied
svn: E175002: MKACTIVITY of
'/svn/firstrepo/!svn/act/889ead00-3801-0010-a8fd-51f4a60835a4': 500 Internal
Server Error (http://... )

Even when I give every user read, write and execute rights (what's actually
pretty stupid) I can't commit?

Any ideas?
Thanks for help so far.


2012/6/17 Nico Kadel-Garcia <nk...@gmail.com>
On Sun, Jun 17, 2012 at 4:18 PM, Ryan Schmidt
<su...@ryandesign.com> wrote:

On Jun 17, 2012, at 15:11, Ryan Schmidt wrote:

> Chris, I get the same result as you, if I forget to mark the pre-commit
hook script as executable. So try "chmod 755
/path/to/repo/hooks/pre-commit", then try again.
Oops, I trimmed the part of your message where you said you already tried
that:

>> On Jun 17, 2012, at 08:41, Chris Stäbler wrote:
>>
>>> Every user has executerights for the hook.

If your Subversion server happens to be running on an operating system with
SELinux enabled, there are some additional issues you have to consider; see:

http://subversion.apache.org/faq.html#reposperms
 
This is especially true if you've set up your repositories in a conceptually
reasonable but non-standard location. The RPM's for RHEL and Fedora, for
example, hint at putting repositories in /var/www/svn, which is usually
covered by the SELinux rules for /var/www and can help avoid the problems.
 


my repository is set up at /var/www/svn (traditional place) 
But SELinux might be the problem (I am using fedora). I will try it when I
am back at home and report you my results :)



Re: commit with exit code 255

Posted by Chris Stäbler <ch...@googlemail.com>.
2012/6/17 Nico Kadel-Garcia <nk...@gmail.com>

> On Sun, Jun 17, 2012 at 4:18 PM, Ryan Schmidt <
> subversion-2012a@ryandesign.com> wrote:
>
>>
>> On Jun 17, 2012, at 15:11, Ryan Schmidt wrote:
>>
>> > Chris, I get the same result as you, if I forget to mark the pre-commit
>> hook script as executable. So try "chmod 755
>> /path/to/repo/hooks/pre-commit", then try again.
>>
>> Oops, I trimmed the part of your message where you said you already tried
>> that:
>>
>> >> On Jun 17, 2012, at 08:41, Chris Stäbler wrote:
>> >>
>> >>> Every user has executerights for the hook.
>>
>> If your Subversion server happens to be running on an operating system
>> with SELinux enabled, there are some additional issues you have to
>> consider; see:
>>
>> http://subversion.apache.org/faq.html#reposperms
>>
>
> This is especially true if you've set up your repositories in a
> conceptually reasonable but non-standard location. The RPM's for RHEL and
> Fedora, for example, hint at putting repositories in /var/www/svn, which is
> usually covered by the SELinux rules for /var/www and can help avoid the
> problems.
>
>
>
my repository is set up at /var/www/svn (traditional place)
But SELinux might be the problem (I am using fedora). I will try it when I
am back at home and report you my results :)

Re: commit with exit code 255

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Sun, Jun 17, 2012 at 4:18 PM, Ryan Schmidt <
subversion-2012a@ryandesign.com> wrote:

>
> On Jun 17, 2012, at 15:11, Ryan Schmidt wrote:
>
> > Chris, I get the same result as you, if I forget to mark the pre-commit
> hook script as executable. So try "chmod 755
> /path/to/repo/hooks/pre-commit", then try again.
>
> Oops, I trimmed the part of your message where you said you already tried
> that:
>
> >> On Jun 17, 2012, at 08:41, Chris Stäbler wrote:
> >>
> >>> Every user has executerights for the hook.
>
> If your Subversion server happens to be running on an operating system
> with SELinux enabled, there are some additional issues you have to
> consider; see:
>
> http://subversion.apache.org/faq.html#reposperms
>

This is especially true if you've set up your repositories in a
conceptually reasonable but non-standard location. The RPM's for RHEL and
Fedora, for example, hint at putting repositories in /var/www/svn, which is
usually covered by the SELinux rules for /var/www and can help avoid the
problems.

Re: commit with exit code 255

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 17, 2012, at 15:11, Ryan Schmidt wrote:

> Chris, I get the same result as you, if I forget to mark the pre-commit hook script as executable. So try "chmod 755 /path/to/repo/hooks/pre-commit", then try again.

Oops, I trimmed the part of your message where you said you already tried that:

>> On Jun 17, 2012, at 08:41, Chris Stäbler wrote:
>> 
>>> Every user has executerights for the hook.

If your Subversion server happens to be running on an operating system with SELinux enabled, there are some additional issues you have to consider; see:

http://subversion.apache.org/faq.html#reposperms


Re: commit with exit code 255

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jun 17, 2012, at 12:10, Nico Kadel-Garcia wrote:

> On Jun 17, 2012, at 08:41, Chris Stäbler wrote:
> 
>> a few days ago I set up a subversionserver. Now I wanted to check every commit for some conventions. I tried it with an pre-commit hook but always get the following error when I try to commit something:
>>  
>>       Some of selected resources were not committed.
>>       svn: E165001: Commit failed (details follow):
>>  
>>       svn: E165001: Commit failed (details follow):
>>       svn: E165001: Commit blocked by pre-commit hook (exit code 255) with no output.
>>       svn: E175002: MERGE of '/svn/firstrepo/repotest/trunk': 409 Conflict (http://...)
>>  
>> Here is the content of my pre-commit script:
>>  
>>       #!/bin/sh
>>       REPOS=”$1”
>>       TXN=”$2”
>>       echo “something for the output” 1>&2
>>       #cancel all commits for tests…
>>       exit 1
> 
> In Bash and in most programming languages, "exit 1" means failure. "exit 0" means success and is probably what you should be using.

Nico, I think Chris knows that. He's trying to verify that a simple test pre-commit hook script prints the error message he wrote ("something for the output") and exits with the error code he specified (1). From the output he showed above, neither is happening; it prints no output, and it exits with code 255. He's asking why that's happening.

Chris, I get the same result as you, if I forget to mark the pre-commit hook script as executable. So try "chmod 755 /path/to/repo/hooks/pre-commit", then try again.

Also, not sure if it was a copy/paste error with your email program, but the script you showed above contains smart quotes (“”); for a bash script, you'll want to use straight quotes ("").



Re: commit with exit code 255

Posted by Nico Kadel-Garcia <nk...@gmail.com>.
On Sun, Jun 17, 2012 at 9:41 AM, Chris Stäbler
<ch...@googlemail.com>wrote:

> Hello together,****
>
> ** **
>
> a few days ago I set up a subversionserver. Now I wanted to check every
> commit for some conventions. I tried it with an pre-commit hook but always
> get the following error when I try to commit something:****
>
> ** **
>
>       Some of selected resources were not committed.****
>
>       svn: E165001: Commit failed (details follow):****
>
> ** **
>
>       svn: E165001: Commit failed (details follow):****
>
>       svn: E165001: Commit blocked by pre-commit hook (exit code 255) with
> no output.****
>
>       svn: E175002: MERGE of '/svn/firstrepo/repotest/trunk': 409 Conflict
> (http://...)****
>
> ** **
>
> Here is the content of my pre-commit script:****
>
> ** **
>
>       #!/bin/sh****
>
>       REPOS=”$1”****
>
>       TXN=”$2”****
>
>       echo “something for the output” 1>&2****
>
>       #cancel all commits for tests…****
>
>       exit 1****
>
> ** **
>
> ** **
>
> Every user has executerights for the hook.****
>
> I use svnserver version 1.6.8. ****
>
> Even with disabled firewall I can’t commit something (even from the
> subversionserver itself)****
>
> ** **
>
> What is wrong in my “configuration”?****
>
> Thanks for help****
>

In Bash and in most programming languages, "exit 1" means failure. "exit 0"
means success and is probably what you should be using.