Skip to content

Extension Sometimes Gets Into Bad State When Reloading VSCode #141

@ss108

Description

@ss108

Hello, thanks for working on this extension.

Using VSCode, sometimes one needs to use the Developer: Reload Window command to get the LSP to pick up certain changes (e.g. when a class or interface is deleted, or when something is renamed). That's no big deal, but it seems that lately, when I do this, the LSP gets into a bad state and can't restart. The only fix is to restart my computer (even totally quitting VSCode doesn't solve).

Sample of error logs below (they are voluminous, but I think this is the core part and it just gets repeated incessantly). Please let me know if you need additional info.

2026-01-20 07:59:46,580 [   1602]   INFO - #c.j.l.s.a.i.c.LSServerAnalyzerImplKt - Indices storage path: /Users/samiersaeed/Library/Application Support/JetBrains/analyzer/workspaces/3b2ca750c83df3ff6fc37ef8a209cbfe.mv.db
2026-01-20 07:59:46,620 [     32] SEVERE - #c.j.l.s.a.i.c.MVSKt - Error opening MVStore /Users/samiersaeed/Library/Application Support/JetBrains/analyzer/workspaces/3b2ca750c83df3ff6fc37ef8a209cbfe.mv.db
The file is locked: /Users/samiersaeed/Library/Application Support/JetBrains/analyzer/workspaces/3b2ca750c83df3ff6fc37ef8a209cbfe.mv.db [2.3.232/7]
org.h2.mvstore.MVStoreException: The file is locked: /Users/samiersaeed/Library/Application Support/JetBrains/analyzer/workspaces/3b2ca750c83df3ff6fc37ef8a209cbfe.mv.db [2.3.232/7]
	at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:996)
	at org.h2.mvstore.SingleFileStore.lockFileChannel(SingleFileStore.java:143)
	at org.h2.mvstore.SingleFileStore.open(SingleFileStore.java:117)
	at org.h2.mvstore.SingleFileStore.open(SingleFileStore.java:81)
	at org.h2.mvstore.MVStore.<init>(MVStore.java:286)
	at org.h2.mvstore.MVStore$Builder.open(MVStore.java:2035)
	at com.jetbrains.ls.snapshot.api.impl.core.MVSKt.tryOpenStore(MVS.kt:93)
	at com.jetbrains.ls.snapshot.api.impl.core.MVSKt.createDB(MVS.kt:39)
	at com.jetbrains.ls.snapshot.api.impl.core.LSServerAnalyzerImplKt$createServerStarterAnalyzerImpl$1$start$2$serverContext$1$withServer$2$1$2$3$1.invokeSuspend(LSServerAnalyzerImpl.kt:133)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)

[Error - 7:59:46 AM] Server initialization failed.
  Message: cancelled
  Code: -32800 
[Error - 7:59:46 AM] Kotlin LSP client: couldn't create connection to server.
  Message: cancelled
  Code: -32800 
[Error - 7:59:46 AM] Restarting server failed
  Message: cancelled
  Code: -32800 
2026-01-20 07:59:46,668 [   1046]   INFO - #fleet.kernel.Transactor - shutting down kernel Kernel@pfp1fucgis0f4af9jqm0
2026-01-20 07:59:46,676 [   1220]   INFO - #c.j.l.i.LspClient - Client disconnected from the server
[Error - 7:59:46 AM] The Kotlin LSP server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
2026-01-20 07:59:46,682 [   1226] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 2s... (error: Multiple editing sessions for one workspace are not supported yet)
2026-01-20 07:59:47,249 [   7082] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 8s... (error: Connection refused)
2026-01-20 07:59:48,484 [   2043] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 4s... (error: Connection refused)
2026-01-20 07:59:48,689 [   3233] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 4s... (error: Connection refused)
2026-01-20 07:59:49,825 [   7050] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 8s... (error: Connection refused)
2026-01-20 07:59:52,493 [   6052] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 8s... (error: Connection refused)
2026-01-20 07:59:52,695 [   7239] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 8s... (error: Connection refused)
2026-01-20 07:59:52,781 [  15379] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
2026-01-20 07:59:55,260 [  15093] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
2026-01-20 07:59:57,834 [  15059] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
2026-01-20 08:00:00,499 [  14058] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
2026-01-20 08:00:00,702 [  15246] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
2026-01-20 08:00:07,786 [  30384] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
Exception in thread "main" java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
	at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)
2026-01-20 08:00:10,270 [  30103] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
Exception in thread "main" java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
	at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)
2026-01-20 08:00:12,839 [  30064] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
Exception in thread "main" java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)
	at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973)
	at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
	at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)
2026-01-20 08:00:15,507 [  29066] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
2026-01-20 08:00:15,717 [  30261] WARNING - #c.j.l.i.LspClient - Retrying 127.0.0.1:9998 in 15s... (error: Connection refused)
Exception in thread "main" java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions