Git Jenkins错误-ssh:连接到主机端口22:连接被拒绝

Git Jenkins错误-ssh:连接到主机端口22:连接被拒绝,git,jenkins,Git,Jenkins,像这样在windows机器上运行Jenkins- java -jar jenkins.war --httpPort=8080 将GIT(scm而非github)配置为GIT插件的项目。使用isSSH用户名和私钥提供的凭据。存储库url类似于- ssh://username@host.domain.com:/data/repo/xyz 这个git存储库在linux机器上,我没有根访问权限。在Jenkins页面上配置项目时没有错误。但生成失败,错误如下: Git签出、克隆等在Jenkins运行的w

像这样在windows机器上运行Jenkins-

java -jar jenkins.war --httpPort=8080
将GIT(scm而非github)配置为GIT插件的项目。使用is
SSH用户名和私钥提供的凭据
。存储库url类似于-
ssh://username@host.domain.com:/data/repo/xyz

这个git存储库在linux机器上,我没有根访问权限。在Jenkins页面上配置项目时没有错误。但生成失败,错误如下:

Git签出、克隆等在Jenkins运行的windows机器上的命令行中工作

ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe fetch --tags --progress -- ssh:///user@host.domain.com:/data/sde-repo/SOA +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: ssh: connect to host  port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2174)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1866)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:547)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:760)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
    at hudson.scm.SCM.checkout(SCM.java:504)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    at hudson.model.Run.execute(Run.java:1815)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE
在我看来,Jenkins似乎无法识别主机名,因为此错误中的主机名为空-

ssh:连接到主机端口22:连接被拒绝


是这样吗?还是我走错了方向?

我尝试了@James Z comment中的一些方法,比如删除一条/,在末尾添加/等等。但它通过在Jenkins页面“源代码管理”部分的GIT存储库url中添加双引号来起作用-

java -jar jenkins.war --httpPort=8080
”ssh://user@host.domain.com:/data/sde repo/somefolder“


我不知道为什么它需要一个双引号的URL。

你的问题可能重复的地方是
ssh://...
但错误显示为
ssh://
。有多余的斜线吗?我查过了。配置中没有额外的斜杠。