Discussion:
commit with exit code 255
Chris Stäbler
2012-06-17 13:41:30 UTC
Permalink
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
Nico Kadel-Garcia
2012-06-17 17:10:04 UTC
Permalink
On Sun, Jun 17, 2012 at 9:41 AM, Chris Stäbler
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.
Ryan Schmidt
2012-06-17 20:11:19 UTC
Permalink
Post by Chris Stäbler
Some of selected resources were not committed.
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://...)
#!/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 ("").
Ryan Schmidt
2012-06-17 20:18:29 UTC
Permalink
Post by Ryan Schmidt
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.
Post by Chris Stäbler
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
Nico Kadel-Garcia
2012-06-17 20:33:44 UTC
Permalink
On Sun, Jun 17, 2012 at 4:18 PM, Ryan Schmidt <
Post by Ryan Schmidt
Post by Ryan Schmidt
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.
Post by Ryan Schmidt
Post by Chris Stäbler
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
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.
Chris Stäbler
2012-06-18 10:30:08 UTC
Permalink
Post by Nico Kadel-Garcia
On Sun, Jun 17, 2012 at 4:18 PM, Ryan Schmidt <
Post by Ryan Schmidt
Post by Ryan Schmidt
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.
Post by Ryan Schmidt
Post by Chris Stäbler
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
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 :)
Chris Stäbler
2012-06-18 17:44:07 UTC
Permalink
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 <***@gmail.com>
On Sun, Jun 17, 2012 at 4:18 PM, Ryan Schmidt
Post by Ryan Schmidt
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
Post by Ryan Schmidt
Post by Chris Stäbler
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 :)
Ryan Schmidt
2012-06-18 23:24:33 UTC
Permalink
Post by Chris Stäbler
I tried it and it solved it in the first moment. But now I get the following
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?
Chris Stäbler
2012-06-19 18:42:59 UTC
Permalink
Post by Ryan Schmidt
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).

Continue reading on narkive:
Loading...