My hooks are failing after gerrit upgrade to version 2.14.2
There is a new hook which is added in this version - commit-received
What is the difference between ref-update and commit-received hooks now ? When will it be triggered ? any example ?
You probably found this out by now, but the ref-update hook changed between 2.13 and 2.14. See here for details:
https://www.gerritcodereview.com/releases/2.14.md#Behavior-change-in-ref_update-hook
All I did to fix the problem was to rename the ref-update hook to commit-received and it worked as before.
Related
Installed Gerrit (version 2.13.1) by following the steps in the following link:
https://gerrit-review.googlesource.com/Documentation/install-quick.html
in Ubuntu 16.04 environment.
Created a hooks folder in '$site_path'/hooks and added a ref-update hook file which just exits with return code 1.
Provided executable permissions to this file.
After Gerrit server restart, it is allowing me to do a push operation.
Since Gerrit 2.13 you have to install the hooks plugin.
See more details at Gerrit 2.13 Release Notes and Gerrit Documentation.
The hooks plugin is a core plugin, it is packaged within the Gerrit war file and can be installed executing:
java -jar gerrit.war init -d <site_path> --install-plugin=hooks
More info here.
I'm using Gerrit 2.14. This works for me:
Behavior change in ref-update hook
Instead of being invoked on every commit received, the ref-update hook is now invoked before the ref update operation is finalized. The previous behavior of the ref-update hook is moved into a new hook named commit-received.
Sites using the ref-update hook should rename the hook file to commit-received.
https://www.gerritcodereview.com/releases/2.14.md#Behavior-change-in-ref_update-hook
You can also add hooks manually:
Create folder for example /hooks
Add in this folder file ref-update
Make this file executable using this command chmod +x ref-update
Last things is add text below to gerrit.config file, my file is in /var/gerrit/review_site/etc/ but please check where yours file is
This you need add to your gerrit.config file:
[hooks]
path = /hooks
In generally way:
[hooks]
path = /path/to/yours/hooks/folder/hooks
Does any one have any idea what could have happened to Jenkins Email-ext? We have had this plugin working just fine for over two years and all of sudden our entire configs for this plugin have disappeared from all of our projects. We tried to uninstall and re-install the plugin but that didn't make any difference.
Once you install this plugin there should be a checkbox under "Post-build Actions" section in the projects config page to enable it but this option is not shown any longer here. Any idea?
Thanks!
This issue was fixed by following the below steps:
Uninstall email-ext plugin from Jenkins
Stop Jenkins services. (Run > Services.msc) find Jenkins and stop it
Go to Jenkins home (base folder) > Plugins and remove any instances of email-ext plugin (e.g. C:\Program Files (x86)\Jenkins\plugins)
Restart Jenkins
Install email-ext plugin again
And now everything should be working OK again!
if you haven't upgraded your jenkins then the issue might be a different one , just to make sure email configuration section has completely removed from your job , check the config.xml of your jenkins job for the keyword [email-ext].
how to check job's config.xml from GUI ?
simple click on configure link of your job you will be redirected to something like below
http://yourserver/job/jobname/configure
now change the last part of url [configure to config.xml] resulting in something like below
http://yourserver/job/jobname/config.xml
now search for keywords like email and email-ext , if you did not find anything then email-ext plugin is not functioning or its has completely removed the email configuration from your job , if you find an entry , do a uninstall /install and then try a restart of jenkins might resolve your problem , or else you can try the option of reloading configuration from disk.
We're running into a problem creating our very first job on a newly installed Jenkins 1.532.2, with Jenkins Git plugin 2.0.2, Jenkins Git client plugin 1.6.3, and GitHub plugin 1.8.
The error I see on the "new job" page is just below the "Git Repositories" radio button in the Source Code Management section:
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException:
jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-1.532.2.jar!/lib/form/repeatableProperty.jelly:66:69:
<st:include> No such property: lib for class: hudson.plugins.git.UserRemoteConfig.config
Interestingly, I see no errors in the log file at all.
Any ideas how to diagnosis this error?
I never did find the cause, but the problem went away by reverting the git plugin and git client plugin to 1.5 and 1.0.7 respectively, as suggested in https://issues.jenkins-ci.org/browse/JENKINS-20533
This issue has been reported as https://issues.jenkins-ci.org/browse/JENKINS-22649
1.532.3 LTS don't suffer this issue, as new LTS branch. Not sure about the root cause, looks like a strange classloader conflict.
I was having the same issue. I am using git-client 1.12.0, git 2.3.1 and matrix project plugin 1.4 fixed the issue.
Follow this for more information.
https://issues.jenkins-ci.org/browse/JENKINS-24582
Hope this helps.
Thanks
Based on https://issues.jenkins-ci.org/browse/JENKINS-20533 once you enable/install the matrix plugin, I am not seeing this error
If I want to use a plugin for Grails from Git Hub. Do I just download the zip file and make it available in my local maven repository? I'm behind a firewall which doesn't let me just resolve the dependencies.
You can get the source and run maven-install to make it available in your local maven repository, then you declare the dependency in the plugins block of the BuildConfig.groovy.
You shouldn't build from the repo source since that might include unfinished features and bugs. At the very least use source tagged for a particular release (if there are any).
If you want to download released plugins, they're available at http://repo.grails.org/grails/plugins/org/grails/plugins/
Keep in mind that running grails install-plugin /path/to/zip no longer works in 2.3, so you should stay away from that approach. Instead, you could run a local Artifactory instance that acts as a cached plugin repo - see this thread for some information to get started: http://grails.1312388.n4.nabble.com/Caching-plugins-using-artifactory-td4640164.html
The zip file which will be downloaded will be the source of the plugin. You have to extract the zip, go to the root of the plugin, and run grails maven-install (from release plugin) which would build the plugin artifact for you in you local maven repository if you have one setup.
Then you can use the plugin.
OR
You can use the plugin inline as mentioned in this answer.
Proxy setting can also be configured in grails by add proxy and set proxy.
grails add-proxy myproxy "--host=myproxy" "--port=myport" "--username=proxyuser" "--password=mypassword"
grails set-proxy myproxy
see grails docs.
if above solution doesn't work try then
create ProxySettings.groovy in C:\Documents and Settings\user-name.grails folder
add following two lines to this file and save
myproxy=["http.proxyHost":"myproxy", "http.proxyPort":"4300", "http.proxyUserName":"proxyuser", "http.proxyPassword":"mypassword"]
currentProxy="myproxy"
please check this link for more options
You can also keep plugins locally as described here
http://blog.armbruster-it.de/2011/10/project-setup-for-grails-with-customized-plugins-using-git-submodules/
git submodule add git://github.com/sarmbruster/grails-spring-security-ui.git plugins/grails-spring-security-ui
git add .gitmodules plugins/
git commit -m "added submodule"
now add plugins/grails-spring-security-ui as a inline plugin by adding to grails-app/conf/BuildConfig.groovy
grails.plugin.location.'spring-security-ui'="plugins/grails-spring-security-ui"
That's all.
More info in section "Installing Local Plugins" and "Specifying Plugin Locations" in docs:
http://grails.org/doc/latest/guide/plugins.html#12.1%20Creating%20and%20Installing%20Plug-ins
Before anyone guns me down..I have looked at all the messages that has this error but they seem to manifest from a different problem,I couldn't get any substantial information. Following are the errors I'm running into in the git polling log...
I don't have a clue regarding error #1,please provide inputs
For this,I read on other questions that $GERRIT_REFSPEC gets filled in dynamically when there is a gerrit trigger but i don't understand why I keep seeing this in the git poll log. How can I fix this ?
Error messages:
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Command "/usr/bin/git fetch -t ssh://company.com:29418/platform/vendor/proprietary/mla.git $GERRIT_REFSPEC" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC
Go to the Job's Configure page and search to check This build is parameterized box.
Then set Name to GERRIT_REFSPEC
and Default value to refs/heads/master.
It took me some time to search for how to add this string parameter mentioned in the Gerrit Trigger plugin manual. I use Jenkins 1.567 with Gerrit Trigger 2.11.1.
As of May 2016, this error may be result of fix for SECURITY-170 introduced in Jenkins 2.3 or 1.651.2.
From wiki:
In a May 2016 security advisory, a vulnerability was announced (SECURITY-170 / CVE-2016-3721) whereby attackers could potentially exploit the fact that certain Jenkins plugins allow the definition of arbitrary build parameters — which are in turn injected into the build envirionment.
The fix for this issue — which was first included in Jenkins versions 1.651.2 and Jenkins 2.3 — means that only build parameters that have been explicitly defined in a job's configuration will be available by default at build time. Any other arbitrary parameters added to a build by plugins will not be available by default.
As there are a number of plugins that rely on the behaviour in older Jenkins versions, upgrading to 1.651.2 or 2.3 means that certain build behaviours may be broken.
One of the affected plugins is the Gerrit Trigger. The issue you should watch for updates is here.
However, please note that the Rado's solution to definine the GERRIT_REFSPEC parameter manually in build config can solve this problem temporarily if you build only one branch from Gerrit.
A workaround is available by adding the following JAVA_ARGS to /etc/default/jenkins on ubuntu
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.ParametersAction.keepUndefinedParameters=true"
You could also add which variables should be allowed
JAVA_ARGS="$JAVA_ARGS -Dhudson.model.ParametersAction.safeParameters=GERRIT_REFSPEC,GERRIT_BRANCH
Looks like you ran a Jenkins Gerrit Trigger build manually? The trigger page says,
Using "Build Now"
[..]
Add a String parameter called GERRIT_REFSPEC with the default value refs/heads/master
https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger
After solving this issue if Jenkins is still not pulling the latest code commit(un-merged) then, need to Add Additional Behaviours -> Strategy for choosing what to build -> Gerrit Trigger
Reference: Thanks to Fabian