[英]Issue in cloing private repo using the jenkins, ERROR: Error cloning remote repo 'origin'
Jenkins 版本:
Jenkins 2.263.4
git 路径一定没有问题。 我已经经历了许多类似的问题,但没有一个答案能够解决这个问题。
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository https://github.com/user/module_name.git
> C:\Program Files\Git\mingw64\bin\git.exe init C:\Workspace\workspace\Walky # timeout=10
Fetching upstream changes from https://github.com/user/module_name.git
> C:\Program Files\Git\mingw64\bin\git.exe --version # timeout=10
> git --version # 'git version 2.30.1.windows.1'
using GIT_ASKPASS to set credentials Vivek git credtials for jenkins Jenkins
> C:\Program Files\Git\mingw64\bin\git.exe fetch --tags --force --progress -- https://github.com/user/module_name.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\mingw64\bin\git.exe fetch --tags --force --progress -- https://github.com/user/module_name.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: remote: Repository not found.
fatal: repository 'https://github.com/user/module_name.git/' not found
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:802)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1221)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1299)
at hudson.scm.SCM.checkout(SCM.java:505)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1206)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
at hudson.model.Run.execute(Run.java:1907)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
ERROR: Error cloning remote repo 'origin'
Finished: FAILURE
首先检查 Jenkins 正在使用哪个帐户运行。
在 Windows 上,它可以使用 LocalSystem 而不是您自己的帐户在本地运行。
您可以检查 Jenkins 作业,执行简单的 bat shell 步骤:
git config --global -l --show-origin
您将看到全局 Git 配置在哪里。
如果它没有像您一样运行,Jenkins 将无法从必须缓存远程存储库托管服务凭据(用户名/密码)的相同 Windows 凭据管理器中受益。
这就是为什么您会收到 404 Not Found。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.