Hi,We are getting below error while pushing to Gerrit even though the hooks are not enabled for the project.
remote: error: internal error while processing changesTo ssh://<user_account>@<host_name>:8282<repo>i! [remote rejected] <branch> -> <branch> (Error running hook /opt/gerrit/hooks/ref-update)error: failed to push some refs to ssh://<user_account>@<host_name>:8282<repo>i
Please provide solution for the error.
--RegardsAshwini
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi David,
Me and Ashwini are working in same team.
Let me explain the issue.
We are using 2.13.2 and we have hooks plugin in place. We all know hooks are global and get executed for all project. Logs will get captured here "$site_path/hooks/hook.log".
This log will get generated for both $site_path/hooks/ref-update and $site_path/hooks/ref-updated. Each time when we push a ref, ref-update and ref-updated will get executed and they generate logs. And "$site_path/hooks/subhooks" script will also get invoked by ref-update and ref-updated.
Everything works fine, nothing to complain. But the problem comes when we try to migrate a big project from, let us say github or any other git tool, to gerrit. This big project contains huge number of refs. When we do a mirror push or push --all something like that, it is causing the trouble and throw us the error(which ashwini posted here initially).
We found out that, when we push huge number of refs in single push, the hooks are getting executed continuously for each and every refs which is being pushed to server. The hooks script is unable to process that much times of execution in short period of time.
Now we want to exclude one or few projects from running the hooks. Is there any way to remove the hooks execution particularly one or few projects?
Hi David and Martin,
Thank you for replying.
>>"One way is to code the hook to ignore certain projects, as Martin suggested."
>>"We code the hook itself to not execute its task for certain
projects, maybe that will work for you? "We can code the hook in such a way to ignore certain projects. But what if i need to enable hook for those projects in future?
Currently i am using the below work around for this issue. My ref-update and ref-updated script looks like below
==============================
[root@localhost hooks]# cat ref-update
#!/bin/bash
if grep -Fxq "$2" /$site_path/hooks/exld_repos; then exit 0; else
me=$0
hookname=`basename $me`
wkdir=`dirname $me`
#echo "$hookname : $*" >> $wkdir/hook.log
$wkdir/subhooks $hookname $*
fi
[root@localhost hooks]#
=================================
I created a file named "exld_repos" and put all the project names which i need to ignore in that. In future if i need to enable a project, i will just remove the project name from the list. This looks simple than coding the hook. Please tell me if this workaround is also a good one when compared to what you have suggested(coding the hook).
Now i need a better workaround. Something which an end user can do without server admin's intervention. For example, If an end user is trying to push a big project. He should able to disable/enable the hooks for his project from client end without the help of server admin. I guess this is not possible, but i would really like to hear your opinion about this since you have much better knowledge about Gerrit hooks.
Hi David,
Me and Ashwini are working in same team.
Let me explain the issue.
We are using 2.13.2 and we have hooks plugin in place. We all know hooks are global and get executed for all project. Logs will get captured here "$site_path/hooks/hook.log".
This log will get generated for both $site_path/hooks/ref-update and $site_path/hooks/ref-updated. Each time when we push a ref, ref-update and ref-updated will get executed and they generate logs. And "$site_path/hooks/subhooks" script will also get invoked by ref-update and ref-updated.
Everything works fine, nothing to complain. But the problem comes when we try to migrate a big project from, let us say github or any other git tool, to gerrit. This big project contains
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.