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

Git plugin uses port configured in Publish over SSH

    Details

    • Similar Issues:

      Description

      Jenkins uses port configured in Publish over SSH host instead of the default one while pulling/cloning/accessing the repo from the git server (or any other git server presumably).

      When setting port explicitly in the repo url everything works fine (but integration with Github stops working).

      Started on Jul 12, 2017 6:46:27 PM
      Started by event from http://jenkins:8080/github-webhook/ on Wed Jul 12 18:46:27 CEST 2017
      Using strategy: Default
      using GIT_SSH to set credentials RepoName
       > git ls-remote -h ssh://git@github.com/username/RepoName.git # timeout=10
      FATAL: hudson.plugins.git.GitException: Command "git ls-remote -h ssh://git@github.com/username/RepoName.git" returned status code 128:
      stdout: 
      stderr: ssh: connect to host github.com port 65514: Connection timed out
      fatal: Could not read from remote repository.
      
      Please make sure you have the correct access rights
      and the repository exists.
      
      hudson.plugins.git.GitException: Command "git ls-remote -h ssh://git@github.com/username/RepoName.git" returned status code 128:
      

       

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          That likely means that the publish over ssh plugin is setting an environment variable which alters the behavior of command line git, or is setting an environment variable which alters ssh behavior, and the ssh invoked by command line git is affected. The publish over ssh plugin would need to alter how it is setting environment variables to only affect its own ssh invocations.

          You could test that theory by enabling JGIt as an implementation ("Manage Jenkins" -> "Global Tools Configuration" -> "Git" -> "Add Git" -> "jgit"), then modify one of the jobs to see if JGit is affected by the same changes from the publish over ssh plugin.

          Does the problem only occur in jobs where publish over ssh is used, or is it in all git use throughout the entire system once publish over ssh is installed and configured?

          Show
          markewaite Mark Waite added a comment - That likely means that the publish over ssh plugin is setting an environment variable which alters the behavior of command line git, or is setting an environment variable which alters ssh behavior, and the ssh invoked by command line git is affected. The publish over ssh plugin would need to alter how it is setting environment variables to only affect its own ssh invocations. You could test that theory by enabling JGIt as an implementation ("Manage Jenkins" -> "Global Tools Configuration" -> "Git" -> "Add Git" -> "jgit"), then modify one of the jobs to see if JGit is affected by the same changes from the publish over ssh plugin. Does the problem only occur in jobs where publish over ssh is used, or is it in all git use throughout the entire system once publish over ssh is installed and configured?
          Hide
          xrogers Lech Groblewicz added a comment -

          I've checked JGit - no issue in here. So it is probably some global variable modified PoSSH plugin.

          So there are two options - either git plugin cleans up ssh related env before running or PoSSH does it after doing its job.

          Show
          xrogers Lech Groblewicz added a comment - I've checked JGit - no issue in here. So it is probably some global variable modified PoSSH plugin. So there are two options - either git plugin cleans up ssh related env before running or PoSSH does it after doing its job.
          Hide
          markewaite Mark Waite added a comment -

          Does the problem only occur in jobs where publish over ssh is used, or is it in all git use throughout the entire system once publish over ssh is installed and configured?

          Show
          markewaite Mark Waite added a comment - Does the problem only occur in jobs where publish over ssh is used, or is it in all git use throughout the entire system once publish over ssh is installed and configured?
          Hide
          slide_o_mix Alex Earl added a comment -

          Can you provide the config.xml for the job (with important things redacted)?

          Show
          slide_o_mix Alex Earl added a comment - Can you provide the config.xml for the job (with important things redacted)?
          Hide
          slide_o_mix Alex Earl added a comment -

          Please reopen if you can provide more information on reproducing

          Show
          slide_o_mix Alex Earl added a comment - Please reopen if you can provide more information on reproducing

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              xrogers Lech Groblewicz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: