Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: Error fetching remote repo 'origin' returned status code 143

I have Jenkins ver. 2.32.1 installed on my iMac and I have set up the git repository for my project and provided my credentials as well. Note: Repository is private. When the repository is cloned from Windows it works fine but when same repository is cloned from iMac it is giving below log and it is returning status code 143.

Started by user XYZ
Building in workspace /Users/Shared/Jenkins/Home/workspace/Project1
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/Organization/Repository # timeout=10
Fetching upstream changes from https://github.com/Organization/Repository
> git --version # timeout=10
using GIT_ASKPASS to set credentials 
> git fetch --tags --progress https://github.com/Organization/Repository +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/Organization/Repository
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://github.com/Organization/Repository +refs/heads/*:refs/remotes/origin/*" returned status code 143:
stdout: 
stderr: 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1772)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1516)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:67)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:318)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801)
... 11 more
ERROR: null
Finished: FAILURE

I have installed the Git plugin, but I am not able to understand why it is not able to get the code from GitHub. Can anyone help me by seeing the logs.

like image 574
iYoung Avatar asked Jan 11 '17 13:01

iYoung


2 Answers

I got the answer, issue was that my jenkins was not having complete access of my user though it was installed completely in another user & was showing jenkins path. When I reinstalled Jenkins in my user & provided it complete access it worked.

like image 166
iYoung Avatar answered Sep 23 '22 13:09

iYoung


How did you installed Jenkins Command line or the Java pkg?

The above seems to be the issue of User access. The User by which you installed Jenkins and the user by which u logged in your mac and accessing Jenkins might be different.

Try installing Jenkins from command line. This link may help Install Jenkins

like image 34
iAviator Avatar answered Sep 22 '22 13:09

iAviator