hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: github-project:org/project.git: Failed to connect

Jenkins JIRA | liron tal | 4 months ago
  1. 0

    Hi, I'm currently using the multi-branch project plugin with a specific user's github credentials. in "configure" for my folder, under "Source Code Management" I choose "Git", and provide: the project repository: https://github.com/org/project.git credentials: I choose my user's github credentials. I'm trying to use Github's deploy keys instead of my user's credentials. I configured deploy keys for our freestyle projects, similar to what's defined [here| https://firmhouse.com/blog/configuring-multiple-private-ssh-deploy-keys-in-jenkins-for-github-com/] When I change the "Source Code Management" project repository to: git@github-project:org/project.git credentials to: "private key" -> "From the Jenkins master ~/.ssh". this configuration works for a freestyle project, but for multi-branch I get the following error when saving the configuration. looking at the stack trace, "java.net.UnknownHostException: github-project: Name or service not known" it seems that there is some issue with the ssh connection. github-project is not an host, but an alias configured in ssh config as following: Host github-project HostName github.com User git IdentityFile /var/lib/jenkins/.ssh/id_rsa_project I also tried the following project repository configurations: - github-project:org/project.git (removed the git@ prefix) - github.com:org/project.git (using github.com instead of the ssh alias) and both failed with differet errors. Started by timer Setting origin to github-project:org/project.git Fetching origin... FATAL: Failed to recompute children of test-project-feature-branches hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: github-project:org/project.git: Failed to connect at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:680) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:143) at jenkins.scm.api.SCMSource.retrieve(SCMSource.java:219) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:169) at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.computeChildren(AbstractMultiBranchProject.java:583) 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) Caused by: org.eclipse.jgit.api.errors.TransportException: github-project:org/project.git: Failed to connect at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678) ... 9 more Caused by: org.eclipse.jgit.errors.TransportException: github-project:org/project.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) ... 10 more Caused by: java.io.IOException: There was a problem while connecting to github-project: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) ... 17 more Caused by: java.net.UnknownHostException: github-project: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316) at java.net.InetAddress.getAllByName0(InetAddress.java:1269) at java.net.InetAddress.getAllByName(InetAddress.java:1185) at java.net.InetAddress.getAllByName(InetAddress.java:1119) at java.net.InetAddress.getByName(InetAddress.java:1069) at com.trilead.ssh2.transport.TransportManager.createInetAddress(TransportManager.java:165) at com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:353) at com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:467) at com.trilead.ssh2.Connection.connect(Connection.java:758) ... 20 more Finished: FAILURE

    Jenkins JIRA | 4 months ago | liron tal
    hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: github-project:org/project.git: Failed to connect
  2. 0

    [JENKINS-37297] can't use github deploy keys in Multi-Branch Project Plugin - Jenkins JIRA

    jenkins-ci.org | 2 weeks ago
    hudson.plugins.git.GitException: org.eclipse.jgit.api.errors.TransportException: github-project:org/project.git: Failed to connect
  3. 0

    java.io.IOException when using git pull under win7 with IPv6

    YouTrack | 4 years ago
    java.io.IOException: There was a problem while connecting to <IP-address>::22
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hostname resolution error? | SpigotMC - High Performance Minecraft

    spigotmc.org | 3 months ago
    java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server

  1. Andreas Häber 756 times, last 2 months ago
  2. tyson925 1 times, last 3 months ago
  3. rafalg 1 times, last 4 months ago
  4. Andreas Häber 1 times, last 6 months ago
  5. charries96 2 times, last 7 months ago
10 unregistered visitors
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.net.UnknownHostException

    github-project: Name or service not known

    at java.net.Inet6AddressImpl.lookupAllHostAddr()
  2. Java RT
    InetAddress.getByName
    1. java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    2. java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922)
    3. java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316)
    4. java.net.InetAddress.getAllByName0(InetAddress.java:1269)
    5. java.net.InetAddress.getAllByName(InetAddress.java:1185)
    6. java.net.InetAddress.getAllByName(InetAddress.java:1119)
    7. java.net.InetAddress.getByName(InetAddress.java:1069)
    7 frames
  3. Trilead
    Connection.connect
    1. com.trilead.ssh2.transport.TransportManager.createInetAddress(TransportManager.java:165)
    2. com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:353)
    3. com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:467)
    4. com.trilead.ssh2.Connection.connect(Connection.java:758)
    5. com.trilead.ssh2.Connection.connect(Connection.java:687)
    6. com.trilead.ssh2.Connection.connect(Connection.java:587)
    6 frames
  4. org.jenkinsci.plugins
    TrileadSessionFactory.getSession
    1. org.jenkinsci.plugins.gitclient.trilead.TrileadSessionFactory.getSession(TrileadSessionFactory.java:29)
    1 frame
  5. JGit - Core
    FetchCommand.call
    1. org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
    2. org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
    3. org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
    4. org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
    5. org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
    6. org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
    7. org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
    7 frames
  6. org.jenkinsci.plugins
    JGitAPIImpl.fetch
    1. org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678)
    1 frame
  7. jenkins.plugins.git
    AbstractGitSCMSource.retrieve
    1. jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
    1 frame
  8. jenkins.scm.api
    SCMSource.fetch
    1. jenkins.scm.api.SCMSource.fetch(SCMSource.java:143)
    2. jenkins.scm.api.SCMSource.retrieve(SCMSource.java:219)
    3. jenkins.scm.api.SCMSource.fetch(SCMSource.java:169)
    3 frames
  9. com.github.mjdetullio
    AbstractMultiBranchProject.computeChildren
    1. com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.computeChildren(AbstractMultiBranchProject.java:583)
    1 frame
  10. 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
  11. Hudson
    Executor.run
    1. hudson.model.ResourceController.execute(ResourceController.java:98)
    2. hudson.model.Executor.run(Executor.java:410)
    2 frames