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

Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Critical Critical
    • git-parameter-plugin
    • Jenkins version 2.3, all Plugins up to date. Debian 8 64 Bits x86.

      I try to setup a pipeline project to build tags using a Jenkinsfile from SCM (Git). Therefore I want to be be able to set the tag I wish to build via the Git Parameter Plugin. If I setup the project like this and hit the "Build with Parameters" button the git parameter plugin tells me "!No Git repository configured in SCM configuration".

        1. params.PNG
          params.PNG
          15 kB
        2. pipeline.PNG
          pipeline.PNG
          32 kB
        3. Screenshot_20160817_145201.png
          Screenshot_20160817_145201.png
          42 kB
        4. Screenshot_20160817_145625.png
          Screenshot_20160817_145625.png
          18 kB
        5. screenshot-1.png
          screenshot-1.png
          40 kB
        6. screenshot-2.png
          screenshot-2.png
          30 kB
        7. screenshot-3.png
          screenshot-3.png
          72 kB
        8. Selection_104.png
          Selection_104.png
          50 kB

          [JENKINS-34876] Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          Same here!

          Sebastian Mandrean added a comment - Same here!

          Me as well. You can't pass a parameter into the `Branch specifier` field of the pipeline SCM section, can you? I tried, unsuccessfully.

          Jonathan Strootman added a comment - Me as well. You can't pass a parameter into the `Branch specifier` field of the pipeline SCM section, can you? I tried, unsuccessfully.

          Jesse Glick added a comment -

          Not a duplicate. Rather missing Pipeline integration with this plugin.

          Jesse Glick added a comment - Not a duplicate. Rather missing Pipeline integration with this plugin.

          Mark Austin added a comment -

          I observed the same behavior, but I came up with a hacky workaround...

          I wrote a shell script that will dump git tags into a sorted list that can be ingested as a property file when using the the Extended Choice Parameter plugin.

          1) Run this script in the root of your git checkout dir:

          genVers.sh
          git tag -l --sort=version:refname | sort -r | xargs echo -n | sed 's/ /,/g' | sed '1s/^/key=/' > /tmp/versions.properties
          

          2) Install the Extended Choice Parameter plugin and add it to your job
          https://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin

          3) Point the config to the property file you generated and set the key. See my attached example:

          4) Test it

          Mark Austin added a comment - I observed the same behavior, but I came up with a hacky workaround... I wrote a shell script that will dump git tags into a sorted list that can be ingested as a property file when using the the Extended Choice Parameter plugin. 1) Run this script in the root of your git checkout dir: genVers.sh git tag -l --sort=version:refname | sort -r | xargs echo -n | sed 's/ /,/g' | sed '1s/^/key=/' > /tmp/versions.properties 2) Install the Extended Choice Parameter plugin and add it to your job https://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin 3) Point the config to the property file you generated and set the key. See my attached example: 4) Test it

          Scott Crooks added a comment -

          ganthore With your script, does this assume that the Git repo has already been checked out? I'm just wondering how to run the script before the Pipeline starts. It seems you need to run the script before the pipeline actually starts so that you can populate some variable with your desired tag. The question would be, where would the one line BASH command be executed?

          Scott Crooks added a comment - ganthore With your script, does this assume that the Git repo has already been checked out? I'm just wondering how to run the script before the Pipeline starts. It seems you need to run the script before the pipeline actually starts so that you can populate some variable with your desired tag. The question would be, where would the one line BASH command be executed?

          Hi Guys,
          I working on resolving this issue. I have prototype solution.
          Which supports Pipline job.
          I hope to resolved this in release 0.7.0 Releases schedule

          Regards

          Boguslaw Klimas added a comment - Hi Guys, I working on resolving this issue. I have prototype solution. Which supports Pipline job. I hope to resolved this in release 0.7.0 Releases schedule Regards

          Mark Austin added a comment - - edited

          Hey Scott,

          Yes that is correct. I'd have the git repo poll and then ensure that the script is executed after each poll. I know it's not ideal, but it works for now until klimas7 gets things patched up.

          Mark Austin added a comment - - edited Hey Scott, Yes that is correct. I'd have the git repo poll and then ensure that the script is executed after each poll. I know it's not ideal, but it works for now until klimas7 gets things patched up.

          Scott Crooks added a comment - - edited

          ganthore,

          Can you be a bit more detailed about your job setup? I get that the BASH command you have above will grab the list of tags, and that it will put that in a file, and that the Extended Choice parameter will read that file at build time. What I don't get is when that BASH command is executed? In Jenkins pipeline, there's no option to run a BASH script before the Extended Choice plugin grabs the list of tags.

          Scott Crooks added a comment - - edited ganthore , Can you be a bit more detailed about your job setup? I get that the BASH command you have above will grab the list of tags, and that it will put that in a file, and that the Extended Choice parameter will read that file at build time. What I don't get is when that BASH command is executed? In Jenkins pipeline, there's no option to run a BASH script before the Extended Choice plugin grabs the list of tags.

          Mark Austin added a comment - - edited

          Hey Scott,

          I guess we could just run a script like this as an alternative on the Jenkins master so that the main workspace has access to the properties file:

          git ls-remote -t https://github.com/jenkinsci/github-plugin | awk '{print $2}' | cut -d '/' -f 3 | cut -d '^' -f 1 | sort -b -t . -k 1,1nr -k 2,2nr -k 3,3r -k 4,4r -k 5,5r | uniq | xargs echo -n | sed 's/ /,/g' | sed '1s/^/key=/' > /tmp/versions.properties
          

          That way we don't have to force Jenkins to double checkout the git repo per my older example.

          There are a number of ways you could do this. The end goal is to make sure that the script runs on a regular basis or immediately after the jenkins workspace has polled the git repo.

          For instance, you could have the script execute on the jenkins master directly through something as simple as a cron job.

          Or, you could also try running it with a post-merge git hook in the workspace, that way it runs each time after a "git pull" occurs. Here is a basic example that you could modify for your needs:
          https://gist.github.com/sindresorhus/7996717

          If you're familiar with incron (http://inotify.aiken.cz/?section=incron&page=why&lang=en), you could have that daemon execute the script each time it notices a file change in the git checkout folder on the workspace.

          ... or just wait for this bug to get patched.

          Hope this helps...

          Mark Austin added a comment - - edited Hey Scott, I guess we could just run a script like this as an alternative on the Jenkins master so that the main workspace has access to the properties file: git ls-remote -t https: //github.com/jenkinsci/github-plugin | awk '{print $2}' | cut -d '/' -f 3 | cut -d '^' -f 1 | sort -b -t . -k 1,1nr -k 2,2nr -k 3,3r -k 4,4r -k 5,5r | uniq | xargs echo -n | sed 's/ /,/g' | sed '1s/^/key=/' > /tmp/versions.properties That way we don't have to force Jenkins to double checkout the git repo per my older example. There are a number of ways you could do this. The end goal is to make sure that the script runs on a regular basis or immediately after the jenkins workspace has polled the git repo. For instance, you could have the script execute on the jenkins master directly through something as simple as a cron job. Or, you could also try running it with a post-merge git hook in the workspace, that way it runs each time after a "git pull" occurs. Here is a basic example that you could modify for your needs: https://gist.github.com/sindresorhus/7996717 If you're familiar with incron ( http://inotify.aiken.cz/?section=incron&page=why&lang=en ), you could have that daemon execute the script each time it notices a file change in the git checkout folder on the workspace. ... or just wait for this bug to get patched. Hope this helps...

          Scott Crooks added a comment - - edited

          ganthore We currently "solve" the problem by doing essentially what you suggested at build time using a pipeline stage:

          parallel (
          	getRepo1Tags: {
          		sh("git ls-remote --quiet --tags --heads ${repo1GitUrl} | awk '{print \$2}' | grep -vi '{}' | cut -d/ -f1,2 --complement > ${repo1TmpTags}")
          	},
          	getRepo2Tags: {
          		sh("git ls-remote --quiet --tags --heads ${repo2GitUrl} | awk '{print \$2}' | grep -vi '{}' | cut -d/ -f1,2 --complement > ${repo2TmpTags}")
          	}
          )
          

          After that we use the "input" command in pipeline to pause the build and wait for user input.

          def listofRepo1TagsBranches = readFile(repo1TmpTags).trim()
          def repo1TagBranch = input([message: 'Select a Git branch / tag', parameters: [[$class: 'ChoiceParameterDefinition', choices: listofRepo1TagsBranches, description: '', name: 'Repo 1 branch / tag to build']]])
          
          def listofRepo2TagsBranches = readFile(repo2TmpTags).trim()
          def repo2TagBranch = input([message: 'Select a Git branch / tag', parameters: [[$class: 'ChoiceParameterDefinition', choices: listofRepo2TagsBranches, description: '', name: 'Repo 2 branch / tag to build']]])
          

          This works if you're not using automated deployments. However, for our staging environments, we rely on a webhook to be called so that code is automatically pushed to staging. I'm not sure how you would parameterize this without this plugin getting updated for pipeline support. Anyway, I'll figure out another solution in the meantime.

          Scott Crooks added a comment - - edited ganthore We currently "solve" the problem by doing essentially what you suggested at build time using a pipeline stage: parallel ( getRepo1Tags: { sh( "git ls-remote --quiet --tags --heads ${repo1GitUrl} | awk '{print \$2}' | grep -vi '{}' | cut -d/ -f1,2 --complement > ${repo1TmpTags}" ) }, getRepo2Tags: { sh( "git ls-remote --quiet --tags --heads ${repo2GitUrl} | awk '{print \$2}' | grep -vi '{}' | cut -d/ -f1,2 --complement > ${repo2TmpTags}" ) } ) After that we use the "input" command in pipeline to pause the build and wait for user input. def listofRepo1TagsBranches = readFile(repo1TmpTags).trim() def repo1TagBranch = input([message: 'Select a Git branch / tag' , parameters: [[$class: 'ChoiceParameterDefinition' , choices: listofRepo1TagsBranches, description: '', name: ' Repo 1 branch / tag to build']]]) def listofRepo2TagsBranches = readFile(repo2TmpTags).trim() def repo2TagBranch = input([message: 'Select a Git branch / tag' , parameters: [[$class: 'ChoiceParameterDefinition' , choices: listofRepo2TagsBranches, description: '', name: ' Repo 2 branch / tag to build']]]) This works if you're not using automated deployments. However, for our staging environments, we rely on a webhook to be called so that code is automatically pushed to staging. I'm not sure how you would parameterize this without this plugin getting updated for pipeline support. Anyway, I'll figure out another solution in the meantime.

          Code changed in jenkins
          User: Boguslaw Klimas
          Path:
          pom.xml
          src/findbugs/excludesFilter.xml
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractJobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractProjectJobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapperFactory.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/UnsupportedJobType.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages.properties
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages_pl.properties
          src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinitionTest.java
          http://jenkins-ci.org/commit/git-parameter-plugin/3885d16c08943acd696a1c618d78687c4d63a0cb
          Log:
          JENKINS-34876 Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boguslaw Klimas Path: pom.xml src/findbugs/excludesFilter.xml src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractJobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractProjectJobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapperFactory.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/UnsupportedJobType.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages.properties src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages_pl.properties src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinitionTest.java http://jenkins-ci.org/commit/git-parameter-plugin/3885d16c08943acd696a1c618d78687c4d63a0cb Log: JENKINS-34876 Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          Hi
          I was created branch feature/JENKINS-34876 where I added support to pipeline job.
          I was left to implement one method - perhaps is not necessary I must check it. If you want, you can build plugin from source and check it
          I plan to release plugin about 10 sep

          Regards
          Boguslaw

          Boguslaw Klimas added a comment - Hi I was created branch feature/JENKINS-34876 where I added support to pipeline job. I was left to implement one method - perhaps is not necessary I must check it. If you want, you can build plugin from source and check it I plan to release plugin about 10 sep Regards Boguslaw

          Code changed in jenkins
          User: Boguslaw Klimas
          Path:
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractProjectJobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages.properties
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages_pl.properties
          http://jenkins-ci.org/commit/git-parameter-plugin/5fc8a95ef5d23d704ca4e60ff668671be924ee20
          Log:
          JENKINS-34876 Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boguslaw Klimas Path: src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractProjectJobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages.properties src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages_pl.properties http://jenkins-ci.org/commit/git-parameter-plugin/5fc8a95ef5d23d704ca4e60ff668671be924ee20 Log: JENKINS-34876 Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          Code changed in jenkins
          User: klimas7
          Path:
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java
          http://jenkins-ci.org/commit/git-parameter-plugin/b9c7ef390108df624f14c88a45b0be5156ebfe86
          Log:
          JENKINS-34876 Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: klimas7 Path: src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java http://jenkins-ci.org/commit/git-parameter-plugin/b9c7ef390108df624f14c88a45b0be5156ebfe86 Log: JENKINS-34876 Git Parameters not working for Pipeline projects and Jenkinsfile from SCM

          Code changed in jenkins
          User: Boguslaw Klimas
          Path:
          pom.xml
          src/findbugs/excludesFilter.xml
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractJobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractProjectJobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapper.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapperFactory.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/UnsupportedJobType.java
          src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages.properties
          src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages_pl.properties
          src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinitionTest.java
          http://jenkins-ci.org/commit/git-parameter-plugin/9b1243d06a5af91494417c8cd697d14af4669bf7
          Log:
          Merge pull request #36 from jenkinsci/feature/JENKINS-34876

          Feature/jenkins 34876

          Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/f047198dda1e...9b1243d06a5a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boguslaw Klimas Path: pom.xml src/findbugs/excludesFilter.xml src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractJobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/AbstractProjectJobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapper.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/JobWrapperFactory.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/UnsupportedJobType.java src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/WorkflowJobWrapper.java src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages.properties src/main/resources/net/uaznia/lukanus/hudson/plugins/gitparameter/jobs/Messages_pl.properties src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinitionTest.java http://jenkins-ci.org/commit/git-parameter-plugin/9b1243d06a5af91494417c8cd697d14af4669bf7 Log: Merge pull request #36 from jenkinsci/feature/ JENKINS-34876 Feature/jenkins 34876 Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/f047198dda1e...9b1243d06a5a

          Anudeep Lalam added a comment -

          Hi,

          When can we expect the release of Git Parameter Plugin latest version i.e. 0.7.0

          Anudeep Lalam added a comment - Hi, When can we expect the release of Git Parameter Plugin latest version i.e. 0.7.0

          Hi,
          I didn't have enough time in weekend, I'll do it today.
          Sorry, for that

          Regards
          Boguslaw

          Boguslaw Klimas added a comment - Hi, I didn't have enough time in weekend, I'll do it today. Sorry, for that Regards Boguslaw

          Anudeep Lalam added a comment -

          Hi klimas7,

          Thanks for the prompt response..

          Anudeep Lalam added a comment - Hi klimas7 , Thanks for the prompt response..

          Release 0.7.0

          Boguslaw Klimas added a comment - Release 0.7.0

          Yan Wang added a comment -

          I just tried 0.7.0 and I can choose git branches and tags in the drop down.

          But I failed to use it as a variable in * Branch Specifier*, seems the variable is not parsed at all.

          Yan Wang added a comment - I just tried 0.7.0 and I can choose git branches and tags in the drop down. But I failed to use it as a variable in * Branch Specifier*, seems the variable is not parsed at all.

          Hi, wyvernnot
          I have configured a simple job:
          Parameter:

          Git Config:

          And job work fine

          Could you get me something more information? About your configuration.

          Regards
          Boguslaw

          Boguslaw Klimas added a comment - Hi, wyvernnot I have configured a simple job: Parameter: Git Config: And job work fine Could you get me something more information? About your configuration. Regards Boguslaw

          Yan Wang added a comment -

          Hi, I am using Jenkins@2.7.4 with a pipeline project.

          here is the params settings

          here is the pipeline settings

          Yan Wang added a comment - Hi, I am using Jenkins@2.7.4 with a pipeline project. here is the params settings here is the pipeline settings

          Yan Wang added a comment -

          Oh, I just tried String Parameters and it does not work neither.

          So I guess the problem is not with Git Parameter plugin but SCM plugin.

          Related issue is: https://issues.jenkins-ci.org/browse/JENKINS-34540

          Yan Wang added a comment - Oh, I just tried String Parameters and it does not work neither. So I guess the problem is not with Git Parameter plugin but SCM plugin. Related issue is: https://issues.jenkins-ci.org/browse/JENKINS-34540

          Minh Chung added a comment -

          klimas7 Thank you for working on this ticket. I apologize for bringing it back up but I was wondering would it be possible to parametize git branches from the checkouts done in the Jenkinsfile pipeline? I was able to get this this to work in the Pipeline for the primary git source but my Jenkinsfile has additional git sources I also need to check out and would like to parametize those git source branches for selection. 

          Minh Chung added a comment - klimas7 Thank you for working on this ticket. I apologize for bringing it back up but I was wondering would it be possible to parametize git branches from the checkouts done in the Jenkinsfile pipeline? I was able to get this this to work in the Pipeline for the primary git source but my Jenkinsfile has additional git sources I also need to check out and would like to parametize those git source branches for selection. 

          it looks like is a problem in scripted pipeline. When i changed the script to declarative it worked

          Julian Mosquera added a comment - it looks like is a problem in scripted pipeline. When i changed the script to declarative it worked

          JJ Ruescas added a comment -

          julian_linux, were you able to get it fixed. I'm experiencing a similar issue.

          JJ Ruescas added a comment - julian_linux , were you able to get it fixed. I'm experiencing a similar issue.

          Nick Nieslanik added a comment - - edited

          Hi!  I am using Jenkins LTS 2.190.2 via Docker container and I'm experiencing this issue using a SCM declarative pipeline.  I have an Extensible Choice param in the job that is letting me pick a branch, and then I am referring to the branch variable selection as

          ${webapp_branch}

          in the pipeline settings for the Jenkinsfile in SCM (specifically GIT).  Based on my reading of this issue, it seems as if folks think this is fixed?  I am definitely able to repo consistently across a number of declarative pipeline jobs on my server.  I have config extremely similar to wyvernnot's screenshots from 2016.  klimas7  Any insight here?

           

          Screenshots:

          choice settings

          pipeline settings

           

          Error from build:

           

          hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune -- origin +refs/heads/${webapp_branch}:refs/remotes/origin/${webapp_branch}" returned status code 128:
          stdout: 
          stderr: fatal: Couldn't find remote ref refs/heads/${webapp_branch}	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2174)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1866)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
          	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:547)
          	at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:358)
          	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:113)
          	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:299)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          

           

           

          Nick Nieslanik added a comment - - edited Hi!  I am using Jenkins LTS 2.190.2 via Docker container and I'm experiencing this issue using a SCM declarative pipeline.  I have an Extensible Choice param in the job that is letting me pick a branch, and then I am referring to the branch variable selection as ${webapp_branch} in the pipeline settings for the Jenkinsfile in SCM (specifically GIT).  Based on my reading of this issue, it seems as if folks think this is fixed?  I am definitely able to repo consistently across a number of declarative pipeline jobs on my server.  I have config extremely similar to  wyvernnot 's screenshots from 2016.  klimas7   Any insight here?   Screenshots: choice settings pipeline settings   Error from build:   hudson.plugins.git.GitException: Command "git fetch --tags --progress --prune -- origin +refs/heads/${webapp_branch}:refs/remotes/origin/${webapp_branch}" returned status code 128: stdout: stderr: fatal: Couldn't find remote ref refs/heads/${webapp_branch} at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2174) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1866) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:547) at jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:358) 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:113) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:67) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:299) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE    

          Ievgen added a comment -

          Hi there. Got the same issue again. Git tag parameter been not delivered to git checkout action.
          Jenkins:Jenkins 2.289.1
          Parameter plugin: 

          Ievgen added a comment - Hi there. Got the same issue again. Git tag parameter been not delivered to git checkout action. Jenkins: Jenkins 2.289.1 Parameter plugin:  0.9.13

            klimas7 Boguslaw Klimas
            enno Andreas Oetken
            Votes:
            15 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated: