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

Cannot save pipeline with a wrapper

    Details

    • Similar Issues:
    • Sprint:
      Declarative - 1.2

      Description

      Jenkinsfile:

      pipeline {
          agent any
          stages {
              stage('Test') {
                  steps {
                      wrap([$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']) {
                          sh '''
                          ls /tmp
                          cat /tmp/jenkins'''
                      }
                  }
              }
              stage('Publish') {
                  steps {
                      wrap([$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']) {
                          sh '''
                          ls /tmp
                          cat /tmp/jenkins'''
                      }
                  }
              }
          } 
      }
      

      When I hit "Save and Run" in the Blue Ocean editor, it does nothing and gives no indication of an error. When I browse the network requests tab I see a request to `http://localhost:8080/jenkins/pipeline-model-converter/toJenkinsfile` that returned 200, but included a failure message:

      {
         "status":"ok",
         "data":{
            "result":"failure",
            "errors":[
               {
                  "location":[
                     "pipeline",
                     "stages",
                     "0",
                     "branches",
                     "0",
                     "steps",
                     "0",
                     "arguments",
                     "0",
                     "value"
                  ],
                  "error":"Expecting \"class jenkins.tasks.SimpleBuildWrapper\" for parameter \"delegate\" but got \"[$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']\" of type class java.lang.String instead"
               },
               {
                  "location":[
                     "pipeline",
                     "stages",
                     "1",
                     "branches",
                     "0",
                     "steps",
                     "0",
                     "arguments",
                     "0",
                     "value"
                  ],
                  "error":"Expecting \"class jenkins.tasks.SimpleBuildWrapper\" for parameter \"delegate\" but got \"[$class: 'org.boxboat.plugins.lxd.HelloWorldWrapper']\" of type class java.lang.String instead"
               }
            ]
         }
      }
      

       

        Attachments

          Activity

          Hide
          madmax184 Max von Preuschen added a comment -

          I'm having the same issue. I can't add a delegate class through the text input field in the Blue Ocean UI.
          Whatever you enter is interpreted as String - not as a class.

           

          Show
          madmax184 Max von Preuschen added a comment - I'm having the same issue. I can't add a delegate class through the text input field in the Blue Ocean UI. Whatever you enter is interpreted as String - not as a class.  
          Hide
          madmax184 Max von Preuschen added a comment -

          using Blue Ocean 1.4.2

          Show
          madmax184 Max von Preuschen added a comment - using Blue Ocean 1.4.2
          Hide
          madmax184 Max von Preuschen added a comment -

          Reopening this issue, since it seems there is no possibility to enter a valid value into the "Delegate" text input field. 

          • Expecting "class jenkins.tasks.SimpleBuildWrapper" for parameter "delegate" but got "..." of type class java.lang.String instead
          Show
          madmax184 Max von Preuschen added a comment - Reopening this issue, since it seems there is no possibility to enter a valid value into the "Delegate" text input field.  Expecting "class jenkins.tasks.SimpleBuildWrapper" for parameter "delegate" but got "..." of type class java.lang.String instead
          Hide
          abayer Andrew Bayer added a comment -

          Max von Preuschen - please open a new JIRA in the blueocean component.

          Show
          abayer Andrew Bayer added a comment - Max von Preuschen - please open a new JIRA in the blueocean component.
          Hide
          bitwiseman Liam Newman added a comment -

          Bulk closing resolved issues.

          Show
          bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              caleblloyd Caleb Lloyd
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: