Jenkins Git插件

时间:2017-02-23 16:59:14

标签: github jenkins jenkins-plugins

我从GitHub存储库尝试从一个poc的Jenkins构建项目时遇到以下错误。 Jenkins是一个本地安装,我使用https地址为git,使用我用来登录GitHub的用户名和密码。任何人都可以在这里提供一些指示,因为我是Jenkins和GitHub的新手

Building in workspace C:\Program Files (x86)\Jenkins\workspace\AdventureWorks2014 - 1. Build
Cloning the remote Git repository
Cloning repository https://github.com/h020905a/AdventureWorks2014.git
 > git.exe init C:\Program Files (x86)\Jenkins\workspace\AdventureWorks2014 - 1. Build # timeout=10
Fetching upstream changes from https://github.com/h020905a/AdventureWorks2014.git
 > git.exe --version # timeout=10
using GIT_ASKPASS to set credentials 
 > git.exe fetch --tags --progress https://github.com/h020905a/AdventureWorks2014.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Error performing git command
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1793)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1513)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:512)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
	at hudson.scm.SCM.checkout(SCM.java:495)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
	at hudson.model.Run.execute(Run.java:1728)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:404)
Caused by: org.jvnet.winp.WinpException: Failed to read RT_USER_PROCESS_PARAMETERS error=299 at envvar-cmdline.cpp:151
	at org.jvnet.winp.Native.getCmdLineAndEnvVars(Native Method)
	at org.jvnet.winp.WinProcess.parseCmdLineAndEnvVars(WinProcess.java:126)
	at org.jvnet.winp.WinProcess.getCommandLine(WinProcess.java:102)
	at hudson.util.ProcessTree$Windows$1.getArguments(ProcessTree.java:444)
	at hudson.plugins.msbuild.MsBuildKillingVeto.vetoProcessKilling(MsBuildKillingVeto.java:56)
	at hudson.util.ProcessTree$OSProcess.getVeto(ProcessTree.java:242)
	at hudson.util.ProcessTree$Windows$1.killRecursively(ProcessTree.java:425)
	at hudson.util.ProcessTree.killAll(ProcessTree.java:145)
	at hudson.Proc$LocalProc.destroy(Proc.java:380)
	at hudson.Proc$LocalProc.join(Proc.java:353)
	at hudson.Proc.joinWithTimeout(Proc.java:166)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1780)
	... 15 more
ERROR: null
Finished: FAILURE

2 个答案:

答案 0 :(得分:0)

如果您的github登录密码有特殊字符,那么您遇到的问题可能类似于此故障单中描述的问题: https://issues.jenkins-ci.org/browse/JENKINS-38655

您可以尝试让您的工作使用JGit。引自Mark Waite在上述票证中的回答:

"如果您没有使用TFS,但在特定用户的密码中有特殊字符(如插入符号或符号或单引号或双引号),那么这可能是JENKINS的副本 - 38194。在这种情况下,解决方法可能是使用命令行git实现来切换该作业以使用JGit实现。需要首先在全球范围内启用JGit实施,然后从"管理Jenkins","全局工具配置"," Git"然后在每个作业中都会有一个选择列表这将允许您选择该作业是否应该使用命令行git或JGit。"

答案 1 :(得分:0)

通过将github中的分支切换为master并使repo公开来解决该问题。