无法从 Jenkins Windows Agent 克隆存储库



My Jenkins运行在docker容器上,该容器本身运行在VM上(我们称之为VM 1(。该代理是运行在VM 1上的VM上的windows代理,该VM正试图从网络驱动器克隆repo。网络驱动器已安装在位于/mnt/h/的docker容器中。当我启动项目时,我收到了一个错误,tt似乎是git插件在错误消息中连接了git.exe路径和要克隆的repo,如您所见:

16:49:59 stderr:致命:"C:\Program Files/Git/mnt/h/Git_NEW"似乎不是Git存储库

16:49:58 Started by user SmusJenkins
16:49:58 Running as SYSTEM
16:49:58 Building remotely on Smusjenkins VM (FAMUS) in workspace C:/Jenkins/workspace/FAMUS
16:49:58 The recommended git tool is: NONE
16:49:58 No credentials specified
16:49:58 Wiping out workspace first.
16:49:58 Cloning the remote Git repository
16:49:58 Cloning repository file:///mnt/h/GIT_NEW
16:49:58  > C:Program FilesGitbingit.exe init C:JenkinsworkspaceFAMUS # timeout=10
16:49:59 Fetching upstream changes from file:///mnt/h/GIT_NEW
16:49:59  > C:Program FilesGitbingit.exe --version # timeout=10
16:49:59  > git --version # 'git version 2.38.1.windows.1'
16:49:59  > C:Program FilesGitbingit.exe fetch --tags --force --progress -- file:///mnt/h/GIT_NEW +refs/heads/*:refs/remotes/origin/* # timeout=10
16:49:59 ERROR: Error cloning remote repo 'origin'
16:49:59 hudson.plugins.git.GitException: Command "C:Program FilesGitbingit.exe fetch --tags --force --progress -- file:///mnt/h/GIT_NEW +refs/heads/*:refs/remotes/origin/*" returned status code 128:
16:49:59 stdout: 
16:49:59 stderr: fatal: 'C:/Program Files/Git/mnt/h/GIT_NEW' does not appear to be a git repository
16:49:59 fatal: Could not read from remote repository.
16:49:59 
16:49:59 Please make sure you have the correct access rights
16:49:59 and the repository exists.
16:49:59 
16:49:59    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2697)
16:49:59    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2111)
16:49:59    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:87)
16:49:59    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:623)
16:49:59    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:852)
16:49:59    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:158)
16:49:59    at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:151)
16:49:59    at hudson.remoting.UserRequest.perform(UserRequest.java:211)
16:49:59    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
16:49:59    at hudson.remoting.Request$2.run(Request.java:376)
16:49:59    at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
16:49:59    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
16:49:59    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
16:49:59    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
16:49:59    at java.base/java.lang.Thread.run(Thread.java:1589)
16:49:59    Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Smusjenkins VM
16:49:59        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
16:49:59        at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
16:49:59        at hudson.remoting.Channel.call(Channel.java:1000)
16:49:59        at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:143)
16:49:59        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:49:59        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:49:59        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:49:59        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
16:49:59        at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:129)
16:49:59        at com.sun.proxy.$Proxy170.execute(Unknown Source)
16:49:59        at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1229)
16:49:59        at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1312)
16:49:59        at hudson.scm.SCM.checkout(SCM.java:540)
16:49:59        at hudson.model.AbstractProject.checkout(AbstractProject.java:1239)
16:49:59        at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:647)
16:49:59        at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
16:49:59        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:519)
16:49:59        at hudson.model.Run.execute(Run.java:1899)
16:49:59        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
16:49:59        at hudson.model.ResourceController.execute(ResourceController.java:107)
16:49:59        at hudson.model.Executor.run(Executor.java:449)
16:49:59 ERROR: Error cloning remote repo 'origin'
16:49:59 Finished: FAILURE

你知道我该怎么解决这个问题吗?

事实证明詹金斯不喜欢网络驱动器。我将windows路径添加到网络驱动器,一切正常。(\serverName\文件夹(

在这里找到我的anwser:https://stackoverflow.com/a/7417626/13689733

最新更新