-1

I am facing this issue when trying to run Jenkins with git on Mac. 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
SIJO JOHN
  • 17
  • 2
  • 9

2 Answers2

0

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.

  • I have given in the username and password in the "credentials" section and selected the same in the "Job Configure". – SIJO JOHN Jan 30 '20 at 12:31
  • What about the slave where the job is running? I did not use them on Mac systems, but we do need to specify the username/password in some cases to the Jenkins slave service on Windows. – AnonymousLama Jan 30 '20 at 12:36
  • I don't have an idea about this. Can you please provide me some links or videos for this. Thanks – SIJO JOHN Jan 30 '20 at 13:51
  • I am not really sure about that, because as I said I'm not familiar with MacOS, but here you go: https://medium.com/@caseyg1204/setup-a-mac-slave-for-jenkins-63f087c8e943 https://stackoverflow.com/questions/22423695/setting-up-jenkins-slave-on-mac-os – AnonymousLama Jan 30 '20 at 14:00
  • Jenkins may use the slave service (or whatever you use to make it run) configuration to run commands. That user may be missing permissions. – AnonymousLama Jan 30 '20 at 14:05
0

I got the solution to this one. Please download the Jenkins from below link.

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

Also, after download check that the Jenkins location is under: /Users/Username/.jenkins/.

The issue in this is that if Jenkins is downloaded to /Users/Shared/Jenkins, then this does not work correctly.

SIJO JOHN
  • 17
  • 2
  • 9