| For a pipeline job, using a declarative syntax with yamlFile, the job fails with the following exception during the yaml file loading step:
[Pipeline] Start of Pipeline
[Pipeline] readTrusted
[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:2318)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1905)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:81)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:488)
at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:349)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:198)
at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:174)
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)
${BRANCH} is a job parameter. Note that this is NOT the same as https://issues.jenkins-ci.org/browse/JENKINS-52623, as it only affects the yamlFile usage. Switching to yaml works fine. It was also mentioned here: https://issues.jenkins-ci.org/browse/JENKINS-52259?focusedCommentId=344959&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-344959 |