Atwix / phpstorm-plugin-feedback

6 stars 0 forks source link

[Bug] java.lang.Exception #14

Closed ghost closed 10 months ago

ghost commented 1 year 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

Outdated stub in index: file:////wsl$/Ubuntu-22.04/home/omnipro/Sites/oms-lab/generated/code/Magento/Checkout/Model/Session/Interceptor.php indexing timestamp = 1677696831279, binary = false, byte size = 12084, char size = 12084, doc=DocumentImpl[file:////wsl$/Ubuntu-22.04/home/omnipro/Sites/oms-lab/generated/code/Magento/Checkout/Model/Session/Interceptor.php], docSaved=true, wasIndexedAlready=true, queried at 1677696831279
doc length=2347
file length=2347
cached PSI class com.jetbrains.php.lang.psi.PhpFileImpl
PSI length=2347
projects with file: 1
physical file exists; length = 2347

java.lang.Exception
    at com.intellij.psi.stubs.StubTreeLoaderImpl.diagnoseLengthMismatch(StubTreeLoaderImpl.java:191)
    at com.intellij.psi.stubs.StubTreeLoaderImpl.checkLengthMatch(StubTreeLoaderImpl.java:157)
    at com.intellij.psi.stubs.StubTreeLoaderImpl.readFromVFile(StubTreeLoaderImpl.java:124)
    at com.intellij.psi.stubs.StubTreeLoaderImpl.readOrBuild(StubTreeLoaderImpl.java:49)
    at com.intellij.psi.impl.source.PsiFileImpl.getStubTree(PsiFileImpl.java:634)
    at com.intellij.psi.impl.source.PsiFileImpl.getGreenStubTree(PsiFileImpl.java:956)
    at com.intellij.psi.impl.source.PsiFileImpl.getStubbedSpine(PsiFileImpl.java:255)
    at com.intellij.psi.stubs.StubProcessingHelperBase.lambda$getAllSpines$0(StubProcessingHelperBase.java:85)
    at com.intellij.util.containers.ContainerUtil.map(ContainerUtil.java:1798)
    at com.intellij.psi.stubs.StubProcessingHelperBase.getAllSpines(StubProcessingHelperBase.java:85)
    at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:65)
    at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$4(StubIndexEx.java:148)
    at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:212)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:103)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:91)
    at com.jetbrains.php.PhpIndexImpl.getElements(PhpIndexImpl.java:639)
    at com.jetbrains.php.PhpIndexImpl.getDirectSubclassesInner(PhpIndexImpl.java:676)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740)
    at com.jetbrains.php.PhpIndexImpl.getDirectSubclasses(PhpIndexImpl.java:672)
    at com.jetbrains.php.PhpIndexImpl.fillAllSubclasses(PhpIndexImpl.java:694)
    at com.jetbrains.php.PhpIndexImpl.fillAllSubclasses(PhpIndexImpl.java:696)
    at com.jetbrains.php.PhpIndexImpl.fillAllSubclasses(PhpIndexImpl.java:696)
    at com.jetbrains.php.PhpIndexImpl.getAllSubclasses(PhpIndexImpl.java:688)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.subClasses(MemberReferenceImpl.java:306)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.lambda$subclasses$9(MemberReferenceImpl.java:302)
    at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
    at java.base/java.util.Collections$2.tryAdvance(Collections.java:4853)
    at java.base/java.util.Collections$2.forEachRemaining(Collections.java:4861)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
    at one.util.streamex.AbstractStreamEx.forEach(AbstractStreamEx.java:360)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.withSuperClasses(MemberReferenceImpl.java:289)
    at com.jetbrains.php.lang.psi.elements.impl.MemberReferenceImpl.lookInSubclasses(MemberReferenceImpl.java:279)
    at com.jetbrains.php.lang.psi.elements.impl.PhpBaseMemberReference.resolveGlobalDescriptors(PhpBaseMemberReference.java:68)
    at com.jetbrains.php.lang.psi.elements.impl.MethodReferenceImpl.resolveGlobalDescriptors(MethodReferenceImpl.java:104)
    at com.jetbrains.php.lang.psi.elements.impl.PhpBaseMemberReference.multiResolve(PhpBaseMemberReference.java:83)
    at com.jetbrains.php.lang.psi.elements.impl.PhpReferenceImpl.lambda$getResolver$2(PhpReferenceImpl.java:160)
    at com.intellij.psi.impl.source.resolve.ResolveCache$PolyVariantResolver.resolve(ResolveCache.java:69)
    at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$1(ResolveCache.java:161)
    at com.intellij.openapi.util.Computable.get(Computable.java:16)
    at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$4(ResolveCache.java:237)
    at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:112)
    at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:42)
    at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:66)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:214)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:160)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:147)
    at com.j

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 year ago

Hello, @leoner-omnipro ! Thank you for your report! Could you please provide full stack trace of this bug and describe steps to reproduce? Thank you!

bohdan-harniuk commented 1 year ago

Hello, @leoner-omnipro !

Could you please give updates here?

ghost commented 1 year ago

Hey @bohdan-harniuk! I can't give more details aboout this issue because I'm not sure how it happened, I just was using normally the IDE when error appeared. I just did the report with the "Report and close" option and the trace was what the option completed. Sorry if this can't be of much help.

bohdan-harniuk commented 1 year ago

As I can see, manual reindex can help with solving this issue. To be sure about it, I need to see full stack trace. Let's leave this issue opened for a month. If you will face this issue again, please, update stack trace here instead of opening new issue. If not, I'll close this issue. What do you think?

ghost commented 1 year ago

Sure, it sounds good for me.

ghost commented 1 year ago

Hey @bohdan-harniuk! The issue happened again, here the log copied by PHPStorm

Outdated stub in index: file:////wsl$/Ubuntu-22.04/home/omnipro/Sites/oms-lab/app/code/Oms/OrderSync/Controller/Adminhtml/OrderSyncReport.php indexing timestamp = 1679931130608, binary = false, byte size = 1518, char size = 1518, doc=DocumentImpl[file:////wsl$/Ubuntu-22.04/home/omnipro/Sites/oms-lab/app/code/Oms/OrderSync/Controller/Adminhtml/OrderSyncReport.php], docSaved=false, wasIndexedAlready=true, queried at 1679931130608
doc length=1519
file length=1518
cached PSI class com.jetbrains.php.lang.psi.PhpFileImpl
projects with file: 1
physical file exists; length = 1518

java.lang.Exception
    at com.intellij.psi.stubs.StubTreeLoaderImpl.diagnoseLengthMismatch(StubTreeLoaderImpl.java:191)
    at com.intellij.psi.stubs.StubTreeLoaderImpl.checkLengthMatch(StubTreeLoaderImpl.java:157)
    at com.intellij.psi.stubs.StubTreeLoaderImpl.readFromVFile(StubTreeLoaderImpl.java:124)
    at com.intellij.psi.stubs.StubTreeLoaderImpl.readOrBuild(StubTreeLoaderImpl.java:49)
    at com.intellij.psi.impl.source.PsiFileImpl.getStubTree(PsiFileImpl.java:634)
    at com.intellij.psi.impl.source.PsiFileImpl.getGreenStubTree(PsiFileImpl.java:956)
    at com.intellij.psi.impl.source.PsiFileImpl.getGreenStub(PsiFileImpl.java:611)
    at com.jetbrains.php.lang.psi.PhpPsiUtil.findClasses(PhpPsiUtil.java:566)
    at com.jetbrains.php.lang.psi.PhpPsiUtil.findAllClasses(PhpPsiUtil.java:602)
    at com.atwix.magento.lang.php.util.PhpClassReaderUtil.getFirstClassOfFile(PhpClassReaderUtil.kt:32)
    at com.atwix.magento.framework.test.MagentoTestSourceVerifier.isTestSource(MagentoTestSourceVerifier.java:118)
    at com.atwix.magento.framework.test.MagentoTestSourceVerifier.isTestSource(MagentoTestSourceVerifier.java:111)
    at com.atwix.magento.project.configurator.MagentoTestSourceFilterService.isTestSource(MagentoTestSourceFilterService.java:33)
    at com.intellij.openapi.roots.TestSourcesFilter.isTestSources(TestSourcesFilter.java:31)
    at com.intellij.psi.search.scope.TestsScope$1.contains(TestsScope.java:25)
    at com.intellij.psi.search.scope.packageSet.FilteredPackageSet.contains(FilteredPackageSet.java:22)
    at com.intellij.ui.tabs.FileColorsModel.findConfiguration(FileColorsModel.java:239)
    at com.intellij.ui.tabs.FileColorsModel.getColor(FileColorsModel.java:210)
    at com.intellij.ui.tabs.FileColorManagerImpl.getFileColor(FileColorManagerImpl.java:167)
    at com.intellij.ui.tabs.EditorTabColorProviderImpl.getProjectViewColor(EditorTabColorProviderImpl.java:41)
    at com.intellij.openapi.fileEditor.impl.EditorTabPresentationUtil.getFileBackgroundColor(EditorTabPresentationUtil.java:66)
    at com.intellij.openapi.vfs.newvfs.VfsPresentationUtil.getFileBackgroundColor(VfsPresentationUtil.java:48)
    at com.intellij.presentation.impl.FilePresentationServiceImpl.getFileBackgroundColor(FilePresentationServiceImpl.kt:22)
    at com.intellij.presentation.impl.FilePresentationServiceImpl.getFileBackgroundColor(FilePresentationServiceImpl.kt:31)
    at com.intellij.ide.util.treeView.AbstractTreeNode.computeBackgroundColor(AbstractTreeNode.java:278)
    at com.intellij.ide.projectView.ProjectViewNode.computeBackgroundColor(ProjectViewNode.java:294)
    at com.intellij.ide.util.treeView.PresentableNodeDescriptor.getUpdatedPresentation(PresentableNodeDescriptor.java:77)
    at com.intellij.ide.util.treeView.PresentableNodeDescriptor.update(PresentableNodeDescriptor.java:30)
    at com.intellij.ui.tree.StructureTreeModel$Node.update(StructureTreeModel.java:487)
    at com.intellij.ui.tree.StructureTreeModel$Node.<init>(StructureTreeModel.java:468)
    at com.intellij.ui.tree.StructureTreeModel$Node.<init>(StructureTreeModel.java:461)
    at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:419)
    at com.intellij.ui.tree.StructureTreeModel.validateChildren(StructureTreeModel.java:330)
    at com.intellij.ui.tree.StructureTreeModel.getNode(StructureTreeModel.java:324)
    at com.intellij.ui.tree.StructureTreeModel.getChildren(StructureTreeModel.java:344)
    at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:548)
    at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:443)
    at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:409)
    at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:305)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:71)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:128)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:109)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:68)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(Core
bohdan-harniuk commented 1 year ago

Hello, @leoner-omnipro!

I'll check provided stack trace. From the first sight they are different. But both should be resolved for sure.

Thank you,

bohdan-harniuk commented 10 months ago

Hi, @leoner-omnipro!

I apologize for the delayed response. We attempted to reproduce the issue multiple times, but without success. After some time, we sought assistance from the JetBrains (PHP-related) team. It turned out that this issue is connected to PHPStorm's native functionality and shouldn't impact anything critically important. Invalidate caches should always resolve it: https://www.jetbrains.com/help/phpstorm/invalidate-caches.html

Please, reopen this issue if you need more help here. Regards,