Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44548

Missing execution/head element causes load failure

    Details

    • Similar Issues:

      Description

      We have several cases of "build.xml" that have been generated with no <head> element inside the <execution> element.

      This is causing a load failure - which prevents the job expiring.

      Load Failure

      WARNING: could not load /var/jenkins_home/jobs/<job-path>/builds/18396
      java.lang.NullPointerException
              at org.jenkinsci.plugins.workflow.cps.FlowHead.newStartNode(FlowHead.java:97)
              at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramFailed(CpsFlowExecution.java:683)
              at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:659)
              at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:587)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:599)
              at hudson.model.RunMap.retrieve(RunMap.java:225)
              at hudson.model.RunMap.retrieve(RunMap.java:57)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:500)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:482)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:380)
              at jenkins.model.lazy.AbstractLazyLoadRunMap.search(AbstractLazyLoadRunMap.java:331)
              at jenkins.model.lazy.LazyBuildMixIn$RunMixIn.getNextBuild(LazyBuildMixIn.java:405)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.getNextBuild(WorkflowRun.java:228)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.getNextBuild(WorkflowRun.java:129)
              at hudson.tasks.LogRotator.perform(LogRotator.java:147)
              at hudson.model.Job.logRotate(Job.java:465)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:663)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.access$1400(WorkflowRun.java:131)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun$GraphL.onNewHead(WorkflowRun.java:947)
              at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.notifyListeners(CpsFlowExecution.java:1203)
              at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.run(CpsThreadGroup.java:407)
              at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:35)
              at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
              at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      

      build.xml fragment

      <?xml version='1.0' encoding='UTF-8'?>
      <flow-build plugin="workflow-job@2.10">
       <execution class="org.jenkinsci.plugins.workflow.cps.CpsFlowExecution">
          <result>SUCCESS</result>
          ... more build information ...
          <script>...
          </script>
          <loadedScripts class="map"/>
          <sandbox>true</sandbox>
          <iota>0</iota>
        </execution>
      

      Note the lack of a <head>0:23</head> or similar tag.

      Cause

      Unknown.

      I have seen this faulty XML generated with both 2.10 and 2.12 versions of the workflow-job plugin. The builds before and after the ones with faulty XML are valid.

      Impacts

      • exceptions in the log (noise, "broken windows")
      • builds can not be loaded, and thus can not be expired

        Attachments

          Activity

            People

            • Assignee:
              jglick Jesse Glick
              Reporter:
              bwalding Ben Walding
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: