Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to use the standard Trac post-commit-hook for SVN.

I'm using Trac 0.11.4 and have downloaded this hook from their site. I've put it into /usr/local/bin/ and chmod +x'ed it. The post-commit hook in /var/svn/myrepo/hooks/ looks just as Trac Guide advises:

#!/bin/sh
REPOS="$1"
REV="$2"
TRAC_ENV="/var/trac/mytracenv"
/usr/bin/python /usr/local/bin/trac-post-commit-hook -p "$TRAC_ENV" -r "$REV"

Trac environment directory /var/trac/mytracenv is writable for Subversion user. I'm running standalone svnserve, no Apache.

If I run /usr/bin/python /usr/local/bin/trac-post-commit-hook -p /var/trac/mytracenv -r <somerev> manually as Subversion user, it works as it should. However if I do a commit (using TortoiseSVN) it says:

Error post-commit hook failed (exit code 255) with no output.

What's the problem?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

I assume the problem is permission-related. Make sure both the post-commit script and the rac-post-commit-hook have the proper privileges. If it works for you using the command line, try to do it as the user that is running the svn daemon (sudo -u svnuser [cmd]).

I could fix a similar problem a year or so ago by adding "chmod o+x" both of the scripts.

share|improve this answer
    
It must have been permission issue indeed. I chmoded both scripts and now it works. Thank you! –  user26650 Dec 7 '09 at 21:35

let's 'set -x' in the script for troubleshooting.

share|improve this answer

Double-check the environment variables; one of the most common causes is not having the $PATH you expect.

share|improve this answer
    
That's why I'm using absolute paths. –  user26650 Dec 7 '09 at 20:02
    
Sorry, I was thinking there was something inside the trac-post-commit-hook that might be affected by that, but glancing over it again, I don't see anything. You might add an echo to the post-commit hook to verify that part is getting executed. –  retracile Dec 7 '09 at 20:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.