Strange index corruption

I'm getting strange behavior where .p files associated to YAML files through out plugin (via FileTypeFactory extension) occasionally end up in Python indices. This doesn't seem to happen in a clean rebuilt of the caches/indices but it somehow gets in this state over time.  The version of the platform is 2017.2

 

Any possible explanation for this?

 

 

unable to get stub builder for org.jetbrains.yaml.YAMLFileType@21e5a22, path = C:/Muni/UAT/procs/uat/cpm/cfdcm/informloader_tiger_cfdcm_uat.p, stubBindingRoot = YAMLFileImpl, languages = [yaml], fileTypes = [YAML], files = [YAMLFileImpl], roots = []

java.lang.Throwable

                at com.intellij.openapi.diagnostic.Logger.error(Logger.java:132)

                at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:82)

                at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:53)

                at com.intellij.psi.stubs.StubIndexImpl$2.process(StubIndexImpl.java:331)

                at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:617)

                at com.intellij.psi.stubs.StubIndexImpl$StubIdListContainerAction.perform(StubIndexImpl.java:605)

                at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:62)

                at com.intellij.psi.stubs.StubIndexImpl.doProcessStubs(StubIndexImpl.java:360)

                at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:323)

                at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:145)

                at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:134)

                at com.jetbrains.python.psi.stubs.PyClassNameIndex.find(PyClassNameIndex.java:45)

                at com.jetbrains.python.psi.stubs.PyClassNameIndex.findClass(PyClassNameIndex.java:64)

                at com.jetbrains.python.psi.stubs.PyClassNameIndex.findClass(PyClassNameIndex.java:81)

                at com.jetbrains.python.psi.impl.PyPsiFacadeImpl.findClass(PyPsiFacadeImpl.java:59)

                at com.jetbrains.python.codeInsight.PyPsiPath$ToClassQName.resolve(PyPsiPath.java:57)

                at com.jetbrains.python.codeInsight.PyCustomMember.findResolveTarget(PyCustomMember.java:217)

                at com.jetbrains.python.codeInsight.PyCustomMember.resolve(PyCustomMember.java:201)

                .....

0
2 comments

Hello,
I am hunting for the problem quite for some time.
Could you please report  that after cache invalidation and up to the problem appeared you didn't have IDE crashes.
Please also share if IDE was used with the several projects in the same time and project was closed during VCS update.

I filed issue https://youtrack.jetbrains.com/issue/IDEA-181227 for detailed issue description / evaluation / tracking the progress.

0

I've seen a problem similar to this with Cursive, but unfortunately it's very sporadic and I couldn't really say much about the process leading up to it. I'll pay attention to those two cases and see if I see the problem after they occur. I nearly always have multiple projects open at the same time. I have seen this issue when debugging in the plugin sandbox, and in that case there was probably no VCS involved at all since I don't tend to check my test projects in anywhere.

In Cursive, I use file based indexes and often store offsets or text ranges in the index. I get a lot of issues in my tracker when trying to use those offsets saying that I'm accessing content outside the document range. When I've managed to reproduce the issue myself, it's nearly always because the virtual file returned by the index access is a non-Clojure file such as a properties file or a Jar manifest or something. I nearly always retrieve index values with FileBasedIndex.processValues().

If I get my test system in a state where I can debug it again I'll ping you to see if there's more information I can collect.

0

Please sign in to leave a comment.