Jenkins Git Plugin

天涯浪子 提交于 2019-12-12 03:49:12

问题


I am getting the below error when attempting a Jenkins build of a project from a GitHub repository for a poc. Jenkins is a local install and I am using the https address for git with thge username and password I use to login to GitHub. Can anyone offer me some pointers here as I am new to both Jenkins and 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

回答1:


If your github login password has special characters, then the issue you are facing might be similar to the issue described in this ticket: https://issues.jenkins-ci.org/browse/JENKINS-38655

You can try getting your job to use JGit. Quoting from Mark Waite's answer in the above mentioned ticket:

"If you're not using TFS, but have special characters in the password of the specific user (like caret or ampersand or single quote or double quote), then this may be a duplicate of JENKINS-38194. The work around in that case may be to switch that job from using the command line git implementation to use the JGit implementation. The JGit implementation needs to be enabled globally first from "Manage Jenkins", "Global Tool Configuration", "Git", then there will be a pick list in each job which will allow you to choose whether that job should use command line git or JGit."




回答2:


Resolved the issue by switching the branch in github to master and making the repo public.



来源:https://stackoverflow.com/questions/42421890/jenkins-git-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!