Not clear how to reproduce.

      java.lang.RuntimeException: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.BindingStep from {"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.BindingStep","bindings":{"variable":"foo","credentialsId":["",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.StringBinding","kind":"org.jenkinsci.plugins.credentialsbinding.impl.StringBinding"}}
      	at hudson.model.Descriptor.newInstance(Descriptor.java:577)
      	at org.jenkinsci.plugins.workflow.cps.Snippetizer.doGenerateSnippet(Snippetizer.java:203)
      	at ...
      Caused by: java.lang.NullPointerException
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:632)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:400)
      	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:684)
      	at org.kohsuke.stapler.RequestImpl.access$100(RequestImpl.java:81)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:587)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:625)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:400)
      	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:684)
      	at org.kohsuke.stapler.RequestImpl.access$100(RequestImpl.java:81)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:587)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:400)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:396)
      	at hudson.model.Descriptor.newInstance(Descriptor.java:568)
      	... 56 more
      

          [JENKINS-27387] NPE generating snippet for BindingStep

          Jesse Glick created issue -
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-27960 [ JENKINS-27960 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-27397 [ JENKINS-27397 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-28988 [ JENKINS-28988 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-31813 [ JENKINS-31813 ]

          Hi,

          I'm getting the same error than you, see below. Any update in this fix?

          java.lang.RuntimeException: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.BindingStep from {"bindings":

          {"usernameVariable":"svn_username","passwordVariable":"svn_password","credentialsId":["59a9e8cb-97e8-4fca-9c4a-06764843d039",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding","$class":"org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding"}

          ,"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.BindingStep","$class":"org.jenkinsci.plugins.credentialsbinding.impl.BindingStep"}

          susie hernandez added a comment - Hi, I'm getting the same error than you, see below. Any update in this fix? java.lang.RuntimeException: Failed to instantiate class org.jenkinsci.plugins.credentialsbinding.impl.BindingStep from {"bindings": {"usernameVariable":"svn_username","passwordVariable":"svn_password","credentialsId":["59a9e8cb-97e8-4fca-9c4a-06764843d039",""],"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding","$class":"org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding"} ,"stapler-class":"org.jenkinsci.plugins.credentialsbinding.impl.BindingStep","$class":"org.jenkinsci.plugins.credentialsbinding.impl.BindingStep"}
          Cyrille Le Clerc made changes -
          Attachment New: screenshot-1.png [ 31700 ]

          I found a workaround when I was getting an NPE generating the snippet of a "Secret File" binding.
          I first add a binding that does not break, a "Username and password (conjoined)" binding and then the "Secret File" binding that I need. And then I can generate the groovy snippet. I just have to remove the generated binding for the "Username and password (conjoined)" and I'm done.

          Cyrille Le Clerc added a comment - I found a workaround when I was getting an NPE generating the snippet of a "Secret File" binding. I first add a binding that does not break, a "Username and password (conjoined)" binding and then the "Secret File" binding that I need. And then I can generate the groovy snippet. I just have to remove the generated binding for the "Username and password (conjoined)" and I'm done.
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Jesse Glick added a comment -

          The problem is that credentialsId is being passed as an array rather than a single value, and this code is incompatible with databinding stephenconnolly. Somehow it works in SecretBuildWrapper in a freestyle project, not sure how.

          Jesse Glick added a comment - The problem is that credentialsId is being passed as an array rather than a single value, and this code is incompatible with databinding stephenconnolly . Somehow it works in SecretBuildWrapper in a freestyle project, not sure how.

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: