我似乎无法让gits插件在Jenkins上工作。已搜索并尝试了所有可能的建议解决方案。
我正确设置了Git,Putty plink,环境变量,ssh键。
Git从命令行或Git Bash工作正常。我可以运行Jenkins试图运行的所有命令并且没有问题。
我有一个.ssh文件夹的副本到c:\ Documents and Settings \ Administrator和C:\ Program Files \ Git。
Jenkins Windows服务以管理员帐户运行,与本地系统相同。
当Jenkins开始构建时,我不断收到错误:没有可用的支持身份验证方法。这看起来像Jenkins无法在.ssh文件夹中找到密钥。
希望有人可以提供帮助。
Started by user anonymous
Building in workspace C:\websites\companya\ci\ci1build
Checkout:ci1build / C:\websites\companya\ci\ci1build - hudson.remoting.LocalChannel@1b2bb77
Using strategy: Default
Fetching changes from 1 remote Git repository
Fetching upstream changes from git@github.com:companya/companya.git
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Command "git.exe fetch -t git@github.com:companya/companya.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: trace: built-in: git 'fetch' '-t' 'git@github.com:companya/companya.git' '+refs/heads/*:refs/remotes/origin/*'
trace: run_command: 'C:\Program Files\PuTTY\plink.exe' '-batch' 'git@github.com' 'git-upload-pack '\''companya/companya.git'\'''
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
fatal: The remote end hung up unexpectedly
at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:818)
at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:780)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:196)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:1026)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:812)
at hudson.plugins.git.GitSCM.access$100(GitSCM.java:90)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1096)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064)
at hudson.FilePath.act(FilePath.java:842)
at hudson.FilePath.act(FilePath.java:824)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1064)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1245)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
at hudson.model.Run.execute(Run.java:1488)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
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:1103)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1064)
at hudson.FilePath.act(FilePath.java:842)
at hudson.FilePath.act(FilePath.java:824)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1064)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1245)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
at hudson.model.Run.execute(Run.java:1488)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:236)
答案 0 :(得分:0)
尝试从控制台运行Jenkins,而不是作为服务运行。
答案 1 :(得分:0)
找不到您的私钥(也许您是以不同的用户身份运行?)。
根据Git插件文档,您可以the home enviromnetal variable:
HOME => SSH密钥所在的文件夹(例如C:\ SSHKeys)