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

Password Parameter not working with defaultValue in version - 2.263.4

    XMLWordPrintable

    Details

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

      Description

      Hi Team Jenkins, 

      We have recently upgraded our Jenkins from version 2.222.1 to 2.263.4.

      After upgrade issue related to password parameter encountered in declarative pipelines. please find console log below. 

       

      WorkflowScript: 8: Invalid parameter "defaultValueAsSecret", did you mean "defaultValue"? @ line 8, column 13.WorkflowScript: 8: Invalid parameter "defaultValueAsSecret", did you mean "defaultValue"? @ line 8, column 13.        string defaultValueAsSecret: 'password', description: 'Password for accessing weblogic console that is not public.', name: 'WEBLOGIC_SECRET', trim: false               ^
      1 error
      at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) 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.doParse(CpsGroovyShell.java:142) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:561) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:522) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:337) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)Finished: FAILURE

       

       

        Attachments

          Activity

          Hide
          olamy Olivier Lamy added a comment -

          why using the component `declarative-pipeline-migration-assistant-plugin` is it related to it?

          otherwise we need some context such a reproductive Jenkinsfile

          Show
          olamy Olivier Lamy added a comment - why using the component ` declarative-pipeline-migration-assistant-plugin ` is it related to it? otherwise we need some context such a reproductive Jenkinsfile
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Might be related to the input() use-case in JENKINS-63516

           

          input(message: 'Approve?', parameters: [password(name: 'foo', defaultValueAsSecret: Secret.fromString('bar'), description: 'baz')])
          

          One concern is that defaultValueAsSecret was introduced only in 2.235.5 after backporting of a security hardening patch by Daniel Beckhttps://github.com/jenkinsci/jenkins/commit/8a9a1b2f7bf72c305597ed5e7121b80f58528c5c . There was no defaultValueAsSecret in  2.222.1, so I am not sure how this use-case was working before.

           

          Show
          oleg_nenashev Oleg Nenashev added a comment - Might be related to the input() use-case in  JENKINS-63516   input(message: 'Approve?' , parameters: [password(name: 'foo' , defaultValueAsSecret: Secret.fromString( 'bar' ), description: 'baz' )]) One concern is that defaultValueAsSecret was introduced only in  2.235.5  after backporting of a security hardening patch by Daniel Beck :  https://github.com/jenkinsci/jenkins/commit/8a9a1b2f7bf72c305597ed5e7121b80f58528c5c  . There was no defaultValueAsSecret in  2.222.1, so I am not sure how this use-case was working before.  
          Hide
          danielbeck Daniel Beck added a comment -

          introduced only in 2.235.5 after backporting of a security hardening patch

          The linked commit was a public improvement and didn't get backported, deliberately, because of compatibility concerns I even put the PR on hold so it wouldn't go into 2.235. It first appeared in 2.249.x LTS.

          Show
          danielbeck Daniel Beck added a comment - introduced only in  2.235.5  after backporting of a security hardening patch The linked commit was a public improvement and didn't get backported, deliberately, because of compatibility concerns I even put the PR on hold so it wouldn't go into 2.235. It first appeared in 2.249.x LTS.
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Right, sorry. Took the wrong version in https://www.jenkins.io/changelog-stable/ . My comment still applies though

          Show
          oleg_nenashev Oleg Nenashev added a comment - Right, sorry. Took the wrong version in https://www.jenkins.io/changelog-stable/  . My comment still applies though

            People

            Assignee:
            olamy Olivier Lamy
            Reporter:
            anujgupta Anuj Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: