[JIRA] (JENKINS-60630) Git plugin fails to replace parametrized value in scm checkout instead it is taking parameter variable as it is

8 views
Skip to first unread message

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 3, 2020, 5:42:04 AM1/3/20
to jenkinsc...@googlegroups.com
Mahantesh Hoolikatti created an issue
 
Jenkins / Bug JENKINS-60630
Git plugin fails to replace parametrized value in scm checkout instead it is taking parameter variable as it is
Issue Type: Bug Bug
Assignee: Mark Waite
Attachments: Screenshot 2020-01-03 at 4.03.56 PM.png
Components: git-plugin
Created: 2020-01-03 10:41
Environment: Jenkins ver 2.204.1
Git Plugin 4.0.0
Labels: plugin regression git jenkins
Priority: Major Major
Reporter: Mahantesh Hoolikatti

In a pipeline job(not multibranch 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 and multibranch pipeline job 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 4.0.0 version.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 3, 2020, 5:44:02 AM1/3/20
to jenkinsc...@googlegroups.com
Mahantesh Hoolikatti updated an issue
In a pipeline job(not multibranch 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:

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 3, 2020, 5:48:03 AM1/3/20
to jenkinsc...@googlegroups.com
Mahantesh Hoolikatti updated an issue
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
4.0.0 later version .

 

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 3, 2020, 5:48:03 AM1/3/20
to jenkinsc...@googlegroups.com
Mahantesh Hoolikatti updated an issue
In a pipeline job (not multibranch 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 and multibranch pipeline job 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 4.0.0 version.

 

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 3, 2020, 9:06:02 PM1/3/20
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-60630
 
Re: Git plugin fails to replace parametrized value in scm checkout instead it is taking parameter variable as it is

Can you explain further why you have a single pipeline job that switches from one branch to another and reads its Jenkinsfile from SCM?  That seems like it would be much better suited to use a multibranch pipeline or an organization folder so that each job is created and destroyed automatically when a branch is created or destroyed.

I won't be able to attempt to duplicate this report for several days.  I'm on vacation now and am unlikely to investigate further until after I return from vacation.

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 3, 2020, 9:07:02 PM1/3/20
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-60630
Can you explain further why you have a single pipeline job that switches from one branch to another and reads its Jenkinsfile from SCM?  That will cause the change history for the job to be a mixture of many different branches.  As far as I've seen, that makes the changelog unusable.

That
seems like it would be much better suited to use a multibranch pipeline or an organization folder so that each job is created and destroyed automatically when a branch is created or destroyed.


I won't be able to attempt to duplicate this report for several days.  I'm on vacation now and am unlikely to investigate further until after I return from vacation.

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 3, 2020, 10:35:02 PM1/3/20
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-60630
Can you explain further why you have a single pipeline job that switches from one branch to another and reads its Jenkinsfile from SCM?  That will cause the change history for the job to be a mixture of many different branches.  As far as I've seen, that makes the changelog unusable.

That seems like it would be much better suited to use a multibranch pipeline or an organization folder so that each job is created and destroyed automatically when a branch is created or destroyed.

I won't be able to attempt to duplicate this report for several days.  I'm on vacation now and am unlikely to investigate further until after I return from vacation.


Can you provide more details on the last configuration that was working?  You indicate git plugin 3.0.0.  That version was released over 3 years ago.  Has it worked on any versions newer than 3.0.0?  If so, what is the most recent version where it worked the way you expected?

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 7, 2020, 8:38:03 AM1/7/20
to jenkinsc...@googlegroups.com

I am not switching from one branch to another branch. I am using git webhook and reading the webhook parameters like Branch name and commitId. I wanted to use the parameters values in GitScm so I am assigning them to variables and then using in GitScm but the variables are not replacing with values.

 

 

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 7, 2020, 8:39:02 AM1/7/20
to jenkinsc...@googlegroups.com

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 7, 2020, 8:40:02 AM1/7/20
to jenkinsc...@googlegroups.com
I am not switching from one branch to another branch. I am using git webhook and reading the webhook parameters like Branch name and commitId. I wanted to use the parameters values in GitScm so I am assigning them to variables and then using in GitScm but the variables are not replacing with values. Please find the attached screenshot for reference

!Screenshot 2020-01-07 at 7.07.17 PM.png|thumbnail!

 

 

mantuhoolikatti@gmail.com (JIRA)

unread,
Jan 7, 2020, 9:08:03 AM1/7/20
to jenkinsc...@googlegroups.com
I am not switching from one branch to another branch. I am using git webhook and reading the webhook parameters like Branch name and commitId. I wanted to use the parameters values in GitScm so I am assigning them to variables and then using in GitScm but the variables are not replacing with values. (Parameter expansion is not working) Please find the attached screenshot for reference


!Screenshot 2020-01-07 at 7.07.17 PM.png|thumbnail!

 

 

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 8, 2020, 6:18:08 AM1/8/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Jan 20, 2020, 12:00:02 AM1/20/20
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Jan 21, 2020, 2:40:07 PM1/21/20
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Feb 7, 2020, 2:12:02 PM2/7/20
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 7, 2020, 2:14:04 PM2/7/20
to jenkinsc...@googlegroups.com

alex_com@gmx.at (JIRA)

unread,
Mar 19, 2020, 8:45:03 AM3/19/20
to jenkinsc...@googlegroups.com
Alex Z commented on Bug JENKINS-60630
 
Re: Git plugin fails to replace parametrized value in scm checkout instead it is taking parameter variable as it is

Same problem for me with Git Plugin 4.2.2.

I have a pipeline with one branch to be build, it's a paramterized pipeline:

refs/tags/${BuildTag}

 

 

hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune -- origin +refs/tags/${BuildTag}:refs/remotes/origin/${BuildTag}" returned status code 128:
stdout: 
stderr: fatal: Couldn't find remote ref refs/tags/${BuildTag}
fatal: the remote end hung up unexpectedly	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2044)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:81)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:569)
	at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:361)
	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:197)
	at jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)
	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:115)
	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:69)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:427)
Finished: FAILURE

 

It worked with Git Plugin 4.1.1 and when I restore the plugin to this version it starts to work again!

Is this another ticket or should I leave it here?

Regards Alex

 

 

 

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Mar 19, 2020, 10:12:04 AM3/19/20
to jenkinsc...@googlegroups.com

Alex Z please create a separate ticket since that is a regression between 4.1.1 and 4.2.2. Please also provide the precise description of the job that you are defining, either by uploading the config.xml file from the job definition or by describing the exact steps used to define the job.

Reply all
Reply to author
Forward
0 new messages