Open rcjames opened 2 years ago
Hi,
Sorry for the delay but I'm in holidays and this plugin have few developers 😉 . I can try have a look when I come back but your use case is very particular with Kubernetes, it may take time that I test in the same environment.
The error message seems indicate that the git client is not installed on your worker, can you verify your worker tools configuration ?
@philippart-s - Not to worry. This is not an urgent thing.
The error message seems indicate that the git client is not installed on your worker, can you verify your worker tools configuration ?
I have exec'd into one of the agents and confirmed that git is installed and on the path. The git checkout defined in the pipeline manifest I have included above also has no issues.
@philippart-s I am getting the same error without using kubernetes.
pipeline script:
def repositories = [
'ssh://git@git.example.com/git-repository-url'
]
def credentials = 'credentials-id'
def builders = [:]
repositories.eachWithIndex { elem, index ->
builders[index.toString()] = {
node('build-agent-with-git-installed') {
stage('checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/main']], extensions: [[$class: 'CloneOption', noTags: false, reference: '', shallow: false]], userRemoteConfigs: [[credentialsId: credentials, url: elem]]])
}
stage('Get next version ...') {
echo 'start new version'
sh('which git')
sh('echo $PATH')
sh('git tag')
sh('git show 0.1.0')
CURRENT_VERSION=currentVersion()
echo "Current version: $CURRENT_VERSION"
NEXT_VERSION=nextVersion()
echo "Next version : $NEXT_VERSION"
}
}
}
}
parallel builders
build log:
[2022-09-09T15:33:12.442Z] Started by user User1
[2022-09-09T15:33:12.466Z] [Pipeline] Start of Pipeline
[2022-09-09T15:33:12.482Z] [Pipeline] parallel
[2022-09-09T15:33:12.485Z] [Pipeline] { (Branch: 0)
[2022-09-09T15:33:12.500Z] [Pipeline] node
[2022-09-09T15:33:12.507Z] Running on build-agent-with-git-installed in /var/lib/jenkins-agent/agent/workspace/Test/test-release
[2022-09-09T15:33:12.512Z] [Pipeline] {
[2022-09-09T15:33:12.520Z] [Pipeline] stage
[2022-09-09T15:33:12.521Z] [Pipeline] { (checkout)
[2022-09-09T15:33:12.532Z] [Pipeline] checkout
[2022-09-09T15:33:12.538Z] The recommended git tool is: NONE
[2022-09-09T15:33:12.548Z] using credential credentials-id
[2022-09-09T15:33:12.557Z] Fetching changes from the remote Git repository
[2022-09-09T15:33:12.553Z] > /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins-agent/agent/workspace/Test/test-release/.git # timeout=10
[2022-09-09T15:33:12.559Z] > /usr/bin/git config remote.origin.url ssh://git@git.example.com/git-repository-url # timeout=10
[2022-09-09T15:33:12.566Z] Fetching upstream changes from ssh://git@git.eskatos.com:7999/tem/another-test-repository.git
[2022-09-09T15:33:12.566Z] > /usr/bin/git --version # timeout=10
[2022-09-09T15:33:12.570Z] > git --version # 'git version 2.30.2'
[2022-09-09T15:33:12.570Z] using GIT_SSH to set credentials templates@esk-jenkins-01
[2022-09-09T15:33:12.571Z] Verifying host key using known hosts file, will automatically accept unseen keys
[2022-09-09T15:33:12.573Z] > /usr/bin/git fetch --tags --force --progress -- ssh://git@git.example.com/git-repository-url +refs/heads/*:refs/remotes/origin/* # timeout=10
[2022-09-09T15:33:13.588Z] Checking out Revision 96e6032105be22ed94f55b756c7207c6517fdcf5 (refs/remotes/origin/main)
[2022-09-09T15:33:13.598Z] Commit message: "feat: add fake git"
[2022-09-09T15:33:13.585Z] > /usr/bin/git rev-parse refs/remotes/origin/main^{commit} # timeout=10
[2022-09-09T15:33:13.590Z] > /usr/bin/git config core.sparsecheckout # timeout=10
[2022-09-09T15:33:13.591Z] > /usr/bin/git checkout -f 96e6032105be22ed94f55b756c7207c6517fdcf5 # timeout=10
[2022-09-09T15:33:13.599Z] > /usr/bin/git rev-list --no-walk 96e6032105be22ed94f55b756c7207c6517fdcf5 # timeout=10
[2022-09-09T15:33:13.610Z] The recommended git tool is: NONE
[2022-09-09T15:33:13.617Z] using credential credentials-id
[2022-09-09T15:33:13.626Z] The recommended git tool is: NONE
[2022-09-09T15:33:13.633Z] using credential credentials-id
[2022-09-09T15:33:13.640Z] [GitCheckoutListener] Recording commits of 'git ssh://git@git.example.com/git-repository-url'
[2022-09-09T15:33:13.640Z] [GitCheckoutListener] Found previous build 'Test/test-release #21' that contains recorded Git commits
[2022-09-09T15:33:13.640Z] [GitCheckoutListener] -> Starting recording of new commits since '96e6032'
[2022-09-09T15:33:13.640Z] [GitCheckoutListener] -> Using head commit '96e6032' as starting point
[2022-09-09T15:33:13.640Z] [GitCheckoutListener] -> Git commit decorator could not be created for SCM 'hudson.plugins.git.GitSCM@7eab87af'
[2022-09-09T15:33:13.640Z] [GitCheckoutListener] -> No new commits found
[2022-09-09T15:33:13.935Z] [Pipeline] echo
[2022-09-09T15:33:13.937Z] done checkout
[2022-09-09T15:33:13.939Z] [Pipeline] }
[2022-09-09T15:33:13.952Z] [Pipeline] // stage
[2022-09-09T15:33:13.959Z] [Pipeline] stage
[2022-09-09T15:33:13.961Z] [Pipeline] { (Get next version ...)
[2022-09-09T15:33:13.973Z] [Pipeline] echo
[2022-09-09T15:33:13.974Z] start new version
[2022-09-09T15:33:13.978Z] [Pipeline] sh
[2022-09-09T15:33:14.253Z] + which git
[2022-09-09T15:33:14.253Z] /usr/bin/git
[2022-09-09T15:33:14.266Z] [Pipeline] sh
[2022-09-09T15:33:14.540Z] + echo /usr/local/bin:/usr/bin:/bin:/usr/games
[2022-09-09T15:33:14.540Z] /usr/local/bin:/usr/bin:/bin:/usr/games
[2022-09-09T15:33:14.551Z] [Pipeline] sh
[2022-09-09T15:33:13.621Z] > /usr/bin/git rev-parse HEAD^{commit} # timeout=10
[2022-09-09T15:33:14.841Z] [Pipeline] sh
[2022-09-09T15:33:15.115Z] + git tag
[2022-09-09T15:33:15.116Z] 0.1.0
[2022-09-09T15:33:15.127Z] [Pipeline] sh
[2022-09-09T15:33:15.399Z] + git show 0.1.0
[2022-09-09T15:33:15.399Z] commit 838c14db312cf0d46f29db828999b4ef8b48287e
[2022-09-09T15:33:15.399Z] Author: user1 <user1@example.com>
[2022-09-09T15:33:15.399Z] Date: Fri Sep 9 23:17:54 2022 +1000
[2022-09-09T15:33:15.399Z]
[2022-09-09T15:33:15.399Z] feat: file2
[2022-09-09T15:33:15.399Z]
[2022-09-09T15:33:15.399Z] diff --git a/file2 b/file2
[2022-09-09T15:33:15.399Z] new file mode 100644
[2022-09-09T15:33:15.399Z] index 0000000..e69de29
[2022-09-09T15:33:15.409Z] [Pipeline] currentVersion
[2022-09-09T15:33:15.415Z] Current Tag is:
[2022-09-09T15:33:15.419Z] [Pipeline] echo
[2022-09-09T15:33:15.421Z] Current version: 0.0.0
[2022-09-09T15:33:15.423Z] [Pipeline] nextVersion
[2022-09-09T15:33:15.427Z] Current Tag is:
[2022-09-09T15:33:15.435Z] [Pipeline] }
[2022-09-09T15:33:15.454Z] [Pipeline] // stage
[2022-09-09T15:33:15.461Z] [Pipeline] }
[2022-09-09T15:33:15.477Z] [Pipeline] // node
[2022-09-09T15:33:15.485Z] [Pipeline] }
[2022-09-09T15:33:15.486Z] Terminated
[2022-09-09T15:33:15.490Z] Failed in branch 0
[2022-09-09T15:33:15.498Z] Terminated
[2022-09-09T15:33:15.504Z] [Pipeline] // parallel
[2022-09-09T15:33:15.509Z] Terminated
[2022-09-09T15:33:15.518Z] [Pipeline] End of Pipeline
[2022-09-09T15:33:15.520Z] Terminated
[2022-09-09T15:33:15.525Z] java.io.IOException: error=2, No such file or directory
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
[2022-09-09T15:33:15.525Z] at io.jenkins.plugins.conventionalcommits.process.ProcessUtil.execute(ProcessUtil.java:49)
[2022-09-09T15:33:15.525Z] at io.jenkins.plugins.conventionalcommits.NextVersionStep$Execution.run(NextVersionStep.java:217)
[2022-09-09T15:33:15.525Z] at io.jenkins.plugins.conventionalcommits.NextVersionStep$Execution.run(NextVersionStep.java:133)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.steps.SynchronousStepExecution.start(SynchronousStepExecution.java:37)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
[2022-09-09T15:33:15.525Z] at jdk.internal.reflect.GeneratedMethodAccessor905.invoke(Unknown Source)
[2022-09-09T15:33:15.525Z] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
[2022-09-09T15:33:15.525Z] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
[2022-09-09T15:33:15.525Z] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
[2022-09-09T15:33:15.525Z] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
[2022-09-09T15:33:15.525Z] Caused: java.io.IOException: Cannot run program "git" (in directory "/var/lib/jenkins-agent/agent/workspace/Test/test-release"): error=2, No such file or directory
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
[2022-09-09T15:33:15.525Z] at io.jenkins.plugins.conventionalcommits.process.ProcessUtil.execute(ProcessUtil.java:49)
[2022-09-09T15:33:15.525Z] at io.jenkins.plugins.conventionalcommits.NextVersionStep$Execution.run(NextVersionStep.java:217)
[2022-09-09T15:33:15.525Z] at io.jenkins.plugins.conventionalcommits.NextVersionStep$Execution.run(NextVersionStep.java:133)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.steps.SynchronousStepExecution.start(SynchronousStepExecution.java:37)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
[2022-09-09T15:33:15.525Z] at jdk.internal.reflect.GeneratedMethodAccessor905.invoke(Unknown Source)
[2022-09-09T15:33:15.525Z] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
[2022-09-09T15:33:15.525Z] at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
[2022-09-09T15:33:15.525Z] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
[2022-09-09T15:33:15.525Z] at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
[2022-09-09T15:33:15.525Z] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:163)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
[2022-09-09T15:33:15.525Z] at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:158)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:161)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:165)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:135)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
[2022-09-09T15:33:15.525Z] at WorkflowScript.run(WorkflowScript:28)
[2022-09-09T15:33:15.525Z] at ___cps.transform___(Native Method)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:86)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:113)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixName(FunctionCallBlock.java:78)
[2022-09-09T15:33:15.525Z] at jdk.internal.reflect.GeneratedMethodAccessor479.invoke(Unknown Source)
[2022-09-09T15:33:15.525Z] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[2022-09-09T15:33:15.525Z] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.Next.step(Next.java:83)
[2022-09-09T15:33:15.525Z] at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
[2022-09-09T15:33:15.526Z] at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
[2022-09-09T15:33:15.526Z] at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
[2022-09-09T15:33:15.526Z] at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
[2022-09-09T15:33:15.526Z] at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:420)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:95)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294)
[2022-09-09T15:33:15.526Z] at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
[2022-09-09T15:33:15.526Z] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[2022-09-09T15:33:15.526Z] at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
[2022-09-09T15:33:15.526Z] at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:30)
[2022-09-09T15:33:15.526Z] at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:70)
[2022-09-09T15:33:15.526Z] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[2022-09-09T15:33:15.526Z] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[2022-09-09T15:33:15.526Z] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[2022-09-09T15:33:15.526Z] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[2022-09-09T15:33:15.526Z] at java.base/java.lang.Thread.run(Thread.java:829)
[2022-09-09T15:33:15.531Z] Terminated
[2022-09-09T15:33:15.532Z] Finished: FAILURE
Is there something new? Unfortunately I've got the same problem.
I also see this error "java.io.IOException: Cannot run program "git"... Are there any updates?
Jenkins and plugins versions report
Environment
```text Paste the output here ```What Operating System are you using (both controller, and any agents involved in the problem)?
Reproduction steps
Create a Jenkinsfile in the root of the repository
Expected Results
Next version to be generated out
Actual Results
Anything else?
There are semver tags present in the repository (e.g. 0.0.9). Likely related to https://github.com/jenkinsci/conventional-commits-plugin/issues/173