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

Pipelines fail with NoSuchMethodError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: pipeline
    • Labels:
      None
    • Similar Issues:

      Description

      Problem

      Jenkins pipeline fails with an exception on any DSL syntax.

      Details

      • I have Jenkins 2.222.4 installed.
      • I have pipeline (workflow-aggregator) plugin 2.6 installed.
      • I create my new pipeline script (I tried both scripted and declarative style, neither of them works) and try to run it, but it fails on the first line.
      • I tried to re-install Jenkins and re-download plugins, the result is the same.
      • I googled my problem but only problems with workflow-aggregator plugin absense are described, which seems to be not my case.
      • I tried to update ALL of my plugins installed and there is no effect.

      Pipeline example:

      pipeline {
          agent any
          stages {
              stage("Stage") {
                  steps {
                      script {
                          println "Hello world"
                      }
                  }
              }
          }
      }
      

      Exception

      [Pipeline] Start of Pipeline
      [Pipeline] node
      [Pipeline] End of Pipeline
      java.lang.NoSuchMethodError: 'java.lang.Object org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(java.util.Map, hudson.model.TaskListener)'
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:302)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:193)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
      	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
      	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.agent.impl.LabelScript.run(LabelScript.groovy:42)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.inDeclarativeAgent(ModelInterpreter.groovy:589)
      	at org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(ModelInterpreter.groovy:76)
      	at WorkflowScript.run(WorkflowScript:1)
      	at ___cps.transform___(Native Method)
      	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
      	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
      	at jdk.internal.reflect.GeneratedMethodAccessor152.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      	at com.cloudbees.groovy.cps.impl.ClosureBlock.eval(ClosureBlock.java:46)
      	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:129)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:268)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Finished: FAILURE
      

      Full plugins list

      JSch dependency plugin (jsch): 0.1.55.2
      ECharts API Plugin (echarts-api): 4.9.0-3
      Structs Plugin (structs): 1.23
      Apache HttpComponents Client 4.x API Plugin (apache-httpcomponents-client-4-api): 4.5.13-1.0
      Pipeline: Declarative Extension Points API (pipeline-model-extensions): 1.8.5
      Pipeline (workflow-aggregator): 2.6
      Mailer Plugin (mailer): 1.32.1
      Bootstrap 4 API Plugin (bootstrap4-api): 4.6.0-1
      JQuery3 API Plugin (jquery3-api): 3.5.1-2
      Command Agent Launcher Plugin (command-launcher): 1.2
      Pipeline: API (workflow-api): 2.46
      Pipeline: Job (workflow-job): 2.41
      SSH Credentials Plugin (ssh-credentials): 1.18.1
      Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.19
      Jackson 2 API Plugin (jackson2-api): 2.12.4
      Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 1.8.5
      Pipeline: Milestone Step (pipeline-milestone-step): 1.3.2
      Credentials Plugin (credentials): 2.5
      Lockable Resources plugin (lockable-resources): 2.11
      Pipeline: SCM Step (workflow-scm-step): 2.13
      Matrix Authorization Strategy Plugin (matrix-auth): 2.3
      Matrix Project Plugin (matrix-project): 1.18
      Pipeline: Stage Step (pipeline-stage-step): 2.5
      Pipeline: Build Step (pipeline-build-step): 2.14
      OWASP Markup Formatter Plugin (antisamy-markup-formatter): 1.1
      Pipeline: Input Step (pipeline-input-step): 2.12
      bouncycastle API Plugin (bouncycastle-api): 2.16.0
      Checks API plugin (checks-api): 1.5.0
      JavaScript GUI Lib: Handlebars bundle plugin (handlebars): 3.0.8
      JavaScript GUI Lib: Moment.js bundle plugin (momentjs): 1.1.1
      Plain Credentials Plugin (plain-credentials): 1.7
      Git client plugin (git-client): 3.6.0
      Pipeline: REST API Plugin (pipeline-rest-api): 2.19
      Pipeline: Basic Steps (workflow-basic-steps): 2.21
      JAXB plugin (jaxb): 2.3.0
      Font Awesome API Plugin (font-awesome-api): 5.15.2-1
      Credentials Binding Plugin (credentials-binding): 1.24
      Pipeline: Declarative (pipeline-model-definition): 1.8.5
      Pipeline: Stage View Plugin (pipeline-stage-view): 2.19
      Pipeline: Multibranch (workflow-multibranch): 2.24
      Script Security Plugin (script-security): 1.77
      GIT server Plugin (git-server): 1.9
      Snakeyaml API Plugin (snakeyaml-api): 1.29.1
      Pipeline: Step API (workflow-step-api): 2.24
      Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 1.11
      Pipeline: Model API (pipeline-model-api): 1.8.5
      Plugin Utilities API Plugin (plugin-util-api): 1.7.1
      Windows Slaves Plugin (windows-slaves): 1.0
      Pipeline: Groovy (workflow-cps): 2.93
      Popper.js API Plugin (popper-api): 1.16.1-1
      Pipeline: Nodes and Processes (workflow-durable-task-step): 2.35
      Trilead API Plugin (trilead-api): 1.0.13
      Branch API Plugin (branch-api): 2.6.2
      JDK Tool Plugin (jdk-tool): 1.0
      Folders Plugin (cloudbees-folder): 6.15
      Durable Task Plugin (durable-task): 1.37
      JUnit Plugin (junit): 1.51
      Caffeine API Plugin (caffeine-api): 2.9.1-23.v51c4e2c879c8
      SCM API Plugin (scm-api): 2.6.4
      JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
      Display URL API (display-url-api): 2.3.5
      Pipeline: Supporting APIs (workflow-support): 3.8
      Infrastructure plugin for Publish Over X (publish-over): 0.21
      Publish Over SSH (publish-over-ssh): 1.19.1
      Publish Over CIFS (publish-over-cifs): 0.9
      UI sample plugin (ui-samples-plugin): 2.0 

        Attachments

          Activity

          v_moloko Aleksei Kshumanev created issue -
          Hide
          kon Kalle Niemitalo added a comment -

          java.lang.NoSuchMethodError: 'java.lang.Object org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(java.util.Map, hudson.model.TaskListener)'

          Structs Plugin (structs): 1.23

          I thought your version of Structs might be too old, but no, it defines the missing method here: https://github.com/jenkinsci/structs-plugin/blob/292fae7437c035e32b9e4f1f2bcd9d3d7dd121b5/plugin/src/main/java/org/jenkinsci/plugins/structs/describable/DescribableModel.java#L296

          Show
          kon Kalle Niemitalo added a comment - java.lang.NoSuchMethodError: 'java.lang.Object org.jenkinsci.plugins.structs.describable.DescribableModel.instantiate(java.util.Map, hudson.model.TaskListener)' Structs Plugin (structs): 1.23 I thought your version of Structs might be too old, but no, it defines the missing method here: https://github.com/jenkinsci/structs-plugin/blob/292fae7437c035e32b9e4f1f2bcd9d3d7dd121b5/plugin/src/main/java/org/jenkinsci/plugins/structs/describable/DescribableModel.java#L296
          Hide
          v_moloko Aleksei Kshumanev added a comment -

          Still no response or solution.

          Show
          v_moloko Aleksei Kshumanev added a comment - Still no response or solution.
          v_moloko Aleksei Kshumanev made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Critical [ 2 ]
          Hide
          kon Kalle Niemitalo added a comment -

          If I had this problem, I would try to check whether any other plugin in the Jenkins controller includes a stale copy of structs.jar or otherwise embeds the DescribableModel class, instead of depending on the Structs plugin:

          for jar in plugins/*/WEB-INF/lib/*.jar
          do
              if unzip -l "$jar" | grep DescribableModel
              then
                  printf "%s\n" "$jar"
              fi
          done
          

          That should list only the Structs plugin itself:

                880  2021-05-10 21:18   org/jenkinsci/plugins/structs/describable/DescribableModel$SerializedForm.class
               2025  2021-05-10 21:18   org/jenkinsci/plugins/structs/describable/CustomDescribableModel.class
              29838  2021-05-10 21:18   org/jenkinsci/plugins/structs/describable/DescribableModel.class
          plugins/structs/WEB-INF/lib/structs.jar
          
          Show
          kon Kalle Niemitalo added a comment - If I had this problem, I would try to check whether any other plugin in the Jenkins controller includes a stale copy of structs.jar or otherwise embeds the DescribableModel class, instead of depending on the Structs plugin: for jar in plugins/*/WEB-INF/lib/*.jar do if unzip -l " $jar " | grep DescribableModel then printf "%s\n" " $jar " fi done That should list only the Structs plugin itself: 880 2021-05-10 21:18 org/jenkinsci/plugins/structs/describable/DescribableModel$SerializedForm.class 2025 2021-05-10 21:18 org/jenkinsci/plugins/structs/describable/CustomDescribableModel.class 29838 2021-05-10 21:18 org/jenkinsci/plugins/structs/describable/DescribableModel.class plugins/structs/WEB-INF/lib/structs.jar
          Hide
          kon Kalle Niemitalo added a comment -

          I wonder if it is related to JENKINS-65605.

          Show
          kon Kalle Niemitalo added a comment - I wonder if it is related to JENKINS-65605 .

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            v_moloko Aleksei Kshumanev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: