[JIRA] (JENKINS-56943) Loading yamlFile not working with parameterized git branch

2 views
Skip to first unread message

erks@hotmail.com (JIRA)

unread,
Apr 9, 2019, 1:33:03 AM4/9/19
to jenkinsc...@googlegroups.com
Touch Ungboriboonpisal created an issue
 
Jenkins / Bug JENKINS-56943
Loading yamlFile not working with parameterized git branch
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2019-04-09 05:32
Priority: Major Major
Reporter: Touch Ungboriboonpisal

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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jglick@cloudbees.com (JIRA)

unread,
Jul 8, 2019, 2:37:02 PM7/8/19
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Won't Fix
 

${BRANCH} is a job parameter.

Passing Git branches as a build parameter is not supported by the readTrusted step used internally here. Either use a multibranch project, or inline the YAML into the Jenkinsfile, or switch to Scripted syntax and use readFile to load YAML from an actual checkout (presumably preceding the pod used for the main build).

Change By: Jesse Glick
Status: Open Resolved
Assignee: Carlos Sanchez
Resolution: Won't Fix
Reply all
Reply to author
Forward
0 new messages