-
Bug
-
Resolution: Incomplete
-
Major
-
None
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:
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?