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

Multi-branch maven project can't fetch Gitlab code, cmdline git can fetch same code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
    • Environment:
    • Similar Issues:

      Description

      Fetching origin...
      FATAL: Failed to recompute children of bob
      hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: git@git.server/repo.git: Failed to connect
      at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:680)
      at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:208)
      at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146)
      at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:294)
      at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
      at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:404)
      Caused by: org.eclipse.jgit.api.errors.TransportException: git@git.server/repo.git: Failed to connect
      at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
      at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678)
      ... 7 more
      Caused by: org.eclipse.jgit.errors.TransportException: git@git.server/repo.git: Failed to connect
      at org.jenkinsci.plugins.gitclient.trilead.TrileadSessionFactory.getSession(TrileadSessionFactory.java:54)
      at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
      at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
      at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
      at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
      at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
      at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
      at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
      ... 8 more
      Caused by: java.io.IOException: There was a problem while connecting to git.snet.local:22
      at com.trilead.ssh2.Connection.connect(Connection.java:818)
      at com.trilead.ssh2.Connection.connect(Connection.java:687)
      at com.trilead.ssh2.Connection.connect(Connection.java:587)
      at org.jenkinsci.plugins.gitclient.trilead.TrileadSessionFactory.getSession(TrileadSessionFactory.java:29)
      ... 15 more
      Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
      at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:93)
      at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:230)
      at com.trilead.ssh2.Connection.connect(Connection.java:770)
      ... 18 more
      Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
      at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:405)
      at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:777)
      at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:489)
      at java.lang.Thread.run(Thread.java:745)
      Finished: FAILURE

        Attachments

          Issue Links

            Activity

            Hide
            johnjaylward john aylward added a comment -

            I have a feeling this is similar JENKINS-33021. If I update my server to have weaker algorithms, the connection works. This is not a problem when using the git plugin directly, it only happens when using the "Multi-branch" plugin. I'm not sure why this plugin isn't using the git plugin as a dependency directly, but that appears to be the case since the git plugin by itself works.

            Show
            johnjaylward john aylward added a comment - I have a feeling this is similar JENKINS-33021 . If I update my server to have weaker algorithms, the connection works. This is not a problem when using the git plugin directly, it only happens when using the "Multi-branch" plugin. I'm not sure why this plugin isn't using the git plugin as a dependency directly, but that appears to be the case since the git plugin by itself works.
            Hide
            markewaite Mark Waite added a comment - - edited

            john aylward you may be able to assist with the diagnosis of the problem by defining a Jenkins job (a freestyle job, not a pipeline job) which is a copy of one of your working freestyle jobs, but then uses JGit instead of command line git as the git implementation in the job.

            You may need to enable JGit as a valid implementation (find the "Git" button in the global tools configuration, then add "jgit" as a valid implementation in addition to the default of command line git).

            I suspect that the job with JGit will fail to authenticate in your case, while the command line git job will continue to work as you noted. If that is the case, then you might want to help evaluate git plugin pull request 424 which proposes to switch to use the selected git implementation for multi-branch instead of always using JGit.

            Show
            markewaite Mark Waite added a comment - - edited john aylward you may be able to assist with the diagnosis of the problem by defining a Jenkins job (a freestyle job, not a pipeline job) which is a copy of one of your working freestyle jobs, but then uses JGit instead of command line git as the git implementation in the job. You may need to enable JGit as a valid implementation (find the "Git" button in the global tools configuration, then add "jgit" as a valid implementation in addition to the default of command line git). I suspect that the job with JGit will fail to authenticate in your case, while the command line git job will continue to work as you noted. If that is the case, then you might want to help evaluate git plugin pull request 424 which proposes to switch to use the selected git implementation for multi-branch instead of always using JGit.
            Hide
            johnjaylward john aylward added a comment - - edited

            Mark Waite. I tried using the JGit implementation like you stated and that is the case that my "freestyle" job now fails to fetch.

            The Jenkins instance involved though is one used for deployments to production, so I'm not sure I can evaluate the pull request mentioned. I doubt that I will have time to set up my own Jenkins instance to test it either.

            Thanks for the heads up on that.

            Show
            johnjaylward john aylward added a comment - - edited Mark Waite . I tried using the JGit implementation like you stated and that is the case that my "freestyle" job now fails to fetch. The Jenkins instance involved though is one used for deployments to production, so I'm not sure I can evaluate the pull request mentioned. I doubt that I will have time to set up my own Jenkins instance to test it either. Thanks for the heads up on that.
            Hide
            ptho ptho ho added a comment -

            same issue here. I enabled JGIT as a valid implementation, authentication still fails for multibranch pipeline.

            Right now, I can't get multibranch pipeline to work with GIT/JGIT. Pipeline project works fine

            Show
            ptho ptho ho added a comment - same issue here. I enabled JGIT as a valid implementation, authentication still fails for multibranch pipeline. Right now, I can't get multibranch pipeline to work with GIT/JGIT. Pipeline project works fine
            Hide
            markewaite Mark Waite added a comment -

            A prototype build which allows the multi-branch job to use command line git for its polling is now available. Please try it with your use case and let me know if it resolves the issue.

            Show
            markewaite Mark Waite added a comment - A prototype build which allows the multi-branch job to use command line git for its polling is now available. Please try it with your use case and let me know if it resolves the issue.
            Hide
            jglick Jesse Glick added a comment -

            Wrong component.

            Show
            jglick Jesse Glick added a comment - Wrong component.
            Hide
            markewaite Mark Waite added a comment - - edited

            @jglick@cloudbees.com I think PR424 in the git client plugin handles this

            Show
            markewaite Mark Waite added a comment - - edited @jglick@cloudbees.com I think PR424 in the git client plugin handles this
            Hide
            markewaite Mark Waite added a comment -

            Included in git plugin 2.6.0, released 2 Sep 2016.

            Show
            markewaite Mark Waite added a comment - Included in git plugin 2.6.0 , released 2 Sep 2016.

              People

              • Assignee:
                Unassigned
                Reporter:
                johnjaylward john aylward
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: