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

Git plugin fails to replace parametrized value in scm checkout instead it is taking parameter variable as it is

XMLWordPrintable

    • 4.14.0

      In a pipeline job from a git repository where the "Branch Specifier" is given as a parameter and Lightweight option is also not checked but still I am getting below error

      hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune – origin +refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}" returned status code 128:
      stdout:
      stderr: fatal: Couldn't find remote ref refs/heads/${BRANCH}

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2372)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1985)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:563)
      at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:348)
      at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)
      at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)
      at org.jenkinsci.plugins.workflow.multibranch.ReadTrustedStep$Execution.run(ReadTrustedStep.java:101)
      at org.jenkinsci.plugins.workflow.multibranch.ReadTrustedStep$Execution.run(ReadTrustedStep.java:82)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      at hudson.security.ACL.impersonate(ACL.java:290)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Finished: FAILURE

      I am trying with git parameter as well as string parameter and on both occasions getting same error

      I have observed the parameter value work well in fresstyle project but not work in simple pipeline job.

      I have tested with some git older version 3.0.0 which works will with pipeline job but same thing not works in later version

       

            Unassigned Unassigned
            mahan7 Mahantesh Hoolikatti
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: