Stub generation failing

101 views
Skip to first unread message

Matt Bossenbroek

unread,
Jun 24, 2021, 11:55:10 AM6/24/21
to cur...@googlegroups.com
The datomic stub generation has been failing for a while for me now. Feels like if I click the button enough times it'll work, but then the next day they're gone again. I've submitted some of the errors from my IDE; is this something you're aware of / tracking / need any help with repro?

Thanks,
Matt

Colin Fleming

unread,
Jun 24, 2021, 6:53:15 PM6/24/21
to Cursive Group
Hi Matt,

What do the errors look like? I just had a look through the tracker but couldn't see anything immediately obvious related to the stubs.

Cheers,
Colin
--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.

Matt Bossenbroek

unread,
Jun 25, 2021, 12:13:43 PM6/25/21
to cur...@googlegroups.com
I've got 3 different ones for you...

Thanks,
Matt

com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67)
at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:779)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:731)
at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:237)
at com.intellij.util.indexing.FileBasedIndexEx.processValueIterator(FileBasedIndexEx.java:342)
at com.intellij.util.indexing.FileBasedIndexEx.processValuesInScope(FileBasedIndexEx.java:311)
at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:216)
at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:204)
at cursive.index$namespaces.invokeStatic(index.clj:447)
at cursive.index$namespaces.invoke(index.clj:439)
at cursive.index$namespaces.invokeStatic(index.clj:442)
at cursive.index$namespaces.invoke(index.clj:439)
at cursive.namespace$namespaces_by_name.invokeStatic(namespace.clj:230)
at cursive.namespace$namespaces_by_name.invoke(namespace.clj:224)
at cursive.stubs$stub_file_name$reify__15674.compute(stubs.clj:68)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:834)
at cursive.stubs$stub_file_name.invokeStatic(stubs.clj:67)
at cursive.stubs$stub_file_name.invoke(stubs.clj:57)
at cursive.stubs$clj_namespace_form.invokeStatic(stubs.clj:98)
at cursive.stubs$clj_namespace_form.invoke(stubs.clj:97)
at cursive.stubs$generate_stubs$fn__15726$process__15727$fn__15731.invoke(stubs.clj:265)
at clojure.core$keep$fn__8584.invoke(core.clj:7346)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:615)
at clojure.core$seq__5420.invokeStatic(core.clj:139)
at clojure.core$map$fn__5885.invoke(core.clj:2750)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.LazySeq.first(LazySeq.java:73)
at clojure.lang.RT.first(RT.java:772)
at clojure.core$first__5402.invokeStatic(core.clj:55)
at clojure.string$join.invokeStatic(string.clj:180)
at clojure.string$join.invoke(string.clj:180)
at cursive.stubs$generate_stubs$fn__15726$process__15727.invoke(stubs.clj:264)
at cursive.stubs$generate_stubs$fn__15726.invoke(stubs.clj:325)
at cursive.task$backgroundable$reify__15660.run(task.clj:12)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:998)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:497)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:228)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:228)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)



java.lang.Throwable: Non-idempotent computation: it returns different results when invoked multiple times or on different threads:
  class com.intellij.psi.impl.compiled.ClsMethodImpl != class cursive.psi.impl.synthetic.LightMethodBuilder
  which is class of PsiMethod:db and LightMethodBuilder:db
  which is element of cursive.psi.resolve.ClojureResolveResultImpl@2285e727 and cursive.psi.resolve.ClojureResolveResultImpl@37e58991
  which is 0th element of [cursive.psi.resolve.ClojureResolveResultImpl@2285e727, cursive.psi.resolve.ClojureResolveResultImpl@2263339] and [cursive.psi.resolve.ClojureResolveResultImpl@37e58991, cursive.psi.resolve.ClojureResolveResultImpl@64a2aab8]

Recomputation gives [Lcursive.psi.resolve.ClojureResolveResult;@629e68e7 (class [Lcursive.psi.resolve.ClojureResolveResult;) which is equivalent to 'fresh'
Recomputation log:
  Resolving cursive.psi.impl.symbols.SymbolReference@9d088506 of class cursive.psi.impl.symbols.SymbolReference
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.util.IdempotenceChecker.reportFailure(IdempotenceChecker.java:90)
at com.intellij.util.IdempotenceChecker.checkEquivalence(IdempotenceChecker.java:77)
at com.intellij.psi.impl.source.resolve.ResolveCache.cache(ResolveCache.java:322)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:249)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:154)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:169)
at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:162)
at cursive.psi.impl.symbols.SymbolReference.multiResolve(SymbolReference.java:60)
at cursive.resolve$resolve.invokeStatic(resolve.clj:54)
at cursive.resolve$resolve.invoke(resolve.clj:51)
at cursive.inspections.symbol$deprecated_api.invokeStatic(symbol.clj:198)
at cursive.inspections.symbol$deprecated_api.invoke(symbol.clj:197)
at clojure.lang.Var.invoke(Var.java:393)
at cursive.api.DelayedFn.invoke(DelayedFn.java:41)
at cursive.inspections.ClSymbolInspection$buildVisitor$1.visitSymbol(Inspections.kt:50)
at cursive.psi.impl.symbols.ClEditorSymbol.accept(ClEditorSymbol.java:161)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:346)
at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:174)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:132)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:121)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:111)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$10(LocalInspectionsPass.java:346)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:83)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:83)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)


java.lang.NullPointerException
at cursive.psi.reference.ClojureApiKotlinPsiReferenceContributor$provider$1.getReferencesByElement(ReferenceContributors.kt:117)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:201)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:164)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:143)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:43)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38)
at org.jetbrains.kotlin.idea.references.KtIdeReferenceProviderService.getReferences(KtIdeReferenceProviderService.kt:104)
at org.jetbrains.kotlin.psi.KotlinReferenceProvidersService$Companion.getReferencesFromProviders(KotlinReferenceProvidersService.kt:25)
at org.jetbrains.kotlin.psi.KotlinReferenceProvidersService.getReferencesFromProviders(KotlinReferenceProvidersService.kt)
at org.jetbrains.kotlin.psi.KtElementImplStub.getReferences(KtElementImplStub.java:125)
at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.annotate(HyperlinkAnnotator.java:45)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:136)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:116)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:335)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:268)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:294)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:297)
at org.jetbrains.kotlin.idea.highlighter.AbstractKotlinHighlightVisitor.analyze(AbstractKotlinHighlightVisitor.kt:58)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:96)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:265)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:211)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:400)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1096)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:393)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:392)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:368)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:366)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)



Colin Fleming

unread,
Jun 27, 2021, 1:57:26 AM6/27/21
to Cursive Group
Hi Matt,

Ok, the second two are actually not related to the stub generation. The second is a really hairy one that I'm not sure how to fix. I'll take a look at the third, which looks like it should be easy to fix.

The first one is a problem with the stub generation, and it's caused by trying to generate the stubs while Cursive is indexing. It should definitely handle that better so I'll fix that, in the meantime the workaround would be to wait for the indexing to finish before generating the stubs.

Cheers,
Colin

Matt Bossenbroek

unread,
Jun 27, 2021, 11:11:54 AM6/27/21
to cur...@googlegroups.com
Thanks! For the stubs, I have tried waiting & then it’ll work, but then they’re gone again the next day. Not sure what’s nuking them; maybe it’s always failing on any reindexing?



Colin Fleming

unread,
Jun 27, 2021, 6:36:50 PM6/27/21
to Cursive Group
It shouldn't do. Could you try this to help diagnose it?
  1. Go to Help | Diagnostic Tools | Debug Log Settings..., and enter #cursive.index in the box there.
  2. Ensure that the stubs are generated, and then wait for the problem to reproduce (i.e. it prompting you again for the stubs when it shouldn't need to).
  3. Generate the stubs, and then email me your log file off-list (Help | Show Log in Finder/Explorer).

Matt Bossenbroek

unread,
Jun 28, 2021, 11:42:42 AM6/28/21
to cur...@googlegroups.com
Sent. One thing I can think of is that I have the same gradle project imported into multiple intelliJ projects. Could that be the cause?

Thanks,
Matt


Colin Fleming

unread,
Jul 9, 2021, 6:22:38 AM7/9/21
to Cursive Group
Hi Matt,

Sorry for the delay, I've been looking at another problem. That wasn't very illuminating, unfortunately. Can you try doing the same but adding #cursive.stubs to the box as well?

One thing I can think of is that I have the same gradle project imported into multiple intelliJ projects. Could that be the cause?

That's possible, yeah, although I can't think of a plausible mechanism. You could try to see what's going on - the stubs are generated in your system cache directory, you can see how to find that here: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs. For example, I have one on my machine at: /Users/colin/Library/Caches/JetBrains//IntelliJIdea2021.2/cursive_stubs_5c9e52. That directory looks like this:

~> tree /Users/colin/Library/Caches/JetBrains//IntelliJIdea2021.2/cursive_stubs_5c9e52
/Users/colin/Library/Caches/JetBrains//IntelliJIdea2021.2/cursive_stubs_5c9e52
└── 2f4bae1
    └── 77a3c260.clj

You can delete those directories, and then that will require the stubs to be recreated. You can test that by opening your Lein or Deps toolwindow and refreshing the project, and that will trigger the check to test the stubs and show you the notification if required. The hex in the outer cursive_stubs directory is a hash of the location of the IntelliJ project, so you should get one independent directory per IntelliJ project. The hex in the next level is the hash of the location of the module - with that project structure, I think they should also be different for the two projects, but that might depend on how you imported the project. Then within that the hex in the file name is a hash of the canonical path of the file containing the ns the stubs are being generated for (e.g. datomic.api). By generating the stubs in the two projects you should be able to see which directory is which and whether they're being deleted at any point, and perhaps find a clue as to what's going on.

Cheers,
Colin
Reply all
Reply to author
Forward
0 new messages