Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated stub in index bug #653

Closed
matthiasmindee opened this issue Feb 22, 2023 · 4 comments
Closed

Outdated stub in index bug #653

matthiasmindee opened this issue Feb 22, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@matthiasmindee
Copy link

matthiasmindee commented Feb 22, 2023

Describe the bug

Outdated stub in index: path/to/my/project/venv/lib/python3.8/site-packages/pydantic/env_settings.py indexing timestamp = 1677054969786, binary = false, byte size = 3389, char size = 3389, doc=DocumentImpl[file:///path/to/my/project/venv/lib/python3.8/site-packages/pydantic/env_settings.py], docSaved=true, wasIndexedAlready=true, queried at 1677054969786
doc length=13892
file length=13892
cached PSI class com.jetbrains.python.psi.impl.PyFileImpl
projects with file: 1
physical file exists; length = 13892

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.StubTreeLoader.lambda$stubTreeAndIndexDoNotMatch$0(StubTreeLoader.java:66)
	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:99)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230)
	at com.intellij.psi.stubs.StubTreeLoader.stubTreeAndIndexDoNotMatch(StubTreeLoader.java:64)
	at com.intellij.psi.impl.source.FileTrees.reconcilePsi(FileTrees.java:190)
	at com.intellij.psi.impl.source.FileTrees.withAst(FileTrees.java:138)
	at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:215)
	at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:734)
	at com.intellij.extapi.psi.StubBasedPsiElementBase.getNode(StubBasedPsiElementBase.java:128)
	at com.intellij.extapi.psi.ASTDelegatePsiElement.getFirstChild(ASTDelegatePsiElement.java:99)
	at com.intellij.psi.util.PsiTreeUtil.getChildOfType(PsiTreeUtil.java:332)
	at com.jetbrains.python.psi.impl.PyClassImpl.getSuperClassExpressionList(PyClassImpl.java:148)
	at com.jetbrains.python.psi.impl.PyClassImpl.getSuperClassExpressions(PyClassImpl.java:157)
	at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.checkIfClassIsDirectTypedDictInheritor(PyTypedDictTypeProvider.kt:68)
	at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.isTypingTypedDictInheritor(PyTypedDictTypeProvider.kt:55)
	at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.getTypedDictTypeForTypingTDInheritorAsCallee(PyTypedDictTypeProvider.kt:144)
	at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.getTypedDictTypeForResolvedCallee(PyTypedDictTypeProvider.kt:108)
	at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider$Companion.access$getTypedDictTypeForResolvedCallee(PyTypedDictTypeProvider.kt:39)
	at com.jetbrains.python.codeInsight.typing.PyTypedDictTypeProvider.getReferenceType(PyTypedDictTypeProvider.kt:32)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getReferenceTypeFromProviders(PyReferenceExpressionImpl.java:530)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getGenericTypeFromTarget(PyReferenceExpressionImpl.java:427)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getTypeFromTarget(PyReferenceExpressionImpl.java:399)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getTypeFromTargets(PyReferenceExpressionImpl.java:310)
	at com.jetbrains.python.psi.impl.PyReferenceExpressionImpl.getType(PyReferenceExpressionImpl.java:229)
	at com.jetbrains.python.psi.types.TypeEvalContext.lambda$getType$0(TypeEvalContext.java:176)
	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.jetbrains.python.psi.types.TypeEvalContext.getType(TypeEvalContext.java:165)
	at com.jetbrains.python.psi.impl.PyClassImpl.fillSuperClassesSwitchingToAst(PyClassImpl.java:1377)
	at com.jetbrains.python.psi.impl.PyClassImpl.doGetSuperClassTypes(PyClassImpl.java:1361)
	at com.jetbrains.python.psi.PyUtil.getNullableParameterizedCachedValue(PyUtil.java:675)
	at com.jetbrains.python.psi.PyUtil.getParameterizedCachedValue(PyUtil.java:653)
	at com.jetbrains.python.psi.impl.PyClassImpl.getSuperClassTypes(PyClassImpl.java:1349)
	at com.jetbrains.python.psi.types.PyClassTypeImpl.getSuperClassTypes(PyClassTypeImpl.java:119)
	at com.jetbrains.python.psi.impl.PyClassImpl.mroLinearize(PyClassImpl.java:418)
	at com.jetbrains.python.psi.impl.PyClassImpl.getMROAncestorTypes(PyClassImpl.java:1646)
	at com.jetbrains.python.psi.impl.PyClassImpl.lambda$getAncestorTypesWithMetaClassInstances$10(PyClassImpl.java:1446)
	at com.jetbrains.python.psi.PyUtil.getNullableParameterizedCachedValue(PyUtil.java:675)
	at com.jetbrains.python.psi.PyUtil.getParameterizedCachedValue(PyUtil.java:653)
	at com.jetbrains.python.psi.impl.PyClassImpl.getAncestorTypesWithMetaClassInstances(PyClassImpl.java:1442)
	at com.jetbrains.python.psi.impl.PyClassImpl.getAncestorTypes(PyClassImpl.java:1437)
	at com.jetbrains.python.psi.impl.PyClassImpl.isSubclass(PyClassImpl.java:237)
	at com.koxudaxi.pydantic.PydanticKt.isSubClassOfPydanticBaseModel(Pydantic.kt:181)
	at com.koxudaxi.pydantic.PydanticKt.isPydanticModel(Pydantic.kt:162)
	at com.koxudaxi.pydantic.PydanticFieldSearchExecutor.processQuery$lambda$7(PydanticFieldSearchExecutor.kt:35)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:59)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:898)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:68)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:58)
	at com.koxudaxi.pydantic.PydanticFieldSearchExecutor.processQuery(PydanticFieldSearchExecutor.kt:30)
	at com.koxudaxi.pydantic.PydanticFieldSearchExecutor.processQuery(PydanticFieldSearchExecutor.kt:15)
	at com.intellij.openapi.application.QueryExecutorBase.execute(QueryExecutorBase.java:76)
	at com.intellij.util.ExecutorsQuery.processResults(ExecutorsQuery.java:30)
	at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:88)
	at com.intellij.util.AbstractQuery.delegateProcessResults(AbstractQuery.java:105)
	at com.intellij.util.MergeQuery.processResults(MergeQuery.java:22)
	at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:88)
	at com.intellij.util.AbstractQuery.delegateProcessResults(AbstractQuery.java:105)
	at com.intellij.util.UniqueResultsQuery.processResults(UniqueResultsQuery.java:37)
	at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:88)
	at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:80)
	at com.intellij.util.AbstractQuery.findAll(AbstractQuery.java:25)
	at com.intellij.find.findUsages.FindUsagesHandlerBase.findReferencesToHighlight(FindUsagesHandlerBase.java:114)
	at com.jetbrains.python.findUsages.PyFindUsagesHandlerFactory$1.findReferencesToHighlight(PyFindUsagesHandlerFactory.java:73)
	at com.intellij.codeInsight.highlighting.HighlightUsagesKt.getPsiUsageRanges(highlightUsages.kt:87)
	at com.intellij.codeInsight.highlighting.HighlightUsagesKt.getUsageRanges(highlightUsages.kt:58)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.lambda$highlightTargetUsages$0(IdentifierHighlighterPass.java:213)
	at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:172)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:130)
	at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:114)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.highlightTargetUsages(IdentifierHighlighterPass.java:212)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.highlightReferencesAndDeclarations(IdentifierHighlighterPass.java:188)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:91)
	at com.intellij.codeInsight.highlighting.BackgroundHighlighter.lambda$updateHighlighted$1(BackgroundHighlighter.java:155)
	at com.intellij.codeInsight.highlighting.BackgroundHighlightingUtil.lambda$lookForInjectedFileInOtherThread$0(BackgroundHighlightingUtil.java:57)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:746)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:778)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:573)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:537)
	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(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:68)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:106)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:71)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:537)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$transferToBgThread$1(NonBlockingReadActionImpl.java:444)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

Environments (please complete the following information):

  • IDE: PyCharm 2022.3.2 (Professional Edition) Build #PY-223.8617.48, built on January 24, 2023
  • OS: Ubuntu 22.04
  • Pydantic Version 1.10.4
  • Plugin version 0.3.17
@koxudaxi koxudaxi added the bug Something isn't working label Mar 2, 2023
@koxudaxi
Copy link
Owner

koxudaxi commented Mar 2, 2023

@matthiasmindee
Thank you for creating the issue.
I haven't seen the error 😅
I will check it.

@matthiasmindee
Copy link
Author

Thanks for looking into it so quickly ! Good luck !

@koxudaxi
Copy link
Owner

@matthiasmindee
I have released v0.4.2.
The version probably fixed the problem.
#682

Thank you very much.

@matthiasmindee
Copy link
Author

Great !! I'll test that out and tell you if it happens again !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants