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

Error: No signature of method for DescribableContext

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: job-dsl-plugin
    • Labels:
      None
    • Environment:
      Linux, CentOS 7.5
      Jenkins 2.121.1
      job-dsl-plugin 1.70
    • Similar Issues:

      Description

      The following job DSL script:

      pipelineJob("adam-$type") {
          parameters {
              choice {
                  name 'ENVIRONMENT'
                  choices 'development\ntesting\nproduction'
                  description '''which'''
              }
          }
          definition {
            cps {
              ...
            }
          }
      }
      

      worked fine so far, last run of the seed job was May, 25th.

      Currently, the job-dsl plugin is version 1.70 and running the seed job now results in the following error:

      Processing DSL script deploy.groovy
          ERROR: (deploy.groovy, line 22) No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.choices() is applicable for argument types: (java.lang.String) values: [development
          testing
          production]
          Possible solutions: collect()
      

      Changing the code to use an array:

      choices ['development', 'testing', 'production'].toArray()
      

      reports:

      ERROR: (deploy.groovy, line 22) No such property: choices for class: javaposse.jobdsl.plugin.structs.DescribableContext
      

      Also, the "Job DSL API Reference" online help is mostly unhelpful, since going to /plugin/job-dsl/api-viewer/index.html#path/pipelineJob-parameters-choice-choices and clicking on the ellipsis inside {{choices

      { ... }

      }}, seems to display all and every available DSL method like accountInfo, administrator, apiToken, et cetera but not something relevant in the current context.

      OK, using `choiceParam` with a different call syntax this works again:

      choiceParam('ENVIRONMENT', ['development', 'testing', 'production'], '''which''')
      

      But, why did it break?

        Attachments

          Activity

          Hide
          hong yan-hong wang added a comment -

          Hello:

           

          I meet the same situation.

          Now I can only still keep version with 2.107.3.

          Because 2.121.1 have the problem describe above.

          Before I tried to post this problem here.

          https://issues.jenkins-ci.org/browse/JENKINS-26143

           

          Hong

          Show
          hong yan-hong wang added a comment - Hello:   I meet the same situation. Now I can only still keep version with 2.107.3. Because 2.121.1 have the problem describe above. Before I tried to post this problem here. https://issues.jenkins-ci.org/browse/JENKINS-26143   Hong
          Hide
          daspilker Daniel Spilker added a comment -
          Show
          daspilker Daniel Spilker added a comment - The problem has been introduced in Jenkins 2.112 with this change: https://github.com/jenkinsci/jenkins/commit/bd7fd304a7bc93b4efc1c8f88887e262aa329b86#diff-57af7b01f979c7d15ff3d7b5f56e478b

            People

            Assignee:
            daspilker Daniel Spilker
            Reporter:
            jenkey Claudio B
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: