Atwix / phpstorm-plugin-feedback

6 stars 0 forks source link

[Bug] com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: PSI and index do not match. #80

Closed quterorta closed 1 month ago

quterorta commented 1 month ago

Describe the bug (*)

Please, describe as much as possible about of what the bug is. It will help to solve this issue faster.

StackTrace from IDE

Unhandled exception in [StandaloneCoroutine{Cancelling}@1707f35d, Dispatchers.Default]

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: PSI and index do not match.
Please report the problem to JetBrains with the files attached
 file=PHP file, file.class=class com.jetbrains.php.lang.psi.PhpFileImpl, file.lang=Language: PHP, modStamp=1
 tree consistent
 stub debugInfo=created in getStubTree(), with AST = false; with backReference
 viewProvider=com.jetbrains.php.lang.PhpFileViewProvider{vFile=file:////wsl.localhost/Ubuntu/home/quterorta/Sites/moto/generated/code/Magento/MessageQueue/Console/StartConsumerCommand/Proxy.php, vFileId=560723, content=VirtualFileContent{size=0}, eventSystemEnabled=true}
 viewProvider stamp: 664; file stamp: 664; file modCount: 1715952474648; file length: 0
 doc saved: true; doc stamp: 664; doc size: 0; committed: true
indexing info: indexing timestamp = 1715952474648, binary = false, byte size = 7384, char size = 7384
ref: 50cf572587cf
latestIndexedStub=null
    at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.doCreateCompleteException(StubTreeLoader.java:203)
    at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.lambda$createCompleteException$0(StubTreeLoader.java:178)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:57)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277)
    at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.createCompleteException(StubTreeLoader.java:177)
    at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:227)
    at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:733)
    at com.intellij.extapi.psi.StubBasedPsiElementBase.getNode(StubBasedPsiElementBase.java:126)
    at com.intellij.extapi.psi.ASTDelegatePsiElement.getFirstChild(ASTDelegatePsiElement.java:87)
    at com.intellij.psi.PsiWalkingState$PsiTreeGuide.getFirstChild(PsiWalkingState.java:32)
    at com.intellij.psi.PsiWalkingState$PsiTreeGuide.getFirstChild(PsiWalkingState.java:14)
    at com.intellij.util.WalkingState.next(WalkingState.java:70)
    at com.intellij.util.WalkingState.walkChildren(WalkingState.java:49)
    at com.intellij.util.WalkingState.elementStarted(WalkingState.java:40)
    at com.intellij.psi.PsiWalkingState.elementStarted(PsiWalkingState.java:62)
    at com.intellij.psi.PsiRecursiveElementWalkingVisitor.visitElement(PsiRecursiveElementWalkingVisitor.java:34)
    at com.intellij.psi.util.PsiTreeUtil$4.visitElement(PsiTreeUtil.java:939)
    at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:270)
    at com.jetbrains.php.lang.psi.elements.impl.PhpPsiElementImpl.accept(PhpPsiElementImpl.java:120)
    at com.intellij.psi.util.PsiTreeUtil.processElements(PsiTreeUtil.java:935)
    at com.intellij.psi.util.PsiTreeUtil.findChildrenOfAnyType(PsiTreeUtil.java:313)
    at com.intellij.psi.util.PsiTreeUtil.findChildrenOfType(PsiTreeUtil.java:278)
    at com.atwix.magento.feature.cli.parser.CliCommandParser.parse(CliCommandParser.kt:29)
    at com.atwix.magento.feature.cli.parser.CliCommandParser.parse(CliCommandParser.kt:25)
    at com.atwix.magento.feature.cli.index.CliCommandIndexProvider.parseCliCommands(CliCommandIndexProvider.kt:69)
    at com.atwix.magento.feature.cli.index.CliCommandIndexProvider$refreshCliCommandsCache$1.invokeSuspend$lambda$0(CliCommandIndexProvider.kt:50)
    at com.intellij.openapi.application.impl.RwLockHolder.runReadAction(RwLockHolder.kt:289)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:850)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:65)
    at com.atwix.magento.feature.cli.index.CliCommandIndexProvider$refreshCliCommandsCache$1.invokeSuspend(CliCommandIndexProvider.kt:50)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@1707f35d, Dispatchers.Default]
Caused by: java.lang.AssertionError: Stub count doesn't match stubbed node length
    at com.intellij.psi.impl.source.FileTrees.lambda$reconcilePsi$4(FileTrees.java:182)
    at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:548)
    at com.intellij.psi.impl.source.FileTrees.reconcilePsi(FileTrees.java:175)
    at com.intellij.psi.impl.source.FileTrees.withAst(FileTrees.java:141)
    at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:213)
    ... 30 more

To Reproduce (*)

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

If applicable, add screenshots to help explain your problem.

System information:

bohdan-harniuk commented 1 month ago

Hello @quterorta,

The reported problem is related to PHPStorm's native indexes.

We recommend performing a cache invalidation in PHPStorm as a preliminary step to resolve this issue. This process typically resolves transient issues like the one reported, which can occur sporadically due to various factors, such as unexpected shutdowns or other external influences.

As this concern seems to be associated with PHPStorm's native behaviour and does not directly pertain to our plugin, we're marking this matter as closed. However, if after attempting cache invalidation, the issue persists or if you require further assistance related to our plugin, please feel free to reopen this issue, and we'll be glad to assist you further.

Best regards,