2016-09-08 1 views
3

Windows 10 (1607)에서 실행중인 Jenkins 슬레이브가 있습니다. 슬레이브를 JNLP로 직접 실행하면이 슬레이브는 git 저장소 (사용자 이름과 비밀번호로 인증)에서 복제 할 수 있습니다.Jenkins Windows slave : 서비스로 실행 중일 때 인증 실패

서비스와 동일한 슬레이브를 시작하면 git clone이 Authentication failed for ...으로 실패합니다.

서비스는 슬레이브의 "파일"메뉴를 통해 생성되며 "로컬 시스템 계정"으로 실행됩니다.

무슨 일입니까? 서비스 시작 방법

00:00:00.003 Started by user <commit-user> 
00:00:00.005 ln -s builds/lastSuccessfulBuild /var/jenkins_home/jobs/Xamarin/jobs/MyProject/jobs/CIBuild/lastSuccessful failed: 95 Not supported 
00:00:00.005 ln -s builds/lastStableBuild /var/jenkins_home/jobs/Xamarin/jobs/MyProject/jobs/CIBuild/lastStable failed: 95 Not supported 
00:00:00.005 Building remotely on Win10Xamarin (Win10 Xamarin Git NetCore) in workspace c:\Jenkins\workspace\Xamarin\iRec Common\iRecy Common CI 
00:00:00.025 Cloning the remote Git repository 
00:00:00.031 Cloning repository http://git-server/MyGroup/test-project 
00:00:00.032 > C:\Program Files\Git\cmd\git.exe init c:\Jenkins\workspace\Xamarin\iRec Common\iRecy Common CI # timeout=10 
00:00:00.252 Fetching upstream changes from http://git-server/MyGroup/test-project 
00:00:00.255 > C:\Program Files\Git\cmd\git.exe --version # timeout=10 
00:00:00.351 > C:\Program Files\Git\cmd\git.exe -c core.askpass=true fetch --tags --progress http://git-server/MyGroup/test-project +refs/heads/*:refs/remotes/origin/* 
00:00:01.148 ERROR: Error cloning remote repo 'origin' 
00:00:01.149 hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe -c core.askpass=true fetch --tags --progress http://git-server/MyGroup/test-project +refs/heads/*:refs/remotes/origin/*" returned status code 128: 
00:00:01.149 stdout: 
00:00:01.149 stderr: fatal: Authentication failed for 'http://git-server/MyGroup/test-project/' 
00:00:01.149 
00:00:01.149 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1740) 
00:00:01.149 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1476) 
00:00:01.149 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63) 
00:00:01.149 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314) 
00:00:01.149 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:506) 
00:00:01.149 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152) 
00:00:01.149 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145) 
00:00:01.149 at hudson.remoting.UserRequest.perform(UserRequest.java:153) 
00:00:01.149 at hudson.remoting.UserRequest.perform(UserRequest.java:50) 
00:00:01.149 at hudson.remoting.Request$2.run(Request.java:332) 
00:00:01.149 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 
00:00:01.149 at java.util.concurrent.FutureTask.run(Unknown Source) 
00:00:01.150 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
00:00:01.150 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
00:00:01.150 at hudson.remoting.Engine$1$1.run(Engine.java:85) 
00:00:01.150 at java.lang.Thread.run(Unknown Source) 
00:00:01.150 at ......remote call to Win10Xamarin(Native Method) 
00:00:01.150 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416) 
00:00:01.150 at hudson.remoting.UserResponse.retrieve(UserRequest.java:253) 
00:00:01.150 at hudson.remoting.Channel.call(Channel.java:781) 
00:00:01.150 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145) 
00:00:01.150 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
00:00:01.150 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
00:00:01.150 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
00:00:01.150 at java.lang.reflect.Method.invoke(Method.java:498) 
00:00:01.153 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131) 
00:00:01.153 at com.sun.proxy.$Proxy65.execute(Unknown Source) 
00:00:01.153 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1046) 
00:00:01.153 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086) 
00:00:01.153 at hudson.scm.SCM.checkout(SCM.java:495) 
00:00:01.153 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269) 
00:00:01.153 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) 
00:00:01.153 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 
00:00:01.153 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) 
00:00:01.153 at hudson.model.Run.execute(Run.java:1741) 
00:00:01.153 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
00:00:01.153 at hudson.model.ResourceController.execute(ResourceController.java:98) 
00:00:01.153 at hudson.model.Executor.run(Executor.java:410) 
00:00:01.153 ERROR: null 
00:00:01.153 Skipped archiving because build is not successful 
00:00:01.154 Recording NUnit tests results 
00:00:01.160 FATAL: No NUnit test report files were found. Configuration error? 
00:00:01.165 Build step 'Publish NUnit test result report' marked build as failure 
00:00:01.180 Finished: FAILURE 

답변

3

확인 : 여기

는 Jenins의 출력이다는 Local System account를 사용하는 경우,이 같은 %USERPROFILE%이없는 것 일반적으로 저장 같은 자식 구성 (혜택 않을 것이다

sc create JenkinsSlave binPath= d:\Jenkins_Slave\jenkins-slave.exe DisplayName= "Jenkins Slave xxx for https://<url>/jenkins" start= auto obj= DOMAIN\aUSER password= <password> 

참고 :

) %USERPROFILE%\.gitconfig에서 나는 보통 사용자 계정을 사용하여 내 서비스를 만들 obj=password= 이후의 공백

JENKINS-34082과 같이 Windows 자격 증명 문제로 인해 로컬 시스템 계정으로 작업하지 않았습니다.

Windows 슬레이브 컴퓨터에서 "git"을 제거하고 "Windows 자격 증명 관리자"를 사용하지 않고 설치합니다.

작품 :

OP WeDucercomments

가 설치된 자격 증명 관리자는 복제에서 로컬 시스템 계정을 막았다.

+0

로컬 시스템 계정에서 특정 사용자로 변경하면 작동합니다. 그러나 나는 왜 그런지 이해하지 못한다. 특정 사용자에게는 .gitconfig도 없으며 두 경우 모두 Jenkins에서 credeantial을 전달합니다. – WebDucer

+0

@WebDucer https 또는 ssh의 URL입니까? 나는 본다 : https. Jenkins는 작업을 실행하는 사용자와 관련된 자격 증명을 사용해야합니다. Jenkins에서 해당 사용자에 대한 자격 증명이 저장되어 있어야하지만 "로컬 시스템 계정"에 대한 자격 증명은 없습니다 – VonC

+0

저는 http를 사용합니다. 서비스가 실행되는 사용자는 자격 증명 저장소에 저장된 사용자와 다릅니다. (예 : 서비스 사용자가 "빌드 에이전트"이고 git 사용자가 "gitAgent"임). – WebDucer

관련 문제