简体   繁体   English

无法在 Mac 上使用 Git 运行 Jenkins

[英]Unable to run Jenkins with Git on Mac

I am facing this issue when trying to run Jenkins with git on Mac.我在 Mac 上尝试使用 git 运行 Jenkins 时遇到了这个问题。 When trying to run it locally it works fine.当尝试在本地运行它时,它工作正常。 Please do let me know if I am missing anything.如果我遗漏了什么,请告诉我。

Building in workspace /Users/Shared/Jenkins/Home/workspace/****.git
using credential 00114677-0e15-4e8c-908b-d11516656392
 > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url https://github.com/Audify-github/****.git # timeout=10
Fetching upstream changes from https://github.com/Audify-github/***.git
 > /usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > /usr/bin/git fetch --tags --force --progress -- https://github.com/Audify-github/HashAutomation.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/Audify-github/***.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:908)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1123)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159)
    at hudson.scm.SCM.checkout(SCM.java:505)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1205)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
    at hudson.model.Run.execute(Run.java:1853)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:427)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --force --progress -- https://github.com/Audify-github/***.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:
stdout: 
stderr: 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2429)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2043)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:568)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:906)
    ... 11 more
ERROR: Error fetching remote repo 'origin'
Finish

Could it be you are missing your credentials/tokens?可能是您缺少凭据/令牌吗? The Jenkins agent could be run from another user, who doesn't have access to the repo. Jenkins 代理可以由另一个用户运行,该用户无权访问 repo。

I got the solution to this one.我得到了这个的解决方案。 Please download the Jenkins from below link.请从以下链接下载 Jenkins。

https://www.macminivault.com/installing-jenkins-on-macos/ https://www.macminivault.com/installing-jenkins-on-macos/

Also, after download check that the Jenkins location is under: /Users/Username/.jenkins/.此外,下载后检查 Jenkins 位置是否位于:/Users/Username/.jenkins/。

The issue in this is that if Jenkins is downloaded to /Users/Shared/Jenkins, then this does not work correctly.这里的问题是,如果 Jenkins 被下载到 /Users/Shared/Jenkins,那么这将无法正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM