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:

/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?

3 Answers 3


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.

  • It must have been permission issue indeed. I chmoded both scripts and now it works. Thank you!
    – user26650
    Dec 7, 2009 at 21:35

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


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

  • That's why I'm using absolute paths.
    – user26650
    Dec 7, 2009 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, 2009 at 20:56

You must log in to answer this question.