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

readTrusted step doesn't resolve parameters from branch name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline
    • None

      When used Pipeline script from SCM and specified as Branch Specifier (blank for 'any'): $BRANCH which is taken from job parameters, readTrusted(path) pipeline step throws the following error:

       

      [Pipeline] readTrusted
      [Pipeline] }
      [Pipeline] // timestamps
      [Pipeline] }
      [Pipeline] // withCredentials
      [Pipeline] }
      [Pipeline] // withCredentials
      [Pipeline] }
      [Pipeline] // timeout
      [Pipeline] }
      [Pipeline] // ansiColor
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/$BRANCH:refs/remotes/origin/$BRANCH --prune" returned status code 128:
      stdout: 
      stderr: fatal: Couldn't find remote ref refs/heads/$BRANCH
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
      	at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:352)
      	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:196)
      	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:172)
      	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
      

      Thanks for help in advance

            Unassigned Unassigned
            mzolna Marcin Zolna
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: