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

StackOverFlowError starting Jenkins with Pipeline jobs

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • pipeline
    • None
    • Jenkins 2.30
      Workflow-CPS 2.15
      Workflow-Job 2.5
      OS: Centos 6.8

      Problem: Jenkins instance no longer starts. Stacktrace indicates Pipeline job issues.
      Recent Changes: Upgraded nodejs plugin. Reverted it back. Still doesn't start.

      I have another instance with the same plugins but fewer jobs that starts fine.

      Happy to provide more info but have no idea where to even begin. I'm currently trying to remove any Pipeline jobs to get Jenkins to start.

      Stacktrace is attached, but here is the top and bottom for convenience:

      hudson.util.HudsonFailedToLoad: java.lang.StackOverflowError
      at hudson.WebAppMain$3.run(WebAppMain.java:245)
      Caused by: java.lang.StackOverflowError
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
      at com.cloudbees.groovy.cps.CpsTransformer$_visitWithSafepoint_closure6_closure49_closure50.doCall(CpsTransformer.groovy:292)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at

      .....

      org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
      at com.cloudbees.groovy.cps.SandboxCpsTransformer.call(SandboxCpsTransformer.groovy:23)
      at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1053)
      at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
      at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
      at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
      at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:411)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.loadProgramAsync(CpsFlowExecution.java:502)
      at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:477)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:531)
      at hudson.model.RunMap.retrieve(RunMap.java:224)
      at hudson.model.RunMap.retrieve(RunMap.java:56)
      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 hudson.model.RunMap.getById(RunMap.java:204)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:770)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:780)
      at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:65)
      at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:57)
      at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
      at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
      at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl.onLoaded(FlowExecutionList.java:172)
      at jenkins.model.Jenkins.<init>(Jenkins.java:995)
      at hudson.model.Hudson.<init>(Hudson.java:85)
      at hudson.model.Hudson.<init>(Hudson.java:81)
      at hudson.WebAppMain$3.run(WebAppMain.java:231)

        1. config.xml
          5 kB
        2. stacktrace.txt
          80 kB
        3. stacktrace2.txt
          72 kB

          [JENKINS-42227] StackOverFlowError starting Jenkins with Pipeline jobs

          I managed to get Jenkins to start by removing a folder of about 20 jobs, of which only 1 is a Pipeline type job. This makes no sense whatsoever because:

          1. I have other pipeline jobs in other folders (not many, however)
          2. Jobs in this folder have not changed (although they are generated via Job DSL plugin)
          3. What does upgrading nodejs plugin have to do with this??? (Especially since reverting it didn't help)

          I've attached the config.xml for the one pipeline job that was in the folder I removed.

          Alexander Komarov added a comment - I managed to get Jenkins to start by removing a folder of about 20 jobs, of which only 1 is a Pipeline type job. This makes no sense whatsoever because: I have other pipeline jobs in other folders (not many, however) Jobs in this folder have not changed (although they are generated via Job DSL plugin) What does upgrading nodejs plugin have to do with this??? (Especially since reverting it didn't help) I've attached the config.xml for the one pipeline job that was in the folder I removed.

          I then had the same problem on another Jenkins 2.30 instance, with totally different jobs. Removing all jobs made it start but I couldn't narrow it down to one. I upgraded to 2.47 and it still didn't start. I then upgraded all plugins to the latest as of February 22, 2017 (more than 40 plugins) and it started - looks like now the StackOverFlowError still happens but does not prevent Jenkins from starting. Still no idea what was wrong.

          Alexander Komarov added a comment - I then had the same problem on another Jenkins 2.30 instance, with totally different jobs. Removing all jobs made it start but I couldn't narrow it down to one. I upgraded to 2.47 and it still didn't start. I then upgraded all plugins to the latest as of February 22, 2017 (more than 40 plugins) and it started - looks like now the StackOverFlowError still happens but does not prevent Jenkins from starting. Still no idea what was wrong.

          Alexander Komarov added a comment - - edited

          Adding another, slightly different stacktrace2.txt with a StackOverFlowError, again preventing Jenkins (2.47 with latest plugins as of 2017/02/24) from starting.

          This time, I tried something else:

          1. removed a few jobs I was suspecting
          2. Jenkins starts
          3. put the jobs back (I'm just moving folders while Jenkins is stopped)
          4. Jenkins starts!

          I am getting the feeling that this has to do with recovering the previously running Pipeline execution state after restart. Eg:

          • job 1 ran job 2
          • Jenkins was stopped (and maybe i killed job 2 while stopping it)
          • Jenkins starts and attempts to resume job 1, which seems to either forever wait for completion of job 2 which isn't even running, or Jenkins just doesn't start with the Stack Overflow.

          When I moved the offending jobs away, Jenkins cleared their saved state (I'm guessing).

          Alexander Komarov added a comment - - edited Adding another, slightly different stacktrace2.txt with a StackOverFlowError, again preventing Jenkins (2.47 with latest plugins as of 2017/02/24) from starting. This time, I tried something else: removed a few jobs I was suspecting Jenkins starts put the jobs back (I'm just moving folders while Jenkins is stopped) Jenkins starts! I am getting the feeling that this has to do with recovering the previously running Pipeline execution state after restart. Eg: job 1 ran job 2 Jenkins was stopped (and maybe i killed job 2 while stopping it) Jenkins starts and attempts to resume job 1, which seems to either forever wait for completion of job 2 which isn't even running, or Jenkins just doesn't start with the Stack Overflow. When I moved the offending jobs away, Jenkins cleared their saved state (I'm guessing).

          Jesse Glick added a comment -

          Possibly same as JENKINS-44578.

          Jesse Glick added a comment - Possibly same as  JENKINS-44578 .

            Unassigned Unassigned
            akom Alexander Komarov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: