You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Prasad (普拉萨德)" <pr...@gmail.com> on 2008/03/19 16:58:03 UTC

SVN pre-commit hook failed

Whenever i try  commit remotely my pre-commit hook failed.
my subversion is 1.4.4-r1 its configured with scmbug 0.23-4

loocal commits are working fine but remote commit having following erros

svn checkout is done using svn+ssh command. but while checking into
repository getting following error but without any output

prasad@server ~/src $ svn ci -m "Bug:14223 test"
Password:
Sending        prasad.test
Transmitting file data .svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:

prasad@server ~/src $

If I removed the pre-commit file from hooks directory its works fine form
remotely too. I don't know whats wrong with pre-commit file

please suggest.


-- 
Prasad S. Wani

Re: SVN pre-commit hook failed

Posted by "Prasad (普拉萨德)" <pr...@gmail.com>.
I tried all the steps you suggested but still having the same problem.
Commits are happning locally but not remotely.

for local testing svn checkout is by using following command
svn co file:///opt/svn/test/trunk/test-commit

and checkin using following (working fine)


for remote test i am using following command for checkout

svn co svn+ssh:xyz@localhost/opt/svn/test/trunk/test-commit

and following command for checkout (Working only if I delete pre-commit file
from hooks)

prasad@server ~/src $ svn ci -m "Bug:14223 test"
Password:
Sending        prasad.test
Transmitting file data .svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:

prasad@server ~/src $


Which means whenever i put svn+ssh its giving problem else its working fine.
So what need to fix so that it works with svn+ssh also





On Fri, Mar 21, 2008 at 9:56 AM, Mark Reibert <sv...@reibert.com> wrote:

> On Thu, 2008-03-20 at 18:04 +0530, Prasad (普拉萨德) wrote:
> >
> > please find the attachment of my pre-commit and pre-commit.tmpl script
>
> Does your repo path contain spaces? You should always quote paths that
> contain variable expansions in case the resulting path contains spaces.
> Your Scmbug activity_verify command would then be:
>
> /usr/bin/perl -I "${REPOS}/hooks/lib/scmbug" \
>     "${REPOS}/hooks/bin/scmbug_activity.pl" \
>     "${REPOS}/hooks/etc/scmbug/glue.conf" \
>     activity_verify "${REPOS}" "${TXN}" >&2
>
> (I do not know if transaction names can contain spaces, but it does not
> hurt to quote that as well.)
>
> It is also possible your Scmbug integration is failing for valid
> reasons. Perhaps it cannot verify the activity due to problems
> contacting the change request tool (Bugzilla, I presume). Perhaps your
> commit log message is not properly formatted for Scmbug to grab the bug
> number.
>
> > perms for hook directory i set them to 777 but still nothing works.
>
> But what about the hook itself (pre-commit) - is it executable?
>
> Try the following simple pre-commit hook:
>
> #!/bin/sh
> touch /tmp/pre-commit-test.$$
> exit 0
>
> If you can commit, and you get the file in /tmp, then you know the
> mechanics are correct and you likely have problems with your Scmbug
> integration.
>
> --
> ----------------------
> Mark S. Reibert, Ph.D.
> svn@reibert.com
> ----------------------
>
>


-- 
Prasad S. Wani

Re: SVN pre-commit hook failed

Posted by Mark Reibert <sv...@reibert.com>.
On Thu, 2008-03-20 at 18:04 +0530, Prasad (普拉萨德) wrote:
> 
> please find the attachment of my pre-commit and pre-commit.tmpl script

Does your repo path contain spaces? You should always quote paths that
contain variable expansions in case the resulting path contains spaces.
Your Scmbug activity_verify command would then be:

/usr/bin/perl -I "${REPOS}/hooks/lib/scmbug" \
     "${REPOS}/hooks/bin/scmbug_activity.pl" \
     "${REPOS}/hooks/etc/scmbug/glue.conf" \
     activity_verify "${REPOS}" "${TXN}" >&2

(I do not know if transaction names can contain spaces, but it does not
hurt to quote that as well.)

It is also possible your Scmbug integration is failing for valid
reasons. Perhaps it cannot verify the activity due to problems
contacting the change request tool (Bugzilla, I presume). Perhaps your
commit log message is not properly formatted for Scmbug to grab the bug
number.

> perms for hook directory i set them to 777 but still nothing works.

But what about the hook itself (pre-commit) - is it executable?

Try the following simple pre-commit hook:

#!/bin/sh
touch /tmp/pre-commit-test.$$
exit 0

If you can commit, and you get the file in /tmp, then you know the
mechanics are correct and you likely have problems with your Scmbug
integration.

-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: SVN pre-commit hook failed

Posted by "Prasad (普拉萨德)" <pr...@gmail.com>.
I am using Gentoo OS 2.6.18
please find the attachment of my pre-commit and pre-commit.tmpl script

perms for hook directory i set them to 777 but still nothing works.



2008/3/19 Andy Levy <an...@gmail.com>:

> On Wed, Mar 19, 2008 at 12:58 PM, Prasad (普拉萨德) <pr...@gmail.com>
> wrote:
> > Whenever i try  commit remotely my pre-commit hook failed.
> > my subversion is 1.4.4-r1 its configured with scmbug 0.23-4
> >
> > loocal commits are working fine but remote commit having following erros
> >
> > svn checkout is done using svn+ssh command. but while checking into
> > repository getting following error but without any output
> >
> > prasad@server ~/src $ svn ci -m "Bug:14223 test"
> > Password:
> > Sending        prasad.test
> > Transmitting file data .svn: Commit failed (details follow):
> > svn: 'pre-commit' hook failed with error output:
> >
> > prasad@server ~/src $
> >
> > If I removed the pre-commit file from hooks directory its works fine
> form
> > remotely too. I don't know whats wrong with pre-commit file
> >
> > please suggest.
>
> For whatever reason, the hook script is exiting with an error
> condition. But no one here is a mind-reader.  No one can help you if
> you don't share the hook script itself and what environment it's
> running in (host OS, etc.).
>



-- 
Prasad S. Wani

Re: SVN pre-commit hook failed

Posted by Andy Levy <an...@gmail.com>.
On Wed, Mar 19, 2008 at 12:58 PM, Prasad (普拉萨德) <pr...@gmail.com> wrote:
> Whenever i try  commit remotely my pre-commit hook failed.
> my subversion is 1.4.4-r1 its configured with scmbug 0.23-4
>
> loocal commits are working fine but remote commit having following erros
>
> svn checkout is done using svn+ssh command. but while checking into
> repository getting following error but without any output
>
> prasad@server ~/src $ svn ci -m "Bug:14223 test"
> Password:
> Sending        prasad.test
> Transmitting file data .svn: Commit failed (details follow):
> svn: 'pre-commit' hook failed with error output:
>
> prasad@server ~/src $
>
> If I removed the pre-commit file from hooks directory its works fine form
> remotely too. I don't know whats wrong with pre-commit file
>
> please suggest.

For whatever reason, the hook script is exiting with an error
condition. But no one here is a mind-reader.  No one can help you if
you don't share the hook script itself and what environment it's
running in (host OS, etc.).

Re: SVN pre-commit hook failed

Posted by Hari Kodungallur <hk...@gmail.com>.
On Wed, Mar 19, 2008 at 9:58 AM, Prasad (普拉萨德) <pr...@gmail.com>
wrote:

> Whenever i try  commit remotely my pre-commit hook failed.
> my subversion is 1.4.4-r1 its configured with scmbug 0.23-4
>
> loocal commits are working fine but remote commit having following erros



This is not an answer but I am wondering what the difference between local
and remote commits is. I had thought that if pre-commit hook exists, it will
be called no matter what kind of commit it is.



>
>
> svn checkout is done using svn+ssh command. but while checking into
> repository getting following error but without any output
>
> prasad@server ~/src $ svn ci -m "Bug:14223 test"
> Password:
> Sending        prasad.test
> Transmitting file data .svn: Commit failed (details follow):
> svn: 'pre-commit' hook failed with error output:
>
> prasad@server ~/src $
>
> If I removed the pre-commit file from hooks directory its works fine form
> remotely too. I don't know whats wrong with pre-commit file
>
> please suggest.
>


As Andy pointed out earlier, without looking at the pre-commit hook, it will
be difficult to tell. There are many things that could go wrong in the hook
script. Some of the more common ones are not having execute permission for
the hook script, assuming pre defined environment for the session that
executes the script etc. Please see
http://subversion.tigris.org/faq.html#hook-debugging. In this case, I am
guessing that you don't have execute permission for the script.


Thanks,
-Hari

Re: SVN pre-commit hook failed

Posted by Mark Reibert <sv...@reibert.com>.
This problem can occur if your hook script is not executable. This is a
common oversight when copying a hook template as the .tmpl files created
by "svnadmin create ..." are mode 0644 (which is a good thing).

On Wed, 2008-03-19 at 22:28 +0530, Prasad (普拉萨德) wrote:
> Whenever i try  commit remotely my pre-commit hook failed. 
> my subversion is 1.4.4-r1 its configured with scmbug 0.23-4
> 
> loocal commits are working fine but remote commit having following
> erros
> 
> svn checkout is done using svn+ssh command. but while checking into
> repository getting following error but without any output
> 
> prasad@server ~/src $ svn ci -m "Bug:14223 test"
> Password:
> Sending        prasad.test
> Transmitting file data .svn: Commit failed (details follow):
> svn: 'pre-commit' hook failed with error output:
> 
> prasad@server ~/src $
> 
> If I removed the pre-commit file from hooks directory its works fine
> form remotely too. I don't know whats wrong with pre-commit file
> 
> please suggest.
> 
> 
> -- 
> Prasad S. Wani
-- 
----------------------
Mark S. Reibert, Ph.D.
svn@reibert.com
----------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org