cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
574 stars 7 forks source link

"Load File in REPL" gives IndexOutOfBounds #2896

Open MrGung opened 2 months ago

MrGung commented 2 months ago

I am running Cursive 1.32.2-eap7 with IntelliJ 2023.3.5 and babashka 1.3.188.

Beginning some version ago loading a namespace stopped, resulting in

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
    at java.base/java.util.Objects.checkIndex(Objects.java:361)
    at java.base/java.util.ArrayList.get(ArrayList.java:427)
    at cursive.deps.DepsSettings.getDepsCljVersion(DepsSettings.kt:77)
    at cursive.babashka.BabashkaFacetEditorTab$Companion$downloadBabashkaVersions$1$1.run(Babashka.kt:474)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:434)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:132)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:484)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:248)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:73)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:192)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:609)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:179)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:73)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:248)
    at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:498)
    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:840)

I am behind a corporate firewall that totally blocks internet traffic.

Any ideas on the cause or a workaround?

cursive-ide commented 1 month ago

I can't see any reason why this should happen, no. I'll try to reproduce this to see if I can figure it out.

MrGung commented 2 weeks ago

Still - using 1.13.3-2023.3 (after downgrading because of https://github.com/cursive-ide/cursive/issues/2909) with IntelliJ 2023.3.5 with bb 1.3.190 on Windows 11 behind firewall.

MrGung commented 2 weeks ago

Maybe it is trying to $downloadBabashkaVersions$ by trying to access the internet - which fails because of the firewall I am sitting behind?

May there be a workaround?

MrGung commented 2 weeks ago

Seems to be related to https://clojurians.slack.com/archives/C0744GXCJ/p1707295741451529?thread_ts=1707156070.708269&cid=C0744GXCJ