我的Jenkins在Docker容器上运行,而Docker容器本身又在虚拟机上运行该代理是VM 1上运行的VM上的一个Windows代理,它试图从网络驱动器克隆一个存储库。网络驱动器已经安装在docker容器中的/mnt/h/处。当我启动项目时,我得到一个错误,git插件似乎将git.exe路径和repo连接在一起,以在错误消息中克隆,正如你可以看到这一行:
16:49:59标准错误:致命错误:“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 Files\Git\bin\git.exe init C:\Jenkins\workspace\FAMUS # timeout=10
16:49:59 Fetching upstream changes from file:///mnt/h/GIT_NEW
16:49:59 > C:\Program Files\Git\bin\git.exe --version # timeout=10
16:49:59 > git --version # 'git version 2.38.1.windows.1'
16:49:59 > C:\Program Files\Git\bin\git.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 Files\Git\bin\git.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
有什么办法能解决这个问题吗
1条答案
按热度按时间q35jwt9p1#
原来jenkins不喜欢网络驱动器。我把windows路径添加到网络驱动器,一切都正常了。(\serverName\folder)
在这里找到了我的答案:https://stackoverflow.com/a/7417626/13689733