[JIRA] [git-plugin] (JENKINS-34218) Shallow clone broken after JENKINS-24728

68 views
Skip to first unread message

josh@freelancer.com (JIRA)

unread,
Apr 13, 2016, 9:16:04 PM4/13/16
to jenkinsc...@googlegroups.com
Joshua Spence created an issue
 
Jenkins / Bug JENKINS-34218
Shallow clone broken after JENKINS-24728
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2016/Apr/14 1:15 AM
Environment: git-plugin 2.4.4
Priority: Critical Critical
Reporter: Joshua Spence

JENKINS-24728 broke our use of shallow clone. Basically, we are getting the following error:

```
> git config remote.origin.url git@REDACTED # timeout=10
Pruning obsolete local branches
Fetching upstream changes from git@REDACTED
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@REDACTED +refs/heads/:refs/remotes/origin/ --prune --depth=1
Checking out Revision 1f2bf20dfc5a408d56181c9db99ac994545f44c3 (origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 1f2bf20dfc5a408d56181c9db99ac994545f44c3 # timeout=10
FATAL: Could not checkout master with start point 1f2bf20dfc5a408d56181c9db99ac994545f44c3
hudson.plugins.git.GitException: Could not checkout master with start point 1f2bf20dfc5a408d56181c9db99ac994545f44c3
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1990)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:324)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Thread.java:745)
at ......remote call to i-b8caab51-5500c494(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
at hudson.remoting.Channel.call(Channel.java:781)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
at sun.reflect.GeneratedMethodAccessor705.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
at com.sun.proxy.$Proxy72.execute(Unknown Source)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1135)
at hudson.scm.SCM.checkout(SCM.java:485)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1738)
at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git checkout -f 1f2bf20dfc5a408d56181c9db99ac994545f44c3" returned status code 128:
stdout:
stderr: fatal: reference is not a tree: 1f2bf20dfc5a408d56181c9db99ac994545f44c3

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1695)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1691)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1321)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1333)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:1966)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:152)
at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:145)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:324)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Thread.java:745)
```

From comparing build logs, I believe that the issue is this line:

```
git -c core.askpass=true fetch --tags --progress git@REDACTED +refs/heads/:refs/remotes/origin/ --prune --depth=1
```

From a build with a prior version of the plugin, I see the following output:

```
git -c core.askpass=true fetch --tags --progress g...@git.freelancer.com:eng/production.git +refs/heads/:refs/remotes/origin/ --prune
```

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 14, 2016, 12:16:03 AM4/14/16
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-34218
 
Re: Shallow clone broken after JENKINS-24728

What version of command line git are you running on the computer which shows the problem?

If you run the same job again, does it then succeed?

Have you configured any other "Additional Behaviours" in the failing job?

Does the same problem happen on every job which uses a shallow clone?

Can you provide a series of steps which will duplicate the problem?

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 14, 2016, 12:18:01 AM4/14/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-34218
What version of command line git are you running on the computer which shows the problem?

If you run the same job again, does it then succeed?

Have you configured any other "Additional Behaviours" in the failing job?

Does the same problem happen on every job which uses a shallow clone?

Can you provide a series of steps which will duplicate the problem?


Does the problem resolve itself if you use the earlier git plugin version (for example 2.4.2, don't use 2.4.3, it contains a job definition data loss bug that you don't want in your Jenkins)?

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 14, 2016, 12:24:01 AM4/14/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-34218
What version of command line git are you running on the computer which shows the problem?

If you run the same job again, does it then succeed?

Have you configured any other "Additional Behaviours" in the failing job?

Does the same problem happen on every job which uses a shallow clone?

Can you provide a series of steps which will duplicate the problem?

Does the problem resolve itself if you use the earlier git plugin version (for example 2.4.2, don't use 2.4.3, it contains a job definition data loss bug that you don't want in your Jenkins)?


Was the source repository involved in any form of cleanup or deletion of commits or content?  JENKINS-10571 seems to suggest that the same message may happen when a branch is deleted from the source repository.

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 14, 2016, 3:29:02 PM4/14/16
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 14, 2016, 3:32:02 PM4/14/16
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-34218
What version of command line git are you running on the computer which shows the problem?

If you run the same job again, does it then succeed?

Have you configured any other "Additional Behaviours" in the failing job?

Does the same problem happen on every job which uses a shallow clone?

Can you provide a series of steps which will duplicate the problem?

Does the problem resolve itself if you use the earlier git plugin version (for example 2.4.2, don't use 2.4.3, it contains a job definition data loss bug that you don't want in your Jenkins)?

Was the source repository involved in any form of cleanup or deletion of commits or content?  JENKINS-10571 seems to suggest that the same message may happen when a branch is deleted from the source repository.


Where is 1f2bf20dfc5a408d56181c9db99ac994545f44c3 in the history of that repository?  For example, is it the tip of the branch that is to be built, or is it somewhere deeper than 1 commit into the history of the repository?

If you set a depth greater than 1, does that resolve the issue?

If you don't perform a shallow checkout, does that resolve the issue?

josh@freelancer.com (JIRA)

unread,
Apr 18, 2016, 1:45:02 AM4/18/16
to jenkinsc...@googlegroups.com

> What version of command line git are you running on the computer which shows the problem?

2.7.4

> If you run the same job again, does it then succeed?

Yes, subsequent runs of the job seem to succeed.

> Have you configured any other "Additional Behaviours" in the failing job?

Yes, we also have "Check out to a specific local branch" with the branch name set to "" (empty string), "prune stale remote-tracking branches" and "clean after checkout".

> Does the same problem happen on every job which uses a shallow clone?

Actually, we only have a single job which uses shallow clone so I am unable to verify this.

> Was the source repository involved in any form of cleanup or deletion of commits or content? JENKINS-10571 seems to suggest that the same message may happen when a branch is deleted from the source repository.

No, we never remove commits from this repository.

mark.earl.waite@gmail.com (JIRA)

unread,
Apr 21, 2016, 12:32:01 AM4/21/16
to jenkinsc...@googlegroups.com

The next time that job fails, can you interactively perform a clone with --depth=1 and check if the SHA1 the job is trying to checkout is included in the shallow clone ofthe repository? I suspect it is not included in the shallow clone, almost as though the initial shallow clone needs to specify that exact SHA1 as the thing it is cloning.

For example, if the initial clone is depth=1, and the sha1 being built is not the tip of that clone, then I would expect that sha1 to not be included in the repository (since the depth was 1).

josh@freelancer.com (JIRA)

unread,
Apr 21, 2016, 1:11:01 AM4/21/16
to jenkinsc...@googlegroups.com

Since filing this ticket we have simply stopped using shallow clone. As such, I can't easily reproduce this problem at the moment.

mark.earl.waite@gmail.com (JIRA)

unread,
Aug 1, 2016, 4:49:01 PM8/1/16
to jenkinsc...@googlegroups.com
Mark Waite resolved as Cannot Reproduce
 
Change By: Mark Waite
Status: Open Resolved
Resolution: Cannot Reproduce
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

awattar.gm@gmail.com (JIRA)

unread,
Oct 9, 2018, 4:09:02 PM10/9/18
to jenkinsc...@googlegroups.com
Michal Wesolowski commented on Bug JENKINS-34218
 
Re: Shallow clone broken after JENKINS-24728

It breaks when using Shallow clone with depth 1 together with wildcard or regex branch specifier:

15:19:14 Seen 47 remote branches
15:19:14  > git show-ref --tags -d # timeout=10
15:19:14 FATAL: Walk failure.
15:19:14 org.eclipse.jgit.errors.MissingObjectException: Missing commit 07fd7f0f9059f329a98f0f255f6c3d22b08f0dba
15:19:14 	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:159)
15:19:14 	at org.eclipse.jgit.revwalk.RevWalk.getCachedBytes(RevWalk.java:903)
15:19:14 	at org.eclipse.jgit.revwalk.RevCommit.parseHeaders(RevCommit.java:155)
15:19:14 	at org.eclipse.jgit.revwalk.PendingGenerator.next(PendingGenerator.java:147)
15:19:14 	at org.eclipse.jgit.revwalk.StartGenerator.next(StartGenerator.java:184)
15:19:14 	at org.eclipse.jgit.revwalk.RevWalk.next(RevWalk.java:435)
15:19:14 	at org.eclipse.jgit.revwalk.RevWalk.iterator(RevWalk.java:1322)
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

awattar.gm@gmail.com (JIRA)

unread,
Oct 9, 2018, 4:09:02 PM10/9/18
to jenkinsc...@googlegroups.com

dmatej@seznam.cz (JIRA)

unread,
Oct 19, 2018, 11:17:02 AM10/19/18
to jenkinsc...@googlegroups.com
David Matejcek commented on Bug JENKINS-34218
 
Re: Shallow clone broken after JENKINS-24728

Same problem, it seems the problem is the old GIT 1.7.10.4 installed on Debian 7.11. Workaround: delete the repository and don't use shallow clone with this version of GIT.

dmatej@seznam.cz (JIRA)

unread,
Oct 19, 2018, 11:19:01 AM10/19/18
to jenkinsc...@googlegroups.com
David Matejcek edited a comment on Bug JENKINS-34218
Same problem, it seems the problem is the old GIT 1.7.10.4 installed on Debian 7.11. Workaround: delete the repository and don't use shallow clone with this version of GIT.


I got no problem with git 2.17.1.
Reply all
Reply to author
Forward
0 new messages