libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Error when fetching from remote LibGit2Sharp.NotFoundException: 'object not found - no match for id

Open cortex-pg opened this issue 5 years ago • 5 comments

We have been having a problem with libgit2sharp being unable to fetch from a remote after it gets to a certain size/certain number of branches. Researching this error seems to come back with results of problems with a sparse checkout which this isn't doing. I have attached a example program and repository that reproduces it. If you go to the generated repository user in the bin folder after running the program and run git pull from the command line it completes successfully.

Reproduction steps

Run the program downloadable here. I don't know exactly what it is about the repository that causes the problem.

Expected behavior

The fetch works as normal

Actual behavior

LibGit2Sharp.NotFoundException: 'object not found - no match for id (073a4772601e16614079cff44ca8d7d6275f6377)' is thrown

Version of LibGit2Sharp (release number or SHA1)

v0.26.2

Operating system(s) tested; .NET runtime tested

.NET Core SDK (reflecting any global.json): Version: 3.1.401 Commit: 5b6f5e5005

Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64

cortex-pg avatar Aug 27 '20 15:08 cortex-pg

We are experiencing the same error message when calling repo.Pull.

Runtime Environment: 3.1.7 (image dotnet/core/aspnet:3.1.7-alpine3.12) .NET Core SDK (reflecting any global.json): Version: 3.1.401 LibGit2Sharp Version="0.27.0-preview-0034

acn-sbuad avatar Sep 04 '20 12:09 acn-sbuad

I have the same issue. It works fine locally on my own Windows machine but when I run on an Azure pipeline hosted agent (ubuntu-22.04) it fails with the same LibGit2Sharp.NotFoundException: 'object not found - no match for id.

I have LibGit2Sharp v0.27.2 and my application is .NET 7.

elzik avatar Aug 02 '23 08:08 elzik

I have the same issue. It works fine locally on my own Windows machine but when I run on an Azure pipeline hosted agent (ubuntu-22.04) it fails with the same LibGit2Sharp.NotFoundException: 'object not found - no match for id.

@elzik Azure Pipelines does a shallow clone by default. Be sure to configure it to do a deep(er) clone.

ethomson avatar Aug 02 '23 09:08 ethomson

@ethomson

@elzik Azure Pipelines does a shallow clone by default. Be sure to configure it to do a deep(er) clone.

Thanks, that was it. The error was happening when I was trying to find the most recent tag so I was using:

repo.Describe(currentCommit, new DescribeOptions() { Strategy = DescribeStrategy.Tags })

However, I'd still like to get the most recent tag even with a shallow clone. Is this simply not possible?

elzik avatar Aug 03 '23 07:08 elzik