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

Having issues after setting up ssh Connection to Github

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-client-plugin
    • None
    • Git client plugin
      Version6.1.1

      Jenkins 2.479.3

      I setup Jenkins to use ssh with Github.

       

      Add public key to deploy key on GitHub
      Add private key to jenkins project.  Record id for Jenkinsfile
      Get host id: ssh-keyscan github-stg.corp.zynga.com
      Copy the key for ecdsa-sha2-nistp256. 
      Add to Jenkins manage -> security -> Git Host Key Verification Configuration -> Manually provided keys
      

      I was able to successfully build.  I am using pipeline builds. 
      I then switched it back to https and I get a connection error.  The console shows that the connection is fine. 

      But the build gives an error:
      20:00:42 Started by user
      Matt Peterson
      20:00:42 Running as
      Matt Peterson
      20:02:53 hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --prune – origin +refs/heads/main:refs/remotes/origin/main" returned status code 128:20:02:53 stdout: 20:02:53 stderr: fatal: unable to access '
      https://github-stg.corp.zynga.com/mapeterson/deploykey_test.git/
      ': Failed to connect to github-stg.corp.zynga.com port 443 after 131052 ms: Couldn't connect to server*20:02:53* 20:02:53 at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2848)20:02:53 at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2184)20:02:53 at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)20:02:53 at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:408)20:02:53 Caused: java.io.IOException*20:02:53* at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:413)20:02:53 at PluginClassLoader for scm-api//jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)20:02:53 at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:126)20:02:53 at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:73)20:02:53 at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)20:02:53 at hudson.model.ResourceController.execute(ResourceController.java:101)20:02:53 at hudson.model.Executor.run(Executor.java:445)20:02:53 [Checks API] No suitable checks publisher found.20:02:54 Finished: FAILURE
       

          [JENKINS-75234] Having issues after setting up ssh Connection to Github

          Matt created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Description Original: I setup Jenkins to use ssh with Github.

           
          {code:java}
          Add public key to deploy key on GitHub
          Add private key to jenkins project.  Record id for Jenkinsfile
          Get host id: ssh-keyscan github-stg.corp.zynga.com
          Copy the key for ecdsa-sha2-nistp256. 
          Add to Jenkins manage -> security -> Git Host Key Verification Configuration -> Manually provided keys
          {code}
          I was able to successfully build.  I am using pipeline builds. 
          I then switched it back to https and I get a connection error.  The console shows that the connection is fine.  !Screenshot 2025-02-04 at 8.04.06 PM.png!

          But the build gives an error:
          *20:00:42* Started by user
          [Matt Peterson|https://shared-stg.build.zynga.com/user/mapeterson]
          *20:00:42* Running as
          [Matt Peterson|https://shared-stg.build.zynga.com/user/mapeterson]
          *20:02:53* hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --prune -- origin +refs/heads/main:refs/remotes/origin/main" returned status code 128:*20:02:53* stdout: *20:02:53* stderr: fatal: unable to access '
          [https://github-stg.corp.zynga.com/mapeterson/deploykey_test.git/]
          ': Failed to connect to github-stg.corp.zynga.com port 443 after 131052 ms: Couldn't connect to server*20:02:53* *20:02:53* at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2848)*20:02:53* at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2184)*20:02:53* at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)*20:02:53* at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:408)*20:02:53* Caused: java.io.IOException*20:02:53* at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:413)*20:02:53* at PluginClassLoader for scm-api//jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)*20:02:53* at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:126)*20:02:53* at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:73)*20:02:53* at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)*20:02:53* at hudson.model.ResourceController.execute(ResourceController.java:101)*20:02:53* at hudson.model.Executor.run(Executor.java:445)*20:02:53* [Checks API] No suitable checks publisher found.*20:02:54* Finished: FAILURE
           
          New: I setup Jenkins to use ssh with Github.

           
          {code:java}
          Add public key to deploy key on GitHub
          Add private key to jenkins project.  Record id for Jenkinsfile
          Get host id: ssh-keyscan github-stg.corp.zynga.com
          Copy the key for ecdsa-sha2-nistp256. 
          Add to Jenkins manage -> security -> Git Host Key Verification Configuration -> Manually provided keys
          {code}
          I was able to successfully build.  I am using pipeline builds. 
          I then switched it back to https and I get a connection error.  The console shows that the connection is fine.  !Screenshot 2025-02-04 at 8.04.06 PM.png|width=800!

          But the build gives an error:
          *20:00:42* Started by user
          [Matt Peterson|https://shared-stg.build.zynga.com/user/mapeterson]
          *20:00:42* Running as
          [Matt Peterson|https://shared-stg.build.zynga.com/user/mapeterson]
          *20:02:53* hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --prune -- origin +refs/heads/main:refs/remotes/origin/main" returned status code 128:*20:02:53* stdout: *20:02:53* stderr: fatal: unable to access '
          [https://github-stg.corp.zynga.com/mapeterson/deploykey_test.git/]
          ': Failed to connect to github-stg.corp.zynga.com port 443 after 131052 ms: Couldn't connect to server*20:02:53* *20:02:53* at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2848)*20:02:53* at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2184)*20:02:53* at PluginClassLoader for git-client//org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:635)*20:02:53* at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:408)*20:02:53* Caused: java.io.IOException*20:02:53* at PluginClassLoader for git//jenkins.plugins.git.GitSCMFileSystem$BuilderImpl.build(GitSCMFileSystem.java:413)*20:02:53* at PluginClassLoader for scm-api//jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:219)*20:02:53* at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:126)*20:02:53* at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:73)*20:02:53* at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:311)*20:02:53* at hudson.model.ResourceController.execute(ResourceController.java:101)*20:02:53* at hudson.model.Executor.run(Executor.java:445)*20:02:53* [Checks API] No suitable checks publisher found.*20:02:54* Finished: FAILURE
           

            Unassigned Unassigned
            mapeterson Matt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: