[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: foven <effoven_at_gmail.com>
Date: Tue, 1 Dec 2015 11:30:12 -0500

Hi,

This is my first time posting here. Hopefully I'm posting to the right
list with the right formatting and such. Please let me know if I have
made any mistakes.

I am not subscribed to the list and would appreciate being CC:ed
in any responses.

I have already posted a description of my issue here:
http://stackoverflow.com/questions/33789148/svn-e165001-commit-blocked-by-pre-commit-hook-exit-code-255-with-no-output
I'm not sure if I should replicate that post entirely here or try to
provide the parts that I feel may be more useful and try to avoid what
may be useless detail. For now I will attempt the latter, but it may
be useful to view the link as well. I can also copy the post if that
is desired.

I'm configuring Phabricator to host a repository and almost everything
seems to be working. The only issue that I'm currently aware of is
that commits are never successful. Instead the client always gives a
message "svn: E165001: Commit blocked by pre-commit hook
(exit code 255) with no output".

This error seems to occur independent of the actual script. It happens
when using the default hook installed by Phabricator and also occurs
with very simple hooks like the following:

    #!/bin/sh

    echo "testing" >&2
    exit 1

I would expect this script to fail due to the error code and provide
the error message "testing". Instead I receive the previously
mentioned error message. If I change the exit code to 0, it still
fails with the same message. Basically, this happens with any
pre-commit script, regardless of the script's contents.

Based on a discussion in the #svn IRC channel, I tried the following:

    sudo svn mkdir file:///var/repo/SVN/TestFolder -m "Add test folder"

with the following output:

    svn: E165001: Commit blocked by pre-commit hook (exit code 1) with
output:
    testing

So this implies that the hook can work and may not be at fault at all.
Normally changes to the repository are made like so:
svn mkdir svn+ssh://vcs@phabricator.example.com/diffusion/SVN/TestFolder -m
"Testing"

This seems to cause the vcs user to sudo to the phd user and run:

    svnserve -t --tunnel-user=foven

I really have no idea what is causing this issue at this point.
It could be some sort of permissions or ownership issue,
but I've tested the hook like this:

    [phd_at_phabricator ~]$ env -i /var/repo/SVN/hooks/pre-commit
    testing

and this:

    [phd_at_phabricator ~]$ env - /var/repo/SVN/hooks/pre-commit
    testing

(which I think should be identical) and both ways work.

I can even run the script this way as the tunneled user. I'm not sure
if this is actually necessary or advised (is it?), but seems to
indicate that if the script is run as the tunneled user, it shouldn't
be causing this issue.

I have seen where SELinux has caused this problem for others in the
past, but SELinux is disabled.

Any help is greatly appreciated.
Received on 2015-12-02 07:35:40 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.