Fork me on GitHub
#lsp
<
2024-02-10
>
Eric Uitbeijerse15:02:27

Hi, I'm using vscode and Calva and I'm getting the following error: [Error - 3:57:02 PM] Connection to server got closed. Server will not be restarted. When I start vscode with my project I see that clojure-lsp starts to work fine but after a few seconds I get the above error. I see the following in the in clojure-lsp.out

2024-02-10T14:52:00.847Z  INFO [clojure-lsp.handlers:503] - :semantic-tokens-full 0ms
2024-02-10T14:52:00.847Z  DEBUG [clojure-lsp.server:55] - [Trace - 2024-02-10T14:52:00.847Z] Sending response 'textDocument/semanticTokens/full - (6)'. Request took 0ms.
Result: {
  "data" : [ 0, 4, 8, 0, 0, 1, 4, 9, 4, 0, 2, 1, 4, 3, 0, 0, 5, 5, 2, 1, 2, 5, 4, 6, 0, 1, 3, 7, 2, 0 ]
}



2024-02-10T14:52:01.264Z  INFO [clojure-lsp.feature.clojuredocs:23] - [Clojuredocs] Refreshing clojuredocs cache took 895ms.
2024-02-10T14:52:03.278Z  INFO [clojure-lsp.db:77] - [DB] Reading transit analysis cache from C:\Users\eric_\.cache\clojure-lsp\db.transit.json db took 2006ms
2024-02-10T14:52:03.278Z  INFO [clojure-lsp.feature.java-interop:271] - [Java] JDK source already present on global LSP cache dir.
2024-02-10T14:52:03.299Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 21ms
2024-02-10T14:52:03.307Z  INFO [clojure-lsp.feature.java-interop:312] - [Java] JDK source analysis cache loaded successfully.
2024-02-10T14:52:05.462Z  INFO [clojure-lsp.server:55] - Liveness probe - Parent process 3160 is not running - exiting server
2024-02-10T14:52:05.462Z  INFO [clojure-lsp.server:496] - Exiting...
I have already tried the following: • Reinstalled Calva • Installed an older version of Calva • Disabled all vscode extension apart from Calva • Installed an older version of VSCode • Installed an older version of Clojure-lsp • Tried it on a new basic Clojure project • Read the relevant Calva doc • Read the relevant Clojure-lsp doc (well, at least the parts I think could be relevant) • Tried it on another notebook -> there it works fine with same version of Calva etc. • Etc. Would really appreciate some help, Version: 1.86.1 (user setup) Commit: 31c37ee8f63491495ac49e43b8544550fbae4533 Date: 2024-02-07T09:08:20.941Z Electron: 27.2.3 ElectronBuildId: 26495564 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Windows_NT x64 10.0.19045 Calva version used: v2.0.411 clojure-lsp version used: 2023.01.26-11.08.16 clj-kondo version used: 2023.01.20 (edited)

ericdallo15:02:10

we have a logic at clojure-lsp that probes the process and if the process is not live for 5s we kill server process

ericdallo15:02:28

so it could be calva sending wrong pid?

Eric Uitbeijerse15:02:36

Is there anything I can do about that?

Eric Uitbeijerse15:02:01

I also tried an older version on Calva and still had the same problem

Eric Uitbeijerse15:02:52

And the same version on another notebook works ok

ericdallo15:02:16

That's weird, something only on your system, is that a different Linux or something?

ericdallo15:02:36

Would be good to check what calva is sending kn the initialize request

ericdallo15:02:53

We need to check what is being sent as the process-id

Eric Uitbeijerse15:02:10

I have the whole clojure-lsp log if you want it, There is an warning with lots of data in it but after that warning the server still seem to receive and send message but I guess it is the parent process of the server that is the issue but I don;t know how to check that

Eric Uitbeijerse15:02:21

Aha, I can look for that///

Eric Uitbeijerse15:02:17

Is this what you are looking for?

[Trace - 4:28:04 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 31660,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.86.1"
    },
    "locale": "en-us",
    "rootPath": "c:\\Users\\eric_\\OneDrive - Raboweb\\Clojure\\okr-genie-lum1",
    "rootUri": "file:///c%3A/Users/eric_/OneDrive%20-%20Raboweb/Clojure/okr-genie-lum1",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,

ericdallo15:02:27

Yes, now you need to check if that processId is really running in your machine and not being killed for anything

Eric Uitbeijerse07:02:47

Thanks ericdallo, that clue really helps, I've narrowed it down to the tasklist shell command that gives:

ERROR: Invalid class
on the system with the issue and work fine on the other system. I'll investigate this further and let you know when I find the root cause.

Eric Uitbeijerse08:02:21

Fixed 😄 by fixing the tasklist error by following the instructions in https://learn.microsoft.com/en-us/answers/questions/203461/tasklist-error-in-windows-10-pro No clue what caused this issue (as recently everything was working fine) but clojure-lsp is not to blame! Again thanks for your marvelous support, you keep amazing me and you made my day 🙂.

pez09:02:50

Happy you got it working! Now at least we are aware of that this task list issue is a thing.

ericdallo16:02:19

Yes! Happy coding!

Eric Uitbeijerse15:04:41

@U0ETXRFEW @UKFSJSM38 Just fyi, I just had another issue with clojure-lsp disconnecting from the server. Again it was due to the tasklist command failing but this time it had a different cause: I stopped the 'Windows Management Instrumentation' service (for a unrelated reason) and as it turns out, the tasklist command requires this service to be running. Just for the record if anyone else will run into this issue.