Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: git-plugin
-
Labels:None
-
Environment:Ubuntu Linux 18.04
OpenJDK 11.0.8
Jenkins core 2.264
git plugin 4.4.5
git-client plugin 3.5.1
-
Similar Issues:
Description
This happens only when a build is manually triggered. It used to work some time (months?) ago, although I don't know if it broke due to a version upgrade or a configuration change.
Running as SYSTEM Building on master in workspace /var/lib/jenkins/jobs/NFD/workspace The recommended git tool is: NONE No credentials specified > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://gerrit.named-data.net/NFD # timeout=10 Pruning obsolete local branches Fetching upstream changes from https://gerrit.named-data.net/NFD > git --version # timeout=10 > git --version # 'git version 2.17.1' > git fetch --tags --progress --prune -- https://gerrit.named-data.net/NFD refs/heads/master # timeout=10 > git rev-parse FETCH_HEAD^{commit} # timeout=10 JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://wiki.jenkins.io/display/JENKINS/Remove+Git+Plugin+BuildsByBranch+BuildData Checking out Revision 3dc9fd0b826b80d2e2bd40901875748e2ceaa5d3 () > git config core.sparsecheckout # timeout=10 > git checkout -f 3dc9fd0b826b80d2e2bd40901875748e2ceaa5d3 # timeout=10 Commit message: "Prepare release 0.7.1" FATAL: null java.lang.NullPointerException at java.base/java.util.TreeMap.compare(TreeMap.java:1291) at java.base/java.util.TreeMap.put(TreeMap.java:536) at hudson.util.CopyOnWriteMap.put(CopyOnWriteMap.java:104) at hudson.plugins.git.GitTagAction.<init>(GitTagAction.java:47) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1369) at hudson.scm.SCM.checkout(SCM.java:505) at hudson.model.AbstractProject.checkout(AbstractProject.java:1206) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509) at hudson.model.Run.execute(Run.java:1907) at hudson.matrix.MatrixBuild.run(MatrixBuild.java:323) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Started calculate disk usage of build Finished Calculation of disk usage of build in 0 seconds Started calculate disk usage of workspace Finished Calculation of disk usage of workspace in 0 seconds Finished: FAILURE
Attachments
Issue Links
- links to
The git plugin is making the mistaken assumption that the list of branches in the build is not empty. That is an incorrect assumption in this case.
The specific line that is throwing the null pointer exception was last modified 3 years ago. It needs a safety check that the list of branches is not null before it attempts to ask for the name of the branch to be included in the list of tags.
I don't know what would cause the list of branches to be empty in a workspace, but I believe that it is acceptable and valid to have a workspace with no active branches. In that case, the git plugin checkout uses the precise SHA-1 for the checkout rather than a branch checkout.
The warning message about JENKINS-19022 is usually an indication that a single Jenkins job is configured to build multiple branches. That is acceptable and valid but it is becoming less common as job definitions are switching from freestyle to pipeline. A single job that builds multiple branches will tend to collect lots of unhelpful entries in the build.xml files for each build. Those entries often include the SHA-1 hashes for each preceding build. Memory use can increase significantly when each build includes data for every preceding build.