Skip to content
Advertisement

SonarLint throws IllegalStateException -> Failed to read local issue store index

I’m currently working in my Job with Eclipse and Java. We should use SonarLint to get some cleaner code and ’till yesterday everything was fine. But yesterday morning, when I opened Eclipse, SonarLint throw me the following errormessage.

I’ve already searched in Google, deleted the .sonarlint folder, also the settingsfolder of eclipse and the .sonarlint folder inside the eclipse-workspace. Everyone of them where recreated by restarting eclipse but nothing helped here. I’m still getting the error:

Starting SonarLint for Eclipse 4.2.0.201909192007
SonarLint processing file /rap-server-core/src/main/java/com/rapidclipse/framework/server/ui/filter/FilterComponent.java...
Starting standalone SonarLint engine 4.2.0.201909192007...
Found 17 issue(s)
Error during execution of SonarLint analysis
java.lang.IllegalStateException: Failed to read local issue store index
    at org.sonarlint.eclipse.core.internal.tracking.StringStoreIndex.load(StringStoreIndex.java:55)
    at org.sonarlint.eclipse.core.internal.tracking.StringStoreIndex.keys(StringStoreIndex.java:45)
    at org.sonarlint.eclipse.core.internal.tracking.IndexedObjectStore.deleteInvalid(IndexedObjectStore.java:78)
    at org.sonarlint.eclipse.core.internal.tracking.IssueStore.<init>(IssueStore.java:62)
    at org.sonarlint.eclipse.core.internal.SonarLintCorePlugin.lambda$0(SonarLintCorePlugin.java:102)
    at org.sonarlint.eclipse.core.internal.tracking.IssueTrackerRegistry.newTracker(IssueTrackerRegistry.java:54)
    at org.sonarlint.eclipse.core.internal.tracking.IssueTrackerRegistry.getOrCreate(IssueTrackerRegistry.java:43)
    at org.sonarlint.eclipse.core.internal.SonarLintCorePlugin.getOrCreateIssueTracker(SonarLintCorePlugin.java:146)
    at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.trackIssues(AbstractAnalyzeProjectJob.java:317)
    at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.lambda$15(AbstractAnalyzeProjectJob.java:302)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
    at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.updateMarkers(AbstractAnalyzeProjectJob.java:302)
    at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:209)
    at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:169)
    at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
    at com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:102)
    at com.google.protobuf.CodedInputStream$StreamDecoder.readTag(CodedInputStream.java:2066)
    at org.sonarlint.eclipse.core.internal.proto.Sonarlint$StorageIndex.<init>(Sonarlint.java:2496)
    at org.sonarlint.eclipse.core.internal.proto.Sonarlint$StorageIndex.<init>(Sonarlint.java:2482)
    at org.sonarlint.eclipse.core.internal.proto.Sonarlint$StorageIndex$1.parsePartialFrom(Sonarlint.java:3126)
    at org.sonarlint.eclipse.core.internal.proto.Sonarlint$StorageIndex$1.parsePartialFrom(Sonarlint.java:1)
    at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:215)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:232)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:237)
    at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:48)
    at com.google.protobuf.GeneratedMessageV3.parseWithIOException(GeneratedMessageV3.java:332)
    at org.sonarlint.eclipse.core.internal.proto.Sonarlint$StorageIndex.parseFrom(Sonarlint.java:2746)
    at org.sonarlint.eclipse.core.internal.tracking.StringStoreIndex.load(StringStoreIndex.java:53)
    ... 16 more

I don’t know what the problem is and as I said google couldn’t help me that much (maybe I’m just to stupid for google idk)

Advertisement

Answer

I had the same problem.

I had tried downgrading from 5.0 to 4.3, but that did not solve the issue.

So I did some investigation and found that in the source code sonarlint-eclipse/org.sonarlint.eclipse.core/src/org/sonarlint/eclipse/core/internal/tracking/StringStoreIndex.java line 53 ultimately lead to public static final String INDEX_FILENAME = "index.pb"; (line 34).

So what I did was del /s /q /f index.pb within the Eclipse, Maven and Workspace folders. And it was under the Workspace .metadata.plugins folder.

And now, the error seems to be gone. SonarLint is finally reporting on where the “smelly” code is again.

I have a feeling that the permissions for index.pb got messed-up or not updated, and could not load the file as the error message suggested.

But back to normal now. 🙂

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement