Can not successfully build OST

Issue #1611 resolved
Jason Clark created an issue

After switching DX orgs and rebuilding caches, I’m stuck in state where I cannot successfully build the OST. At this point I’ve run into the endless “updating indices…” issue (https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/issues/1584/ide-locks-up-or-never-completes-indices and https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/issues/1576/updating-indices-does-not-stop), so I’ve followed the steps in those threads. Specifically, I have:

  1. File → Invalidate Caches and Restart.
  2. Tools → Illuminated Cloud → Configure Project… → Rebuild Caches and Indices
  3. This seems to get stuck at “updating indices…”, so I gave it a few minutes, and restarted IntelliJ.
  4. After the restart, Tools → Illuminated Cloud → Configure Project… still shows no OST, and features like completion and Go To Declaration do no work.

Also, idea.log is full of exceptions of the form: ERROR - tellij.psi.PsiReferenceService - IdeaLoggingEvent[message=Reference element is not the same element for which references were queried, throwable=java.lang.RuntimeException: Element: com.intellij.psi.impl.source.PsiPlainTextFileImpl; reference: com.illuminatedcloud.intellij.psi.reference.ApexDeclarationReference; reference element: com.intellij.psi.impl.source.tree.PsiPlainTextImpl

I believe my IJ and IC are latest versions:

IntelliJ IDEA 2020.1.1 (Community Edition)
Build #IC-201.7223.91, built on April 30, 2020
Runtime version: 11.0.6+8-b765.40 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.5
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Non-Bundled Plugins: String Manipulation, com.illuminatedcloud2.intellij, com.potterhsu.jsonviewer, net.seesharpsoft.intellij.plugins.csv

Comments (10)

  1. Scott Wells repo owner

    Jason, I think you're seeing the same issue in #1576 where the IDE shows as indexing when it's actually no longer doing so. Explicitly closing and reopening the project resolves the situation (until the next time it happens, of course). As noted in that issue, I have filed as case with JetBrains and they have changed that case to Fixed, but I don't think the (full?) fix has been delivered.

    If you explicitly close and reopen the project and it continues to show as indexing, or if it no longer shows as indexing and you still cannot rebuild your OST, please let me know and I'll gather diagnostic info from you.

  2. Jason Clark reporter

    @Scott Wells I think I am seeing #1576, but did close and restart, and I still see “None” under OST when I go to Tools → Illuminated Cloud → Configure Project… after the restart. I’ve tried the whole loop several times, and no OST is ever created.

  3. Scott Wells repo owner

    Okay, thanks for clarifying. And so when you explicitly tell IC to generate the OST (Illuminated Cloud>Generate Offline Symbol Table), what happens? Feel free to do that and then send me your idea.log either as an attachment here or via email and I'll take a look.

  4. Scott Wells repo owner

    Thanks. Do you mind zipping up all of the idea.log* files in that same directory and sending them to support@illuminatedcloud.com? Obviously so much noise from that one error that I can't really see what's going on around it...

  5. Jason Clark reporter

    @Scott Wells First, and most important: I have a working OST, so I will mark this as resolved, however, I think there may be a bug still present, or I just misunderstand how to force-build the OST 🙂 Two things:

    1. Your request that I rebuild the OST via Illuminated Cloud>Generate Offline Symbol Table is what fixed it for me. When I tried that, I got a popup showing me the OST being rebuilt, and then the project reloaded, and then I got the bad “indexing” message from #1576, but my OST was created and everything works again.
    2. Prior to that request, I was using Tools → Illuminated Cloud → Configure Project… → Rebuild Caches and Indices. I thought I had used that in the past to force an OST rebuild, but perhaps I’m mistaken?

    For now, I’m back up and running, but let me know if you still want all my logs. I’ll need to email them as I’m not sure if they contain any customer info. Thanks for your help.

  6. Scott Wells repo owner

    Ah, okay. No, Rebuild Caches and Indices doesn't do anything with the OST. That's a workaround for any issue around corrupt/stale IC-specific caches and indices vs. the IDE's native File>Invalidate Caches/Restart which rebuilds ALL caches/indices and even wipes out local history. What it does is the same as what happens after a full OST rebuild, but it allows you to do it in a standalone fashion.

    There is a way to rebuild the OST in Illuminated Cloud>Configure Project. Just click on a module row in the table and there's a toolbar button to regenerate the OST for that module's connection (which will do so for all other modules which share the same connection if so configured).

    Sounds like a bit of confusion around how to regenerate the OST. The good news is that this is EXACTLY what the tech writer is documenting right now, so very soon the user guide will have extensive documentation around what the OST is and how to manage it over time.

  7. Scott Wells repo owner

    I am going to look into that error message from your logs, though. I want to figure out where that bad reference is coming from and fix it. Not only is that noisy, but it of course it's also certainly going to result in a bug somewhere else because that reference wasn't computed correctly.

  8. Scott Wells repo owner

    Jason, do you know offhand what file(s) you had opened when all of those errors were logged. Because these are originating in plain text files, I'm curious what they were so that I can reproduce and fix it.

    UPDATE: Never mind. I was able to reproduce it locally.

  9. Log in to comment