<-- Back

Push/pull fails in Version Control with error: LibGit2Sharp.NotFoundException: object not found - no match for id or LibGit2Sharp.LibGit2SharpException: missing delta bases

 

Issue

When pushing local development changes to Version Control, the following message appears:

There are incoming changes from the server that you need to merge before pushing your changes. Pull changes from the server, resolve conflicts, and push again.

When trying to perform those steps mentioned in the message above, the pull fails with the below error:

LibGit2Sharp.NotFoundException: object not found - no match for id (INSERT_ID)
at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in /_/LibGit2Sharp/Core/Ensure.cs:line 155
at LibGit2Sharp.Core.Proxy.git_merge(RepositoryHandle repo, AnnotatedCommitHandle[] heads, GitMergeOpts mergeOptions, GitCheckoutOpts checkoutOptions, Boolean& earlyStop) in /_/LibGit2Sharp/Core/Proxy.cs:line 1320
at LibGit2Sharp.Repository.NormalMerge(AnnotatedCommitHandle[] annotatedCommits, Signature merger, MergeOptions options) in /_/LibGit2Sharp/Repository.cs:line 1619
at LibGit2Sharp.Repository.Merge(AnnotatedCommitHandle[] annotatedCommits, Signature merger, MergeOptions options) in /_/LibGit2Sharp/Repository.cs:line 1536
at LibGit2Sharp.Repository.Merge(Branch branch, Signature merger, MergeOptions options) in /_/LibGit2Sharp/Repository.cs:line 1262
at Mendix.Modeler.VersionControl.Actions.GitMergeAction.MergeWithResult(IRepository repo, Branch featureBranch, Signature signature, FastForwardStrategy fastForwardStrategy) in Mendix.Modeler.VersionControl.Git\Actions\GitMergeAction.cs:line 64
at Mendix.Modeler.VersionControl.Operations.Git.GitUpdateOperation.TryMerge(IRepository repo, Signature signature) in Mendix.Modeler.VersionControl.Git\Operations\GitUpdateOperation.cs:line 114
at Mendix.Modeler.VersionControl.Operations.Git.GitUpdateOperation.DoUpdate(UpdateRequest updateRequest, Repository repo) in Mendix.Modeler.VersionControl.Git\Operations\GitUpdateOperation.cs:line 75

or 

LibGit2Sharp.LibGit2SharpException: missing delta bases

Environment

Version Control

Cause

The errors LibGit2Sharp.NotFoundException: object not found - no match for id (INSERT_ID) or LibGit2Sharp.LibGit2SharpException: missing delta bases indicate that the Git repository is unable to find an object (such as a commit, tree, or blob) corresponding to the specified ID (SHA-1 hash). This can occur due to several reasons:

  1. Conflict of the merge: an object is missing. According to best practice, it is best to pull the latest changes from the remote repository after each merge to avoid any conflicts.
  2. Corrupted Repository: The repository might be corrupted, causing some objects to be missing or inaccessible.
  3. Incomplete Clone: The repository might not have been fully cloned, resulting in missing objects.
  4. Dangling References: There might be references to objects that have been deleted or are otherwise unavailable.
  5. Network Issues: If the repository is being accessed over a network, connectivity issues might cause the object to be inaccessible.

Solution/Workaround

To solve the error, please consider whether development changes can be lost and then utilize the following suggestions:

  •  Perform git fetch --refetch on the command line in the project directory. This should re-download and verify all available information of the server against the local repository. In this case, the missing object will be downloaded again.
  • If the above does not work, are the local changes easy to recreate (i.e. can work be lost)? If so, please do the following:
    1. Delete the local project folder
    2. Download the project fresh from Version Control
    3. Redo the changes.
  • If the local changes are extensive and there is some flexibility with branch management, please try the following:
    1. Create a branch from the main line that contains the locally committed changes (which had the mentioned problem). 
    2. Download a fresh version of the project from the version control server and open it.
    3. Lastly, merge the branch with the locally committed changes into the newly downloaded version from the Team Server.

Internal information related

  • 230109, 202214,191208,186977

Additional information 

Mendix Documentation:

Forum Post: 122333 

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.