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

Git plugin uses port configured in Publish over SSH

      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:
      

       

          [JENKINS-45484] Git plugin uses port configured in Publish over SSH

          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?

          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?

          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.

          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.

          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?

          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?

          Alex Earl added a comment -

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

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

          Alex Earl added a comment -

          Please reopen if you can provide more information on reproducing

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

          For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues

          Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/122
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-45484%22

          (Note: this is an automated bulk comment)

          Gavin McDonald added a comment - For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/122 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-45484%22 (Note: this is an automated bulk comment)

            slide_o_mix Alex Earl
            xrogers Lech Groblewicz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: