Jenkins svn plugin clean removal - jenkins

After a simple apt-get update on ubuntu 10.11, I lost the svn polling possibility. None of my projects, that could poll svn, can anymore.
The plugin Update center shows an update is available for this plugin ( 1.34 -> 1.37 ) but update does not work, wether with web interface or cli.
Jenkins logs show a whole bunch of errors relating the subversion plugin
ATTENTION: Caught exception evaluating: it.isTagged(). Reason: java.lang.NullPointerException
java.lang.NullPointerException
at hudson.scm.SubversionTagAction.isTagged(SubversionTagAction.java:157)
[...]
25 janv. 2012 16:34:37 hudson.ExpressionFactory2$JexlExpression evaluate
ATTENTION: Caught exception evaluating: it.isTagged(). Reason: java.lang.NullPointerException
[...]
INFO: Loaded all jobs
25 janv. 2012 16:34:06 hudson.util.RobustReflectionConverter doUnmarshal
ATTENTION: Skipping a non-existent field list
com.thoughtworks.xstream.converters.reflection.NonExistentFieldException: No such field hudson.scm.SubversionTagAction.list
etc ... etc ...
I removed by hand :
drwxr-xr-x 4 jenkins nogroup 4096 2012-01-25 16:33 subversion
-rw-r--r-- 1 jenkins nogroup 2105983 2012-01-24 18:34 subversion.bak
-rw-r--r-- 1 jenkins nogroup 2105983 2012-01-24 18:34 subversion.hpi
-rw-r--r-- 1 jenkins nogroup 0 2012-01-25 16:31 subversion.hpi.pinned
-rw-r--r-- 1 jenkins nogroup 2103308 2012-01-25 16:31 subversion.jpi
but the plugin keeps being listed in the update area.
Question : what is the proper procedure to remove EVERY and ALL references to this plugin, to make a very clean reinstall ?
thanks

it seems to be common problem
https://issues.jenkins-ci.org/browse/JENKINS-12449
try these steps
Downgrade jenkins, restart
Disable subversion plugin, restart
Upgrade jenkins, restart
Enable subversion plugin, restart
Edit each build configuration, enable subversion, save.

Related

Jenkins replaces updated plugins with older integrated plugins

I have installed jenkins server on server without internet.
Extra plugins i have installed with my own download script.
It was working without any problems.
But today i made jenkins update from 2.176.1 to 2.176.2.
And everything gone broken.
Some how jenkins loads from somewhere older plugins and even deletes newer *.hpi updates.
Here is as example i'm showing matrix-autherrors that causes fail of role-strategy plugin:
INFO: Started initialization
<Skipped some libs>
Aug 23, 2019 5:49:46 PM hudson.PluginManager considerDetachedPlugin
Aug 23, 2019 5:49:46 PM hudson.PluginManager considerDetachedPlugin
INFO: Loading a detached plugin as a dependency: /mnt/repos/jenkins_home/plugins/matrix-auth.jpi
Aug 23, 2019 5:49:47 PM hudson.ClassicPluginStrategy createClassJarFromWebInfClasses
WARNING: Created /mnt/repos/jenkins_home/plugins/matrix-auth/WEB-INF/lib/classes.jar; update plugin to a version created with a newer harness
<Skipped some other libs and corresponding erros>
Aug 23, 2019 5:49:59 PM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading plugin Role-based Authorization Strategy v2.13 (role-strategy)
java.io.IOException: Role-based Authorization Strategy version 2.13 failed to load.
- Matrix Authorization Strategy Plugin version 1.1 is older than required. To fix, install version 2.2 or later.
at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:868)
at hudson.PluginManager$2$1$1.run(PluginManager.java:544)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1095)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I have checked that jenkins removed newer matrix-auth.hpi version 2.4.2 file for from Jenkins_home/plugins and placed matrix-auth.jpi of version 1.1
Also same happens with following plugins:
[root#host plugins]# ll |grep jpi
-rw-r-----. 1 jenkins jenkins 112483 Aug 23 09:56 antisamy-markup-formatter.jpi
-rw-r-----. 1 jenkins jenkins 90421 Aug 23 09:56 ant.jpi
-rw-r-----. 1 jenkins jenkins 3387826 Aug 23 09:56 bouncycastle-api.jpi
-rw-r-----. 1 jenkins jenkins 38296 Aug 23 09:56 command-launcher.jpi
-rw-r-----. 1 jenkins jenkins 929025 Aug 23 09:56 cvs.jpi
-rw-r-----. 1 jenkins jenkins 55546 Aug 23 09:56 external-monitor-job.jpi
-rw-rw-r--. 1 jenkins jenkins 38073 Aug 23 09:56 javadoc.jpi
-rw-r-----. 1 jenkins jenkins 69669 Aug 23 09:56 jdk-tool.jpi
-rw-rw-r--. 1 jenkins jenkins 332039 Aug 23 09:56 junit.jpi
-rw-r-----. 1 jenkins jenkins 101895 Aug 23 09:56 ldap.jpi
-rw-rw-r--. 1 jenkins jenkins 116002 Aug 23 09:56 mailer.jpi
-rw-rw-r--. 1 jenkins jenkins 79681 Aug 23 09:56 matrix-auth.jpi
-rw-rw-r--. 1 jenkins jenkins 238601 Aug 23 09:56 matrix-project.jpi
-rw-rw-r--. 1 jenkins jenkins 11016783 Aug 23 09:56 maven-plugin.jpi
-rw-r-----. 1 jenkins jenkins 1030550 Aug 23 09:56 pam-auth.jpi
-rw-rw-r--. 1 jenkins jenkins 4683101 Aug 23 09:56 subversion.jpi
-rw-r-----. 1 jenkins jenkins 949638 Aug 23 09:56 windows-slaves.jpi
I have also downloaded newer versions of this plugins, cleared jenkins_home/plugins and placed plugins updates.
However each restart of jenkis deletes my hpi and place older versions in jpi
How can i prohibit jenkins to replace provided newer hpi with integrated older ones?
Jenkins 2.176.2
latest plugins

Jenkins symlinks/permalinks broken after restart

Jenkins version 2.114 is running builds but they seem to disappear from the Dashboard after a restart. I have Jenkins setup on Linux and all the log is present under
${JENKINS_HOME}/jobs/${ITEM_FULL_NAME}/builds
I have tried Reload Configuration from Disk with following set in /etc/sysconfig/jenkins
JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true"
Below is build and workspace directory settings:
Workspace Root Directory :${JENKINS_HOME}/workspace/${ITEM_FULL_NAME}
Build Record Root Directory: ${ITEM_ROOTDIR}/builds
Below you can see the build number 117 and 118, but still, the lastFailedBuild, lastStableBuild , lastSuccessfulBuild are set to -1, which doesn't exist
drwxr-xr-x 4 jenkins jenkins 4096 Apr 2 20:17 117
drwxr-xr-x 4 jenkins jenkins 4096 Apr 3 20:17 118
lrwxrwxrwx 1 jenkins jenkins 2 Apr 3 11:09 lastFailedBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 4 10:44 lastStableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 4 03:21 lastSuccessfulBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 3 10:58 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 2 Apr 3 10:58 lastUnsuccessfulBuild -> -1
I have also set the
Discard Old Builds Slicer - Days to keep artifacts as 30
Discard Old Builds Slicer - Max # of builds to keep as 40
I ran the jenkins-job-checker[ https://github.com/docwhat/jenkins-job-checker ] on one of the jobs and found the following :
Problem: NOTLINK: The number link builds/1 is not a symlink!
Problem: NOTLINK: The number link builds/2 is not a symlink!
Problem: NOTLINK: The number link builds/3 is not a symlink!
Proposal: Archive non-link builds/1
Proposal: Archive non-link builds/2
Proposal: Archive non-link builds/3
Really appreaciate some help
The links have been replaced with the permalinks file:
rwxr-xr-x 2 jenkins jenkins 4096 Aug 6 2018 98
drwxr-xr-x 2 jenkins jenkins 4096 Aug 7 2018 99
lrwxrwxrwx 1 jenkins jenkins 3 Jan 19 13:47 lastFailedBuild -> 649
lrwxrwxrwx 1 jenkins jenkins 3 Jan 19 13:48 lastSuccessfulBuild -> 622
lrwxrwxrwx 1 jenkins jenkins 2 Jun 14 2018 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 3 Jan 19 13:49 lastUnsuccessfulBuild -> 649
-rw-r--r-- 1 jenkins jenkins 0 Jun 14 2018 legacyIds
-rw-r--r-- 1 jenkins jenkins 134 Jan 19 14:42 permalinks
jenkins#ip-1-9-2-253_jenkins:~/jobs/cron_dockers/jobs/ios/builds$ cat permalinks
lastCompletedBuild 651
lastFailedBuild 650
lastStableBuild 651
lastSuccessfulBuild 651
lastUnstableBuild -1
lastUnsuccessfulBuild 650
Make sure the values in the permalinks file are correct, these are the values that are used to generate the values in the Jenkins GUI.
I installed the plugin operations-center-context and that solved my problem
I found the solution in below link:
https://support.cloudbees.com/hc/en-us/articles/216227047-After-moving-a-job-symlinks-for-folders-became-actual-folders

Jenkins Gerrit polling fails: constantly triggering builds

So we're using Gerrit Trigger (2.23.0) on our Jenkins CI build manager & using docker containers for the actual builds.
The issue that has recently popped up in some of our branches the Gerrit Repo polling is failing and causing it to "detect changes" every time, so it's constantly rebuilding despite no changes.
Checking the Gerrit Repo Polling Log for any of the affected jobs gives one of the following outputs:
Started on Feb 1, 2017 3:12:25 PM
Polling SCM changes on aosp-host
[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
fatal: Not a git repository: '/home/jenkins/workspace/.repo/manifests.git'
fatal: Not a git repository: '/home/jenkins/workspace/.repo/manifests.git'
fatal: cannot obtain manifest http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git
Done. Took 1 min 19 sec
Changes found
or, if the build was already building (gerrit waits for the build to finish before doing the scm poll)
Started on Feb 2, 2017 3:24:15 AM
Polling SCM changes on aosp-host
[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml
fatal: cannot make /home/jenkins/workspace/.repo/repo directory: File exists
Done. Took 2 hr 4 min
Changes found
The builds, which are triggered by this failure, use the same commands and work fine:
[workspace] $ repo init -u http://xxx.xxx.xxx.xxx/git/project/platform/manifest.git -b branch -m branch.xml
Navigating to the manifest directory, we see the symptom:
jenkins#f052b3453d95:~/workspace/.repo$ ll
total 32
drwxr-xr-x 1 jenkins jenkins 180 Dec 20 11:08 ./
drwxrwxr-x 1 jenkins jenkins 778 Dec 20 11:07 ../
-rw-r--r-- 1 jenkins jenkins 20087 Dec 20 10:14 .repo_fetchtimes.json
lrwxrwxrwx 1 jenkins jenkins 20 Dec 20 10:13 manifest.xml -> manifests/branch.xml
drwxr-xr-x 1 jenkins jenkins 8 Dec 16 17:33 manifests/
drwxr-xr-x 1 jenkins jenkins 50 Dec 16 17:33 manifests.git/
drwxr-xr-x 1 jenkins jenkins 28 Dec 16 17:43 project-objects/
-rw-r--r-- 1 jenkins jenkins 7756 Dec 20 10:14 project.list
drwxr-xr-x 1 jenkins jenkins 410 Dec 16 17:46 projects/
with
lrwxrwxrwx 1 jenkins jenkins 20 Dec 20 10:13 manifest.xml -> manifests/branch.xml
highlighted in red, because the associated branch.xml is not found... so the Gerrit Log from above is accurate, it's failing to init properly. This is confirmed via a repo status in the main directory:
jenkins#f052b3453d95:~/workspace$ repo status
Traceback (most recent call last):
File "/home/jenkins/workspace/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/home/jenkins/workspace/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/home/jenkins/workspace/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/home/jenkins/workspace/.repo/repo/subcmds/status.py", line 130, in Execute
all_projects = self.GetProjects(args)
File "/home/jenkins/workspace/.repo/repo/command.py", line 140, in GetProjects
all_projects_list = manifest.projects
File "/home/jenkins/workspace/.repo/repo/manifest_xml.py", line 350, in projects
self._Load()
File "/home/jenkins/workspace/.repo/repo/manifest_xml.py", line 407, in _Load
self.manifestProject.worktree))
File "/home/jenkins/workspace/.repo/repo/manifest_xml.py", line 443, in _ParseManifestXml
root = xml.dom.minidom.parse(path)
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: '/home/jenkins/workspace/.repo/manifest.xml'
The issue is, running repo init -u <url> -m branch.xml via the command line works fine, and produces a valid repo.
Any insight one can offer for this issue?

Buck build failing for "events-logs" Gerrit plugin (jar)

I am trying to build Gerrit plugin "events-log" jar ( https://gerrit.googlesource.com/plugins/events-log) via Buck build, but its failing with below error:
root#jenkins-test:~/events-log# ll
drwxr-xr-x 7 root root 4096 Jun 29 13:25 ./
drwxrwxr-x 24 root root 4096 Jun 29 13:22 ../
-rw-r--r-- 1 root root 1017 Jun 29 12:57 BUCK
-rw-r--r-- 1 root root 173 Jun 29 12:57 .buckconfig
drwxr-xr-x 3 root root 4096 Jun 29 13:25 .buckd/
drwxr-xr-x 6 root root 4096 Jun 29 13:05 buck-out/
drwxr-xr-x 8 root root 4096 Jun 29 13:27 .git/
-rw-r--r-- 1 root root 146 Jun 29 12:57 .gitignore
drwxr-xr-x 5 root root 4096 Jun 29 12:57 lib/
drwxr-xr-x 4 root root 4096 Jun 29 12:57 src/
root#jenkins-test:~/events-log# /root/buck/bin/buck build events-log:events-
log
Using buckd.
BUILD FAILED: No build file at events-log/BUCK when resolving target
//events-log:events-log.
Can somebody please tell how to fix it and build the jar.
Thanks
I think I've finally figured it out ...
What I wound up doing is checking out Gerrit and building the events-log plugin in the Gerrit tree.
git clone https://gerrit.googlesource.com/gerrit
cd gerrit
git co v2.11.2
git submodule init
git submodule update
git clone https://gerrit.googlesource.com/plugins/events-log plugins/events-log
buck build plugins/events-log
I'm pretty sure you just want /root/buck/bin/buck build //:events-log. See http://buckbuild.com/concept/build_target.html
Eventually I found src/main/resources/Documentation/build.md, with which I finally succeeded in building events-log:
git clone https://gerrit.googlesource.com/plugins/events-log
git clone https://gerrit.googlesource.com/bucklets
cd events-log
git checkout stable-2.12
ln -s ../bucklets .
ln -s bucklets/buckversion .buckversion
ln -s bucklets/watchmanconfig .watchmanconfig
buck build plugin
This builds buck-out/gen/events-log.jar.
If the version is 2.14 or later, please use bazle to build
And I also try to build v2.13 with buck, you need to modify gerrit_plugin.bucklet which is under bucklets folder
Old content:
target_suffix = ''):
from multiprocessing import cpu_count
from os import path,getcwd
New content:
target_suffix = ''):
with allow_unsafe_import():
from multiprocessing import cpu_count
from os import path,getcwd
Then execute "buck build plugin
Out put:
ruhu#CCM-P700:~/tools/events-log$ buck build plugin
Download http://repo1.maven.org/maven2/com/google/code/gson/gson/2.3.1/gson-2.3.1-sources.jar
Download http://repo1.maven.org/maven2/com/google/code/gson/gson/2.3.1/gson-2.3.1.jar
Download http://repo1.maven.org/maven2/com/google/gerrit/gerrit-plugin-api/2.13/gerrit-plugin-api-2.13.jar
Parsing buck files: finished in 1.3 sec (100%)
Creating action graph: finished in 1.6 sec (100%)
Building: finished in 03:47.3 min (100%) 19/19 jobs, 19 updated, 94.7% cache mis
Total time: 03:50.3 min

Jenkins Valgrind plugin appears to sum errors across tests

I am really happy to see that a Valgrind plugin exists for Jenkins. I use it for C/C++ code at work.
I have set it up in Jenkins (Linux Ubuntu 14.04 - the valgrind plugin version 0.22) to dump xml files.
My config is like this
I can see that I do get my memcheck files out in the xml directory
-rw------- 1 jenkins jenkins 1379 Oct 25 18:21 main.18996.memcheck
-rw------- 1 jenkins jenkins 1379 Oct 25 18:22 main.19100.memcheck
-rw------- 1 jenkins jenkins 2452 Oct 25 18:27 main.19489.memcheck
-rw------- 1 jenkins jenkins 2453 Oct 25 18:28 main.19605.memcheck
-rw------- 1 jenkins jenkins 2453 Oct 25 18:28 main.19692.memcheck
-rw------- 1 jenkins jenkins 2453 Oct 25 18:28 main.19774.memcheck
-rw------- 1 jenkins jenkins 1379 Oct 25 18:29 main.19963.memcheck
I can see that the memcheck files look fine with some "dirty underwear" such as
<error>
<unique>0xb</unique>
<tid>1</tid>
<kind>InvalidWrite</kind>
<what>Invalid write of size 4</what>
<stack>
<frame>
<ip>0x80483EB</ip>
<obj>/home/jenkins/workspace/DemoValgrind/main</obj>
<fn>main</fn>
<dir>/home/jenkins/workspace/DemoValgrind</dir>
<file>main.c</file>
<line>12</line>
</frame>
</stack>
<auxwhat>Address 0x41ae21c is not stack'd, malloc'd or (recently) free'd</auxwhat>
</error>
My problem is that the Valgrind plugin counts the sum of all errors in all of the main.*.memcheck files.
I expected a view more like this one:
https://wiki.jenkins-ci.org/download/attachments/60918012/valgrind-trend-graph.jpg?version=1&modificationDate=1336573302000
where the number of errors go up and down.
I must be configuring the Valgrind "Publish Valgrind Results" wrongly.
Is there a syntax where I can get the overview diagram (the URL just above) to match the number of errors according to the build, i.e.
not accumulate?

Resources