詹金斯挂在"从原点获取上游变化"

DTI*_*att 31 git ssh jenkins

我正在尝试在Windows Server 2012计算机上设置Jenkins,而且我遇到了很多困难.

我做过的事情:

  • 创建了无密码id_rsa,和id_rsa.pub
  • known_hosts为bitbucket.org 创建了一个文件,使用ssh.exe -T bitbucket.org并接受添加主机.
  • 添加E:到系统范围的HOME变量
  • 我已经添加了这些文件C:/Windows/SysWOW64/config/systemprofile/.ssh,以及E:/.ssh
  • 我已将我的公钥与Bitbucket链接为部署密钥.
  • 我已经对我的所有网址,用户名等进行了三重检查.
  • 我甚至手动从存储库中取出来设置初始基础 C:/Program Files (x86)/Jenkins/jobs/MyProject/workspace/

然而它仍然坚持着

Building in workspace C:\Program Files (x86)\Jenkins\jobs\MyProject\workspace
Checkout:workspace / C:\Program Files (x86)\Jenkins\jobs\MyProject\workspace - hudson.remoting.LocalChannel@13ca972
Using strategy: Default
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Run Code Online (Sandbox Code Playgroud)

我已经给了它大约20分钟,所以这不是回购问题的速度/大小.如果我取消,这是返回的内容:

ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Error performing command: C:\Program Files     (x86)\Git\bin\git.exe fetch -t origin +refs/heads/*:refs/remotes/origin/*
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:780)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:739)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:160)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:230)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:793)
at hudson.plugins.git.GitSCM.access$000(GitSCM.java:57)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:976)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
at hudson.FilePath.act(FilePath.java:865)
at hudson.FilePath.act(FilePath.java:838)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1364)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:670)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:575)
at hudson.model.Run.execute(Run.java:1575)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: java.lang.InterruptedException
at java.lang.ProcessImpl.waitFor(Native Method)
at hudson.Proc$LocalProc.join(Proc.java:319)
at hudson.Launcher$ProcStarter.join(Launcher.java:360)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:769)
... 19 more
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:981)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
at hudson.FilePath.act(FilePath.java:865)
at hudson.FilePath.act(FilePath.java:838)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:942)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1101)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1364)
at     hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:670)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:575)
at hudson.model.Run.execute(Run.java:1575)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Run Code Online (Sandbox Code Playgroud)

我在这里结束了我的智慧,所以我很感激能得到的所有帮助.这里有一些选择,我试过没有改进.

为Github私有存储库验证Jenkins CI

设置Jenkins时权限被拒绝(publickey)

Hudson Git插件没有在Windows上工作

http://computercamp.cdwilson.us/jenkins-git-clone-via-ssh-on-windows-7-x64

Dav*_*eot 31

以下是我修复类似问题的方法:

Msysgit安装了两个git.exe.一个在C:\Program Files (x86)\Git\bin第二个和第二个在C:\Program Files (x86)\Git\cmd.第一个不能与Jenkins一起使用.完成它的工作后它会挂起.第二个完美的工作.

更新您的Jenkins Git设置以指向正确cmd\git.exe并享受!


And*_*eas 8

这就是我解决它的方式:

我运行了sysinternals工具psexec来生成一个在LocalSystem帐户下运行的CMD(像jenkins服务一样运行的帐户)

PSEXEC -i -s -d CMD
Run Code Online (Sandbox Code Playgroud)

在这个cmd提示符中,我从工作空间目录执行了与挂起的GIT.exe进程相同的git命令.例如

d:\ Programs\Jenkins\jobs\jobname\workspace> D:\ Programs\Git\bin\git.exe fetch -t ssh + git://gitpub@my.server.com:9360/data/gitpub/myRepository. git + refs/heads/:refs/remotes/origin /

Et voila:我被提示输入"yes"以将SSH密钥添加到已知主机的已知列表中.