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

Cannot clone GIT repo from an https URL

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: git-client-plugin
    • Environment:
    • Similar Issues:

      Description

      After upgrading git-client to 1.4.5 and git to 2.0 still having problems with cloning GIT repository using https (see also: JENKINS-19938):

      After adding credentials and selecting credentials in job's config Jenkins seems to have access the repo (no error on leaving field with repo's URL - this is better than before concerning usage of credentials plugin).
      However - cloning the repo when executing build does not work (using any of available git clients: generic (1.7.1), jGit)

      Errors:

      • Log in Jenkin's job (machine's names etc. changed), generic command-line client
      Started by an SCM change
      Building remotely on SOMEMACHINE in workspace /whatever/workspace/jobname
      
      Deleting project workspace... done
      
      Cloning the remote Git repository
      Cloning repository https://git.mysite/git/myrepo
      git --version
      git version 1.7.1
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException: Could not clone https://git.mysite/git/myrepo
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:298)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:151)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:144)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:326)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at hudson.remoting.Engine$1$1.run(Engine.java:61)
      	at java.lang.Thread.run(Thread.java:724)
      Caused by: hudson.plugins.git.GitException: Failed to connect to https://git.mysite/git/myrepo using credentials mybuilduser - build user
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1391)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1338)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:52)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:292)
      	... 12 more
      ERROR: null
      Archiving artifacts
      Finished: FAILURE
      
      • error in Jenkins slave, all what happens during build's execution (failed because of clone problem):
      Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
      INFO: I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
      INFO: Retrying request
      Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
      INFO: I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
      INFO: Retrying request
      Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
      INFO: I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
      Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
      INFO: Retrying request
      Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserStatusComputer computeStatusMatches
      INFO: Local temp file:/tmp/log-parser_S23_1_ARC_Spec_check_build_226
      Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserReader readLogPart
      INFO: Start reading log part 0 in thread #0
      Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserReader readLogPart
      INFO: Done reading log part 0
      Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserThread getLineStatuses
      INFO: LogParserThread: Start parsing log part 0
      Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserThread getLineStatuses
      INFO: LogParserThread: Done parsing log part 0
      
      • console output when using jGit:
        Started by user twolak
        Building remotely on some_wn in workspace /whatever/workspace/jobname
        
        Deleting project workspace... done
        
        Cloning the remote Git repository
        remote: Counting objects
        remote: Compressing objects
        Receiving objects
        Resolving deltas
        Updating references
        Checking out Revision 520d39d92ee332fcc5213e0fcd8b465af2a7c244 (origin/jenkins)
        FATAL: Could not checkout null
        hudson.plugins.git.GitException: Could not checkout null
        	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:202)
        	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:239)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:606)
        	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282)
        	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263)
        	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222)
        	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
        	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
        	at hudson.remoting.Request$2.run(Request.java:326)
        	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
        	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        	at hudson.remoting.Engine$1$1.run(Engine.java:61)
        	at java.lang.Thread.run(Thread.java:724)
        Caused by: org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name <null> is not allowed
        	at org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471)
        	at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200)
        	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:187)
        	... 18 more
        

      Please note that https auth. problem with cloning git repo exists for both major cases:

      Could you please give fixing at least one way of auth. some high priority? It is impossible to use the plugin in this state...

        Attachments

          Activity

          Hide
          alex_o2 Alex Cohen added a comment - - edited

          Note that auth. in case of SCM Poll works, few minutes ago got this:

          Polling Log
          View as plain text
          
          This page captures the polling log that triggered this build.
          
          Started on Oct 25, 2013 3:29:43 PM
          Using strategy: Default
          Done. Took 36 ms
          Changes found
          

          so the problem seems to exist specifically regarding cloning process within the build (executed on slave nodes).

          Concerning .netrc - it is working when executed from shell (as it was using old 1.1.2 version of git-client plugin).

          Show
          alex_o2 Alex Cohen added a comment - - edited Note that auth. in case of SCM Poll works, few minutes ago got this: Polling Log View as plain text This page captures the polling log that triggered this build. Started on Oct 25, 2013 3:29:43 PM Using strategy: Default Done. Took 36 ms Changes found so the problem seems to exist specifically regarding cloning process within the build (executed on slave nodes). Concerning .netrc - it is working when executed from shell (as it was using old 1.1.2 version of git-client plugin).
          Hide
          alex_o2 Alex Cohen added a comment -

          It appears that the problem have been solved after doing the following:

          • changing in one of the build jobs git client to jGit, and setting local branch (to get rid of the null exception - after this cloning works for this job
          • then when I just set credentials and save config of any other build job - it executes without any problem...

          Sorry for creating noise regarding this - it seems to be something regarding the state of Jenkins instance (have seen such issues before...), probably reconfiguring jobs can be the solution (but also it seems that something has to 'initialized' by jGit so that other jobs using generic git client may work).

          Anyway - everything seems to work using new credentials plugin (there is issue with jGit - not working without setting local branch - but that's another issue...).

          Show
          alex_o2 Alex Cohen added a comment - It appears that the problem have been solved after doing the following: changing in one of the build jobs git client to jGit, and setting local branch (to get rid of the null exception - after this cloning works for this job then when I just set credentials and save config of any other build job - it executes without any problem... Sorry for creating noise regarding this - it seems to be something regarding the state of Jenkins instance (have seen such issues before...), probably reconfiguring jobs can be the solution (but also it seems that something has to 'initialized' by jGit so that other jobs using generic git client may work ). Anyway - everything seems to work using new credentials plugin (there is issue with jGit - not working without setting local branch - but that's another issue...).

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              alex_o2 Alex Cohen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: