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

PipelineScript from SCM is not accepting Parameters as input

      Hi,

      For a Pipeline job, I have a parameter named BRANCH. I am using ${BRANCH} under Branches to build of Pipeline Script from SCM .While executing the job, I am passing my branch name in BRANCH. But Jenkins is not able to use it. I am getting below error.

       > /usr/bin/git config --local --remove-section credential # timeout=10
       > /usr/bin/git rev-parse origin/${BRANCH}^{commit} # timeout=10
       > /usr/bin/git rev-parse ${BRANCH}^{commit} # timeout=10
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE
      

          [JENKINS-37681] PipelineScript from SCM is not accepting Parameters as input

          Gary Mangum added a comment -

          I am also seeing this problem after updating my jenkins.war file today. So far I haven't figured out a workaround.

          Gary Mangum added a comment - I am also seeing this problem after updating my jenkins.war file today. So far I haven't figured out a workaround.

          Gary Mangum added a comment -

          Ok, I just came across this, which seems to work:https://issues.jenkins-ci.org/browse/JENKINS-29031

          Essentially, you just have to launch Jenkins with this flag:
          -Dhudson.model.ParametersAction.keepUndefinedParameters=true

          Gary Mangum added a comment - Ok, I just came across this, which seems to work: https://issues.jenkins-ci.org/browse/JENKINS-29031 Essentially, you just have to launch Jenkins with this flag: -Dhudson.model.ParametersAction.keepUndefinedParameters=true

          Gary Mangum added a comment -

          Gary Mangum added a comment - read this: https://wiki.jenkins-ci.org/display/SECURITY/Jenkins+Security+Advisory+2016-05-11

          I have the same issue here. Sadly neither hudson.model.ParametersAction.safeParameters=BRANCH nor hudson.model.ParametersAction.safeParameters=true works for me. I still get the error as stated in the description.
          I tried to set the parameters via script console (and did read them back and printed them), as well as via environment variable JENKINS_JAVA_OPTIONS=-Dhudson.model.ParametersAction.keepUndefinedParameters=true.
          Jenkins version is 2.21 running on top of Tomcat 7.

          Andreas Oetken added a comment - I have the same issue here. Sadly neither hudson.model.ParametersAction.safeParameters=BRANCH nor hudson.model.ParametersAction.safeParameters=true works for me. I still get the error as stated in the description. I tried to set the parameters via script console (and did read them back and printed them), as well as via environment variable JENKINS_JAVA_OPTIONS=-Dhudson.model.ParametersAction.keepUndefinedParameters=true. Jenkins version is 2.21 running on top of Tomcat 7.

            huybrechts huybrechts
            anudeeplalam Anudeep Lalam
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: