git clone error

1,363 views
Skip to first unread message

GS_L

unread,
Jan 19, 2016, 2:17:34 PM1/19/16
to Jenkins Users
I'm using jenkins 1.631 on ubuntu 14.04, slaves installed also on ubuntu 14.04.
I added git path to PATH env variable.
git plugins:
Git client plugin 1.19.1
Git plugin 2.4.1
GitHub API Plugin 1.71
GitHub plugin 1.14.2

Sometimes I get the following error: "ERROR: Error cloning remote repo 'origin'"
hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress ... +refs/heads/*:refs/remotes/origin/*" returned status code 143:
It's happen on master and slaves as well.

Most of the builds success but everyday some of the builds fail on this error.
I looked over the posts with the same problem but I haven't found a solution.

Please your advice.

Victor Martinez

unread,
Jan 20, 2016, 8:18:29 AM1/20/16
to Jenkins Users
Correct me if I'm wrong but those log details are not enough, can you attach your full console log? Probably there is something else after that error in the stacktrace error output. It might be related to some timeout issues...

Cheers

GS_L

unread,
Jan 20, 2016, 8:44:31 AM1/20/16
to Jenkins Users
I attached the logs - (I removed the repository url)

Job with default timeout:
Cloning the remote Git repository
Cloning repository ...
 > git init /var/lib/jenkins/jobs/NightlyBuild-3.4/workspace/dir_clis/build_cli_centos_final/cloudify-cli # timeout=10
Fetching upstream changes from ...
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress ... +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress .
.. +refs/heads/*:refs/remotes/origin/*" returned status code 143:
stdout: 
stderr: remote: Counting objects: 8354, done.        
remote: Compressing objects:   2% (1/38)           
remote: Compressing objects:   5% (2/38)           
remote: Compressing objects:   7% (3/38)           
remote: Compressing objects:  10% (4/38) 

Job with 20 minutes timeout:
    9:20:08 Cloning the remote Git repository
09:20:08 Cloning repository ...
09:20:08  > git init /var/lib/jenkins/jobs/dir_admin/jobs/sync_xap-openspaces/workspace/xap # timeout=10
09:20:08 Fetching upstream changes from ...
09:20:08  > git --version # timeout=10
09:20:08  > git -c core.askpass=true fetch --tags --progress ... +refs/heads/*:refs/remotes/origin/* # timeout=20
09:40:08 ERROR: Timeout after 20 minutes
09:40:08 ERROR: Error cloning remote repo 'origin'
09:40:08 hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress ... +refs/heads/*:refs/remotes/origin/*" returned status code 143:
09:40:08 stdout: 
09:40:08 stderr: remote: Counting objects: 1192544, done. [K
09:40:08 remote: Compressing objects:   0% (1/337)    [K
remote: Compressing objects:   1% (4/337)    [K
remote: Compressing objects:   2% (7/337)    [K
remote: Compressing objects:   3% (11/337)    [K
remote: Compressing objects:   4% (14/337)    [K
remote: Compressing objects:   5% (17/337)    [K
remote: Compressing objects:   6% (21/337)    [K      

Victor Martinez

unread,
Jan 20, 2016, 1:28:00 PM1/20/16
to Jenkins Users
Timeout issue as you can see

09:40:08 ERROR: Timeout after 20 minutes


You can set that value as you probably did  it since the default timeout is 10 minutes. Probably some networking latency issue in your system so you can bypass it with a longer timeout.

Cheers

Mark Waite

unread,
Jan 20, 2016, 1:56:59 PM1/20/16
to Jenkins Users
If it is a large repository, and if you don't mind keeping an extra copy on your slave, you might consider using the "reference repository" option.  That allows you to place a bare copy of the git repository on your slave and reference its contents rather than copying them over the network.  It saves network time and can save disc space if you have multiple jobs cloning the same original repository.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/87e5dd63-b984-4e61-a6ce-f00ed5185b53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Klaus Schniedergers

unread,
Jan 20, 2016, 5:32:30 PM1/20/16
to jenkins...@googlegroups.com
If you're dealing with a flaky origin repository, the "SCM checkout retry count" configuration comes in very handy.
It's in the main Jenkins configuration screen.

GS_L

unread,
Jan 27, 2016, 11:15:24 AM1/27/16
to Jenkins Users, kl...@schniedergers.com
Thanks the "SCM checkout retry count" helped

GS_L

unread,
Jan 31, 2016, 9:59:24 AM1/31/16
to Jenkins Users, kl...@schniedergers.com
Somehow the retry doesn't work correctly on one of the jobs.
It's look like the retry success but the shell script that runs right after the git clone fails:

pushd xap
git checkout master 
popd

error log:

09:50:09 Retrying after 10 seconds
09:50:19  > git rev-parse --is-inside-work-tree # timeout=10
09:50:19 Fetching changes from the remote Git repository
09:50:19  > git config remote.origin.url git@.../xap.git # timeout=10
09:50:19 Fetching upstream changes from git@.../xap.git
09:50:19  > git --version # timeout=10
09:50:19  > git -c core.askpass=true fetch --tags --progress git@.../xap.git +refs/heads/*:refs/remotes/origin/* # timeout=30
09:53:15  > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
09:53:15  > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
09:53:15 Checking out Revision e6831a738dfb2546746fbff37bd9882f62abb0bb (refs/remotes/origin/master)
09:53:15  > git config core.sparsecheckout # timeout=10
09:53:15  > git checkout -f e6831a738dfb2546746fbff37bd9882f62abb0bb
09:53:20  > git rev-list 8dfa9a6adad0299007dccb7d8d3d38c57ba7b819 # timeout=10
09:53:24 [workspace] $ /bin/bash -e /tmp/hudson4355556809214754130.sh
09:53:24 ~/jobs/dir_admin/jobs/sync_xap-openspaces/workspace/xap ~/jobs/dir_admin/jobs/sync_xap-openspaces/workspace
09:53:25 error: pathspec 'master' did not match any file(s) known to git.
09:53:25 Build step 'Execute shell' marked build as failure
Reply all
Reply to author
Forward
0 new messages