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

Git Clone step not working for private GIT instance

XMLWordPrintable

      Unsure if this is the right forum to post issues like this in. I am trying to get Jenkins set up to work on a private git environment and learn how to create pipelines through it. I've followed the set up guide and hit a bit of a wall. 

      Output from the console. It appears to build successfully and clones files successfully in the first few steps, however when it gets to the Pipeline SCM clone step it appends https://github/COMPANY_NAME In front of it and I can't work out where to change this as it isn't in my jenkins file. 

      Started by user prodeng_administrator
      Replayed #11
       > git rev-parse --resolve-git-dir /var/jenkins_home/caches/git-***/.git # timeout=10
      Setting origin to https://**MY_GIT_ADDRess**/connectors-prod-eng/test-applications
       > git config remote.origin.url https://**MY_GIT_ADDRess**/connectors-prod-eng/test-applications # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
       > git --version # 'git version 2.39.5'
       > git config --get remote.origin.url # timeout=10
      using GIT_ASKPASS to set credentials TESTING
       > git fetch --tags --force --progress -- origin +refs/heads/*:refs/remotes/origin/* # timeout=10
      Seen branch in repository origin/main
      Seen branch in repository origin/myBranch
      Seen 2 remote branches
      Obtained Jenkinsfile from ***
      Loading library BUILD_SYSTEM_REPO@main
      Attempting to resolve main from remote references...
       > git --version # timeout=10
       > git --version # 'git version 2.39.5'
      using GIT_ASKPASS to set credentials TESTING
       > git ls-remote -h -- https://**MY_GIT_ADDRess**/connectors-prod-eng/test-build-system.git # timeout=10
      Found match: refs/heads/main revision ***
      Selected Git installation does not exist. Using Default
      The recommended git tool is: NONE
      using credential TESTING
       > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/Git_Builder_Application_main@libs/17988db1914b35b722873f6bdd65e5ab498ccf07baa256fe527482a43840b77a/.git # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url https://**MY_GIT_ADDRess**/connectors-prod-eng/test-build-system.git # timeout=10
      Fetching without tags
      Fetching upstream changes from https://**MY_GIT_ADDRess**/connectors-prod-eng/test-build-system.git
       > git --version # timeout=10
       > git --version # 'git version 2.39.5'
      using GIT_ASKPASS to set credentials TESTING
       > git fetch --no-tags --force --progress -- https://**MY_GIT_ADDRess**/connectors-prod-eng/test-build-system.git +refs/heads/*:refs/remotes/origin/* # timeout=10
      Checking out Revision *** (main)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f *** # timeout=10
      Commit message: "Updating to work with lv 22"
       > git rev-list --no-walk *** # timeout=10
      [Pipeline] Start of Pipeline
      [Pipeline] node
      Running on Jenkins in /var/jenkins_home/workspace/Git_Builder_Application_main
      [Pipeline] {
      [Pipeline] echo
      Starting Build...
      [Pipeline] stage
      [Pipeline] { (Pre-Clean)
      [Pipeline] echo
      Cleaning out workspace  directory: /var/jenkins_home/workspace/Git_Builder_Application_main
      [Pipeline] deleteDir
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (SCM Checkout)
      [Pipeline] echo
      Attempting to get source from repo...
      [Pipeline] timeout
      Timeout set to expire in 4 min 0 sec
      [Pipeline] {
      [Pipeline] checkout
      Selected Git installation does not exist. Using Default
      The recommended git tool is: NONE
      using credential TESTING
      Cloning the remote Git repository
      Cloning with configured refspecs honoured and without tags
      Cloning repository https://**MY_GIT_ADDRess**/connectors-prod-eng/test-applications
       > git init /var/jenkins_home/workspace/Git_Builder_Application_main # timeout=10
      Fetching upstream changes from https://**MY_GIT_ADDRess**/connectors-prod-eng/test-applications
       > git --version # timeout=10
       > git --version # 'git version 2.39.5'
      using GIT_ASKPASS to set credentials TESTING
       > git fetch --no-tags --force --progress -- https://**MY_GIT_ADDRess**/connectors-prod-eng/test-applications +refs/heads/*:refs/remotes/origin/* # timeout=10
       > git config remote.origin.url https://**MY_GIT_ADDRess**/connectors-prod-eng/test-applications # timeout=10
       > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
      Avoid second fetch
      Checking out Revision *** (main)
       > git config core.sparsecheckout # timeout=10
       > git checkout -f *** # timeout=10
      Commit message: "Merge branch 'myBranch'"
       > git rev-list --no-walk *** # timeout=10
      [Pipeline] }
      [Pipeline] // timeout
      [Pipeline] echo
      Cloning build tools...
      [Pipeline] timeout
      Timeout set to expire in 5 min 0 sec
      [Pipeline] {
      [Pipeline] echo
      Cloning build tools to workspace.
      [Pipeline] echo
      Cloning https://github.com/**MY_COMPANY_NAME**/https://**MY_GIT_ADDRess**/connectors-prod-eng/test-build-system.git
      Did you forget the `def` keyword? cloneRepo seems to be setting a field named cloneDir (to a value of type String) which could lead to memory leaks or other issues.
      [Pipeline] bat
      [Pipeline] }
      [Pipeline] // timeout
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 22722ea6-e91c-481c-8a2c-8ce89c12361f
      java.io.IOException: Batch scripts can only be run on Windows nodes
          at PluginClassLoader for durable-task//org.jenkinsci.plugins.durabletask.WindowsBatchScript.doLaunch(WindowsBatchScript.java:83)
          at PluginClassLoader for durable-task//org.jenkinsci.plugins.durabletask.FileMonitoringTask.launchWithCookie(FileMonitoringTask.java:141)
          at PluginClassLoader for durable-task//org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoringTask.java:134)
          at PluginClassLoader for workflow-durable-task-step//org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.start(DurableTaskStep.java:330)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:323)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:47)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.LoggingInvoker.methodCall(LoggingInvoker.java:118)
          at cloneRepo.call(cloneRepo.groovy:5)
          at cloneRepo.call(cloneRepo.groovy)
          at cloneBuildTools.call(cloneBuildTools.groovy:5)
          at lvPipeline.call(lvPipeline.groovy:38)
          at ___cps.transform___(Native Method)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:90)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:114)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
          at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:108)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:83)
          at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.CastBlock$ContinuationImpl.cast(CastBlock.java:47)
          at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
          at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
          at java.base/java.lang.reflect.Method.invoke(Unknown Source)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.Next.step(Next.java:83)
          at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:147)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:17)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:49)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:180)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:419)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:327)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:292)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService.lambda$wrap$4(CpsVmExecutorService.java:140)
          at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
          at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
          at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
          at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
          at jenkins.util.ErrorLoggingExecutorService.lambda$wrap$0(ErrorLoggingExecutorService.java:51)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
          at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.call(CpsVmExecutorService.java:53)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.call(CpsVmExecutorService.java:50)
          at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
          at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
          at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService.lambda$categoryThreadFactory$0(CpsVmExecutorService.java:50)
          at java.base/java.lang.Thread.run(Unknown Source)
      Finished: FAILURE 

      Just dipping my toe in with jenkins so apologies if this is a dumb question but help/advice on where to look to fix it would be great. Thanks

            Unassigned Unassigned
            joel_harrison joel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: