java.lang.IllegalStateException: Cannot open session, connection is \ not authenticated.

Stack Overflow | David W. | 5 months ago
  1. 0

    Can't seem to get Multi-branch Pipeline to work with JenkinsFile

    Stack Overflow | 5 months ago | David W.
    java.lang.IllegalStateException: Cannot open session, connection is \ not authenticated.
  2. 0

    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 JIRA | 6 months ago | Florian Doersch
    java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
  3. 0

    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 JIRA | 6 months ago | Florian Doersch
    java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jenkins workflow-multibranch with git - IllegalStateException

    Stack Overflow | 12 months ago | John Williams
    java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
  6. 0

    When I create Multibranch Pipeline and add a git source (which requires a private key to authenticate) branch indexing doesn't work and throws following exception: {code} 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:672) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:171) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146) at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:296) at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151) at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:110) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) {code} It looks like jgit is used by default, but I don't have it in "Manage Jenkins" I have only command line git, which should be used.

    Jenkins JIRA | 8 months ago | krzyk
    java.lang.IllegalStateException: Cannot open session, connection is not authenticated.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Cannot open session, connection is \ not authenticated.

      at com.trilead.ssh2.Connection.openSession()
    2. Trilead
      Connection.openSession
      1. com.trilead.ssh2.Connection.openSession(Connection.java:1127)
      1 frame
    3. org.jenkinsci.plugins
      TrileadSession.exec
      1. org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:32)
      1 frame
    4. JGit - Core
      FetchCommand.call
      1. org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
      2. org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
      3. org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
      4. org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
      5. org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
      6. org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
      6 frames
    5. org.jenkinsci.plugins
      JGitAPIImpl.fetch
      1. org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678)
      1 frame
    6. jenkins.plugins.git
      AbstractGitSCMSource.retrieve
      1. jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
      1 frame
    7. jenkins.scm.api
      SCMSource.fetch
      1. jenkins.scm.api.SCMSource.fetch(SCMSource.java:146)
      1 frame
    8. jenkins.branch
      MultiBranchProject.computeChildren
      1. jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:294)
      1 frame
    9. com.cloudbees.hudson
      FolderComputation.run
      1. com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
      2. com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
      2 frames
    10. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:98)
      2. hudson.model.Executor.run(Executor.java:410)
      2 frames