question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better error message for corrupt .git/index

See original GitHub issue

A user received this error when they had a bad index.

Information {“Message”:"System.ArgumentOutOfRangeException: Non-negative number required.\r\nParameter name: dstOffset\r\n at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.ReadPath(GitIndexEntry indexEntryData, Int32 replaceIndex, Int32 byteCount)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.ParseIndex(ITracer tracer, Stream indexStream, GitIndexEntry resuableParsedIndexEntry, Func2 entryAction)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.GitIndexParser.RebuildProjection(ITracer tracer, Stream indexStream)\r\n at GVFS.Virtualization.Projection.GitIndexProjection.BuildProjectionFromPath(ITracer tracer, String indexPath)\r\n at GVFS.RepairJobs.RepairJob.TryParseIndex(String path, List1 messages) in

Could it be more beneficial to run ‘git ls-files’ in and print out the error? Can we handle this better?

@kewillford @wilbaker @jamill @derrickstolee for everyone’s thoughts.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
derrickstoleecommented, Jun 10, 2019

I think in this specific case, even gvfs repair failed with the same error. @jeschu1 do you remember? I think we ended up deleting the .git/index file and repairing after that.

1reaction
kewillfordcommented, Jun 10, 2019

I think this is a good place to try/catch and throw an application exception (new GVFSException?) with a message to run the gvfs repair which will fix the corrupt index.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve "Error: bad index – Fatal: index file corrupt ...
This issue is occoured due to changes in git file or brach. Then you need to run this command on your cmd. del...
Read more >
Error from Locked Git Index File
How to Fix Git Index File to Recover from the Error "index file corrupt" or ".git/index.lock: File exists." · Error from Broken Git...
Read more >
How to fix a corrupt git index
Your index is corrupt when you see this error running usual git commands like git pull , git status , etc.: error: bad...
Read more >
How to resolve “Error bad index – Fatal index file corrupt ...
Solution 1: · If the problem is with the index as the staging area for commits (i.e. .git/index ), we can simply remove...
Read more >
Resolving Git Index Error - Shady Nagy
Follow these steps to fix the Git index error and restore your repository to a working state: Remove the damaged ancillary pointers and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found