Describe the bug
It's pretty hard to tell what the bug is really about since regarding the UX there seems to be no effect apart from triggering a pycharm exception. My guess would be that the effect on the user is some kind of slowdown of the autocomplete but I'm not that sure.
To Reproduce
Steps to reproduce the behavior:
I couldn't tell for sure how it happens, all I can say is that it happens roughly once a day when I code (roughly 8h/day). Once it happens once, I haven't found it to happen on top of its previous appearance though. I feel like it appears when I'm trying to autocomplete BaseModel methods/attributes and when I delete what I wrote and write it again (then this red box appears on the screen and the autocomplete wears off for a moment).
Environments (please complete the following information):
StackTrace
Add any other context about the problem here.
Outdated stub in index: file:///home/matthias/Projects/inferframework/distilbert/lib/python3.8/site-packages/ptah/text_classifier/dataset.py indexing timestamp = 1700846398233, binary = false, byte size = 11004, char size = 11004, doc=DocumentImpl[file:///home/matthias/Projects/inferframework/distilbert/lib/python3.8/site-packages/ptah/text_classifier/dataset.py], docSaved=true, wasIndexedAlready=true, queried at 1700846398233
doc length=0
file length=0
cached PSI class com.jetbrains.python.psi.impl.PyFileImpl
PSI length=0
projects with file: 1
physical file doesn't exist; length = /home/matthias/Projects/inferframework/distilbert/lib/python3.8/site-packages/ptah/text_classifier/dataset.py
java.lang.Exception
at com.intellij.psi.stubs.StubTreeLoaderImpl.diagnoseLengthMismatch(StubTreeLoaderImpl.java:189)
at com.intellij.psi.stubs.StubTreeLoaderImpl.checkLengthMatch(StubTreeLoaderImpl.java:155)
at com.intellij.psi.stubs.StubTreeLoaderImpl.readFromVFile(StubTreeLoaderImpl.java:122)
at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.doCreateCompleteException(StubTreeLoader.java:184)
at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.lambda$createCompleteException$0(StubTreeLoader.java:178)
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.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230)
at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.createCompleteException(StubTreeLoader.java:177)
at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:228)
at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:727)
at com.intellij.extapi.psi.StubBasedPsiElementBase.getNode(StubBasedPsiElementBase.java:127)
at com.intellij.extapi.psi.ASTDelegatePsiElement.getFirstChild(ASTDelegatePsiElement.java:84)
at com.intellij.psi.util.PsiTreeUtil.getChildOfType(PsiTreeUtil.java:332)
at com.jetbrains.python.psi.impl.PyClassImpl.getSuperClassExpressionList(PyClassImpl.java:154)
at com.jetbrains.python.psi.impl.PyClassImpl.getSuperClassExpressions(PyClassImpl.java:163)
at com.koxudaxi.pydantic.PydanticKt.getConfig(Pydantic.kt:526)
at com.koxudaxi.pydantic.PydanticKt.getConfig$default(Pydantic.kt:472)
at com.koxudaxi.pydantic.PydanticTypeProvider.getPydanticTypeForClass(PydanticTypeProvider.kt:499)
at com.koxudaxi.pydantic.PydanticTypeProvider.getReferenceType(PydanticTypeProvider.kt:45)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getReferenceTypeFromProviders(PyReferenceExpressionImpl.java:525)
at com.jetbrains.python.psi.impl.PyCallExpressionHelper.getCalleeType(PyCallExpressionHelper.java:126)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getCallableType(PyReferenceExpressionImpl.java:248)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getType(PyReferenceExpressionImpl.java:236)
at com.jetbrains.python.psi.types.TypeEvalContext.lambda$getType$0(TypeEvalContext.java:181)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65)
at com.jetbrains.python.psi.types.TypeEvalContext.getType(TypeEvalContext.java:170)
at com.jetbrains.python.psi.impl.PyCallExpressionHelper.getExplicitResolveResults(PyCallExpressionHelper.java:220)
at com.jetbrains.python.psi.impl.PyCallExpressionHelper.lambda$multiResolveCallee$1(PyCallExpressionHelper.java:192)
at com.jetbrains.python.psi.PyUtil.getNullableParameterizedCachedValue(PyUtil.java:670)
at com.jetbrains.python.psi.PyUtil.getParameterizedCachedValue(PyUtil.java:648)
at com.jetbrains.python.psi.impl.PyCallExpressionHelper.multiResolveCallee(PyCallExpressionHelper.java:188)
at com.jetbrains.python.psi.impl.PyCallExpressionImpl.multiResolveCallee(PyCallExpressionImpl.java:47)
at com.jetbrains.python.psi.PyCallExpression.multiResolveCalleeFunction(PyCallExpression.java:135)
at com.koxudaxi.pydantic.PydanticTypeProvider.getPydanticDynamicModelTypeForTargetExpression(PydanticTypeProvider.kt:287)
at com.koxudaxi.pydantic.PydanticTypeProvider.getPydanticDynamicModelTypeForTargetExpression(PydanticTypeProvider.kt:278)
at com.koxudaxi.pydantic.PydanticTypeProvider.getReferenceType(PydanticTypeProvider.kt:66)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getReferenceTypeFromProviders(PyReferenceExpressionImpl.java:525)
at com.jetbrains.python.psi.impl.PyTargetExpressionImpl.getType(PyTargetExpressionImpl.java:128)
at com.jetbrains.python.psi.types.TypeEvalContext.lambda$getType$0(TypeEvalContext.java:181)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65)
at com.jetbrains.python.psi.types.TypeEvalContext.getType(TypeEvalContext.java:170)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
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.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at one.util.streamex.AbstractStreamEx.toArray(AbstractStreamEx.java:390)
at com.jetbrains.python.psi.resolve.PyResolveUtil.doResolveQualifiedNameInScope(PyResolveUtil.java:301)
at com.jetbrains.python.psi.resolve.PyResolveUtil.lambda$resolveQualifiedNameInScope$4(PyResolveUtil.java:231)
at com.jetbrains.python.psi.PyUtil.getNullableParameterizedCachedValue(PyUtil.java:670)
at com.jetbrains.python.psi.PyUtil.getParameterizedCachedValue(PyUtil.java:648)
at com.jetbrains.python.psi.resolve.PyResolveUtil.resolveQualifiedNameInScope(PyResolveUtil.java:230)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.isCallOfNoReturnFunction(PyControlFlowBuilder.java:1027)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.visitPyCallExpression(PyControlFlowBuilder.java:140)
at com.jetbrains.python.psi.impl.PyCallExpressionImpl.acceptPyVisitor(PyCallExpressionImpl.java:27)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:61)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.visitPyReferenceExpression(PyControlFlowBuilder.java:171)
at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.acceptPyVisitor(PyReferenceExpressionImpl.java:86)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:61)
at com.intellij.psi.impl.PsiElementBase.acceptChildren(PsiElementBase.java:59)
at com.jetbrains.python.psi.PyRecursiveElementVisitor.visitElement(PyRecursiveElementVisitor.java:12)
at com.jetbrains.python.psi.PyElementVisitor.visitPyElement(PyElementVisitor.java:26)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.visitPyElement(PyControlFlowBuilder.java:133)
at com.jetbrains.python.psi.PyElementVisitor.visitPyExpression(PyElementVisitor.java:174)
at com.jetbrains.python.psi.PyElementVisitor.visitPyCallExpression(PyElementVisitor.java:38)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.visitPyCallExpression(PyControlFlowBuilder.java:148)
at com.jetbrains.python.psi.impl.PyCallExpressionImpl.acceptPyVisitor(PyCallExpressionImpl.java:27)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:61)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.visitPyReturnStatement(PyControlFlowBuilder.java:715)
at com.jetbrains.python.psi.impl.PyReturnStatementImpl.acceptPyVisitor(PyReturnStatementImpl.java:19)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:61)
at com.intellij.psi.impl.PsiElementBase.acceptChildren(PsiElementBase.java:59)
at com.jetbrains.python.psi.PyRecursiveElementVisitor.visitElement(PyRecursiveElementVisitor.java:12)
at com.jetbrains.python.psi.PyElementVisitor.visitPyElement(PyElementVisitor.java:26)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.visitPyElement(PyControlFlowBuilder.java:133)
at com.jetbrains.python.psi.PyElementVisitor.visitPyStatementList(PyElementVisitor.java:198)
at com.jetbrains.python.psi.impl.PyStatementListImpl.acceptPyVisitor(PyStatementListImpl.java:23)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:61)
at com.intellij.psi.impl.PsiElementBase.acceptChildren(PsiElementBase.java:59)
at com.intellij.codeInsight.controlflow.ControlFlowBuilder.visitFor(ControlFlowBuilder.java:276)
at com.intellij.codeInsight.controlflow.ControlFlowBuilder.build(ControlFlowBuilder.java:269)
at com.jetbrains.python.codeInsight.controlflow.PyControlFlowBuilder.buildControlFlow(PyControlFlowBuilder.java:53)
at com.jetbrains.python.codeInsight.controlflow.ControlFlowCache.getControlFlow(ControlFlowCache.java:47)
at com.jetbrains.python.codeInsight.controlflow.ControlFlowCache.getControlFlow(ControlFlowCache.java:55)
at com.jetbrains.python.refactoring.PyDefUseUtil.getLatestDefs(PyDefUseUtil.java:46)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl.getLatestDefinitions(PyReferenceImpl.java:355)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl.getResultsFromProcessor(PyReferenceImpl.java:251)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl.resolveInner(PyReferenceImpl.java:229)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl.multiResolveInner(PyReferenceImpl.java:107)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl$CachingResolver.resolve(PyReferenceImpl.java:809)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl$CachingResolver.resolve(PyReferenceImpl.java:804)
at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$1(ResolveCache.java:159)
at com.intellij.openapi.util.Computable.get(Computable.java:16)
at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$4(ResolveCache.java:234)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:212)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:158)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:145)
at com.jetbrains.python.psi.impl.references.PyReferenceImpl.multiResolve(PyReferenceImpl.java:94)
at com.jetbrains.python.psi.PyUtil.multiResolveTopPriority(PyUtil.java:511)
at com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.tryResolvingWithAliases(PyTypingTypeProvider.java:1641)
at com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.tryResolving(PyTypingTypeProvider.java:1630)
at com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider.resolveToQualifiedNames(PyTypingTypeProvider.java:1695)
at com.jetbrains.python.codeInsight.typing.PyTypingAnnotationInjector.isTypingLiteralArgument(PyTypingAnnotationInjector.java:112)
at com.jetbrains.python.codeInsight.typing.PyTypingAnnotationInjector.getInjectedLanguage(PyTypingAnnotationInjector.java:56)
at com.jetbrains.python.codeInsight.PyInjectorBase.registerInjection(PyInjectorBase.java:43)
at com.jetbrains.python.codeInsight.typing.PyTypingAnnotationInjector.registerInjection(PyTypingAnnotationInjector.java:40)
at com.jetbrains.python.codeInsight.PyInjectorBase.getLanguagesToInject(PyInjectorBase.java:30)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:495)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUpInner(InjectedLanguageUtilBase.java:238)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.lambda$probeElementsUp$0(InjectedLanguageUtilBase.java:218)
at com.intellij.openapi.application.impl.ReadActionCacheImpl$allowInWriteAction$1.invoke(ReadActionCacheImpl.kt:42)
at com.intellij.openapi.application.impl.ReadActionCacheImpl$allowInWriteAction$1.invoke(ReadActionCacheImpl.kt:42)
at com.intellij.openapi.application.impl.ReadActionCacheImpl.allowInWriteAction(ReadActionCacheImpl.kt:30)
at com.intellij.openapi.application.impl.ReadActionCacheImpl.allowInWriteAction(ReadActionCacheImpl.kt:42)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUp(InjectedLanguageUtilBase.java:217)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:159)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:129)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerate(InjectedLanguageManagerImpl.java:371)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.getInjectedPsiFiles(InjectedLanguageManagerImpl.java:509)
at com.jetbrains.python.spellchecker.PythonSpellcheckerStrategy.getTokenizer(PythonSpellcheckerStrategy.java:83)
at com.intellij.spellchecker.inspections.SpellCheckingInspection.tokenize(SpellCheckingInspection.java:134)
at com.intellij.spellchecker.inspections.SpellCheckingInspection$1.visitElement(SpellCheckingInspection.java:117)
at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:270)
at com.jetbrains.python.psi.impl.PyBaseElementImpl.accept(PyBaseElementImpl.java:64)
at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$10(InspectionRunner.java:334)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$11(InspectionRunner.java:342)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:201)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:207)
at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$12(InspectionRunner.java:348)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:159)
at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:151)
at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$13(InspectionRunner.java:311)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:130)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:119)
at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$14(InspectionRunner.java:311)
at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.lambda$call$0(JobLauncherImpl.java:314)
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:61)
at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:299)
at com.intellij.concurrency.JobLauncherImpl$1MyProcessQueueTask.call(JobLauncherImpl.java:285)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1428)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too