After creating a new svn repository hosted by Phabricator, commit attempts fail with the following error message:
svn: E165001: Commit blocked by pre-commit hook (exit code 255) with no output.
This has proven very difficult to debug. Apparently it often signifies issues such as incorrect permissions or attempts at using programs that aren't available in the environment in which svn hooks are run. I have also seen where users ran into issues with SELinux as well as other miscellaneous issues, such as syntax errors in the offending hook script.
It doesn't seem as though there should be anything wrong with the contents of the hook script, seeing as it is provided by Phabricator and probably works for most users. The permissions and ownership are set by Phabricator as well and the directories look like this:
sudo ls -la /var/repo/SVN/ total 16 drwxr-xr-x. 6 phd phd 80 Dec 4 14:28 . drwxr-xr-x. 7 phd phd 70 Dec 4 14:38 .. drwxr-xr-x. 2 phd phd 72 Dec 4 14:28 conf drwxr-sr-x. 6 phd phd 4096 Dec 4 14:42 db -r--r--r--. 1 phd phd 2 Dec 4 14:28 format drwxr-xr-x. 3 phd phd 4096 Dec 4 14:28 hooks drwxr-xr-x. 2 phd phd 39 Dec 4 14:28 locks -rw-r--r--. 1 phd phd 246 Dec 4 14:28 README.txt sudo ls -la /var/repo/SVN/hooks/ total 44 drwxr-xr-x. 3 phd phd 4096 Dec 4 14:28 . drwxr-xr-x. 6 phd phd 80 Dec 4 14:28 .. -rwxr-xr-x. 1 phd phd 2062 Dec 4 14:28 post-commit.tmpl -rwxr-xr-x. 1 phd phd 1638 Dec 4 14:28 post-lock.tmpl -rwxr-xr-x. 1 phd phd 2289 Dec 4 14:28 post-revprop-change.tmpl -rwxr-xr-x. 1 phd phd 1567 Dec 4 14:28 post-unlock.tmpl -rwxr-xr-x. 1 phd phd 123 Dec 4 16:48 pre-commit drwxr-xr-x. 2 phd phd 19 Dec 4 14:28 pre-commit-phabricator.d -rwxr-xr-x. 1 phd phd 3426 Dec 4 14:28 pre-commit.tmpl -rwxr-xr-x. 1 phd phd 2434 Dec 4 14:28 pre-lock.tmpl -rwxr-xr-x. 1 phd phd 2786 Dec 4 14:28 pre-revprop-change.tmpl -rwxr-xr-x. 1 phd phd 2122 Dec 4 14:28 pre-unlock.tmpl -rwxr-xr-x. 1 phd phd 3163 Dec 4 14:28 start-commit.tmpl
I am not using SELinux, it is disabled.
Other repository functions seem to be working. I can checkout code with no issues. If I create a git repository hosted by Phabricator I can commit to that as well, although there may be so many differences between the two that this is completely irrelevant.
For testing purposes, I disabled the Phabricator daemons and used a much simpler hook script, which looks like this:
#!/bin/sh echo "testing" >&2 exit 1
In this context, running this command:
svn mkdir svn+ssh://vcs@phabricator.example.com/diffusion/SVN/TestFolder -m "Test commit hooks"
yields this output:
svn: E165001: Commit blocked by pre-commit hook (exit code 255) with no output.
It may be interesting to know that this command actually results in the script running successfully:
sudo svn mkdir file:///var/repo/SVN/TestFolder -m "Test commit hooks" svn: E165001: Commit blocked by pre-commit hook (exit code 1) with output: testing
If I enable the daemons and try the same, the simple hook script used for testing is overwritten and I get the following results:
svn mkdir svn+ssh://vcs@phabricator.example.com/diffusion/SVN/TestFolder -m "Test commit hooks" svn: E165001: Commit blocked by pre-commit hook (exit code 255) with no output. sudo svn mkdir file:///var/repo/SVN/TestFolder -m "Test commit hooks" svn: E165001: Commit blocked by pre-commit hook (exit code 255) with output: [2015-12-07 13:09:01] EXCEPTION: (Exception) No such user "root"! at [<phabricator>/scripts/repository/commit_hook.php:108] arcanist(head=master, ref.master=4a680c762b2e), phabricator(head=master, ref.master=ef820ed1ee29), phutil(head=master, ref.master=a8143ced646d)
For what it's worth, at least one other user seems to have run into this same issue: https://secure.phabricator.com/Q180
I have also asked for help on stackoverflow and the svn mailing list:
http://stackoverflow.com/questions/33789148/svn-e165001-commit-blocked-by-pre-commit-hook-exit-code-255-with-no-output
http://svn.haxx.se/users/archive-2015-12/0003.shtml
Please let me know if there is information I can provide that may be useful. I've been trying to solve this for a while now and tried many things, but it's hard to predict what information may help and what is just useless.