Hi,

      I try to create a pipeline project, but get always these errors:

      1st try: using "real" hostname with

      same result as JENKINS-35565 (connection refused)

      2nd try: using localhost/127.0.0.1 (I tried both, same result)

      first with "Credentials" set to "empty"

      {{Started
      Creating git repository in /var/lib/jenkins/caches/git-b8e0a72444a3fca4da8b9cbf35c0bac2
      Setting origin to ssh://git@localhost:2222/repo.git
      Fetching origin...
      FATAL: Failed to recompute children of MyTestProject
      java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
      at com.trilead.ssh2.Connection.openSession(Connection.java:1127)
      at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32)
      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)
      at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678)
      at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
      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:410)
      Finished: FAILURE

      theres simply no connection attempt inside /var/log/auth.log

      It seems that it fully ignores ~/.ssh/config (int the correct home of the jenkins user), since it does not use the private key specified there.

      If I specify a private key inside the "credentials" (i.e use private key from jenkins-master home), same error occurs.

      it seems the branch indexing simply ignores every credential provider or standard ssh/git behaviour.

          [JENKINS-35567] multibranch project and ssh+git broken

          Florian Doersch created issue -
          Mark Waite made changes -
          Attachment New: repo-def.png [ 32977 ]

          Mark Waite added a comment - - edited

          I can't duplicate your problem. Can you provide more details of the specific steps you took when you saw the problem?

          Steps I took which confirmed that I can create a multi-branch pipeline project which uses an RSA private key to access a private remote repository:

          1. Create a new "Multibranch Pipeline" job named "JENKINS-35567-multi-branch-pipeline-with-rsa-private-key"
          2. Select "Git" as the source control for that job
          3. Assign "git@github.com:MarkEWaite/docker-private.git" as the repo URL
          4. Assign a valid RSA private key to that repo URL from the drop-down list
          5. Leave the default Build Configuration Mode - "By Jenkinsfile"

          When I did that, the docker-private repo was indexed and the branches on that repo with a Jenkinsfile were all created. I successfully ran that test from my Ubuntu 14.04 computer and from a Docker instance.

          Refer to

          Mark Waite added a comment - - edited I can't duplicate your problem. Can you provide more details of the specific steps you took when you saw the problem? Steps I took which confirmed that I can create a multi-branch pipeline project which uses an RSA private key to access a private remote repository: Create a new "Multibranch Pipeline" job named " JENKINS-35567 -multi-branch-pipeline-with-rsa-private-key" Select "Git" as the source control for that job Assign "git@github.com:MarkEWaite/docker-private.git" as the repo URL Assign a valid RSA private key to that repo URL from the drop-down list Leave the default Build Configuration Mode - "By Jenkinsfile" When I did that, the docker-private repo was indexed and the branches on that repo with a Jenkinsfile were all created. I successfully ran that test from my Ubuntu 14.04 computer and from a Docker instance. Refer to
          Stephen Connolly made changes -
          Component/s Original: ssh-credentials-plugin [ 17424 ]

          Does not look to be an issue with the ssh-credentials plugin

          Stephen Connolly added a comment - Does not look to be an issue with the ssh-credentials plugin
          Stephen Connolly made changes -
          Component/s Original: branch-api-plugin [ 18621 ]
          Stephen Connolly made changes -
          Assignee Original: Stephen Connolly [ stephenconnolly ] New: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Mark Waite added a comment -

          flow86 you might check that you have JGit enabled as a valid git implementation in your Jenkins system configuration. The stack trace seems to hint that the code is trying to use JGit, and if it is not enabled, that might cause some surprises.

          Mark Waite added a comment - flow86 you might check that you have JGit enabled as a valid git implementation in your Jenkins system configuration. The stack trace seems to hint that the code is trying to use JGit, and if it is not enabled, that might cause some surprises.
          Florian Doersch made changes -
          Attachment New: jenkins-jgit.PNG [ 33049 ]

            Unassigned Unassigned
            flow86 Florian Doersch
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: