Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-2691

Git scanning fails with "Repository index failed due to error - class java.lang.IllegalStateException: Failed to parse specs correctly"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.3.5
    • 2.3.4
    • Indexing

    Description

      Dylan identified the cause in https://support.atlassian.com/browse/FSH-4047:

      GitScanner.chooseParent() {
      
      ...
      for (String pathSpec : pathSpecs) {
          GitChangePath changePath = GitChangeParser.parseChangePath(pathSpec);
          if (changePath.getAction() != 'D' && changePath.getDestHash().startsWith("00000")) {
              throw new IllegalStateException("Failed to parse specs correctly: " + pathSpecs);
          }
          commitDetails.addPath(changePath);
      }
      ...
      

      It looks like the GitScanner class is having issues determining the parent for a given commit. The pathSpecs variable does get written to the long, and although it's quite long and verbose I have been able to break out some of the pathSpecs (which I think are just Git raw diffs, I'm still very new to Git). Regardless, here are some examples:

      :100644 100644 3896e84b034a8da2b56b09c4e7e649750f12d90b de4facc7b715834cf25b6bd2a7f058dfbbca2e34 M	Windows/TCC2.API/.gitignore
      :000000 100644 0000000000000000000000000000000000000000 e132f17f0c30d437a1da5d05ca8a641c65d4980c A	Windows/TCC2.API/TCC2.API/IUploader.cs
      :000000 100644 0000000000000000000000000000000000000000 04e480c8b3aceae12dda7282398084f88b7d8133 A	Windows/TCC2.TripCapture/TCC2.API.Trips/Properties/AssemblyInfo.cs
      ...
      :100644 100644 32e3950c6f5af3010114f939595ba340cd320f5a 00000239a60af8d9b4ed2565c86a60399f584134 M	tcc2/code/tcc/src/test/java/com/xcc/testutils/Tester.java
      

      If I understand correctly, Git will only have fully-zeroed MD5 for an addition (source) or deletion (destination). However, in our code above we don't check all characters for zeros on deletion, only the first five (see changePath.getDestHash().startsWith("00000"). On the last line in the diff above, there is a modification that just happens to have it's MD5 start with five zeros. This is why I think the IllegalStateException is being thrown.

      Attachments

        Activity

          People

            mwatson@atlassian.com mwatson
            mwatson@atlassian.com mwatson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: