This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-15
Channels
- # announcements (1)
- # babashka (4)
- # beginners (4)
- # calva (42)
- # clerk (2)
- # cljdoc (1)
- # clojure (71)
- # clojure-denver (3)
- # clojure-europe (4)
- # clojure-uk (11)
- # clojurescript (1)
- # cursive (12)
- # deps-new (4)
- # emacs (3)
- # hyperfiddle (46)
- # java (1)
- # jobs (2)
- # jvm (16)
- # missionary (10)
- # polylith (5)
- # releases (1)
- # remote-jobs (2)
- # scittle (6)
- # sql (7)
- # transit (10)
Hey guys! Any idea, why I get an error when try to run the clojure-lsp? This is the log of the Clojure Language Client:
[Trace - 6:09:09 PM] Sending request 'initialize - (0)'.
[Trace - 6:09:21 PM] Received response 'initialize - (0)' in 12448ms. Request failed: Internal error (-32603).
[Error - 6:09:21 PM] Server initialization failed.
Message: Internal error
Code: -32603
[object Object]
[Error - 6:09:21 PM] Clojure Language Client client: couldn't create connection to server.
Message: Internal error
Code: -32603
[object Object]
[Error - 6:09:23 PM] Connection to server got closed. Server will not be restarted.
Good question :) I don't know what path windows use as tmp dir, but you can set a setting pointing to somewhere like:
.lsp/config.edn
{:log-path "/some/path"}
Any news here?
Maybe this is related?
yes, seems like the same issue, would be nice to try to get the server log specifying a log path
@UKFSJSM38, can you check if your project folder is placed in a path with non-latin characters in parent folder names?
Yes I am sorry!
Sorry for the really long response time... I get the same error with the latest clojure-lsp version. I'll try to provide the full logs to you. Sadly, the linked problem doesn't seem to be related to this as there are only alphabetical characters (a-z) in the path of my project.
is that repro on https://github.com/ericdallo/clojure-sample?
Also, I get no logs... The content of .lsp/config.edn
is {:log-path "\Users\myuser\Downloads\clj-lsp-logs"}
.
ah, from your logs Clojure Language Client client: couldn't create connection to server.
this meant that clojure-lsp is not even starting... it could be a problem on calva side as well.
Maybe try running in your project repo clojure-lsp diagnostics
and check if clojure-lsp is working
@U03EXAURGUC Did you see if clojure-lsp starts for the clojure-sample project mentioned above? Also, check the dev console for any potentially useful info around clojure-lsp after you get the error message. (Help -> Toggle Developer Tools -> Console tab)
The project.clj looks like
(defproject clojure_sample "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "MIT License"}
:dependencies [[org.clojure/clojure "1.10.3"]
[org.clojure/clojurescript "1.10.758"]
[org.clojure/core.async "1.5.648"]
[nubank/matcher-combinators "3.3.1"]]
:target-path "target/%s")
It should work with Lein projects. Can you provide a link to a repo with a sample project where you can reproduce the issue?
> The content of .lsp/config.edn
is {:log-path "\Users\myuser\Downloads\clj-lsp-logs"}
.
Doesn’t look like that should work?
clj:user:> "\Users\myuser\Downloads\clj-lsp-logs"
; Syntax error reading source at (REPL:60:4).
; Unsupported escape character: \U
I tried the repro now. On my Mac. Works there. Will try find some time to test it on Windows as well.
I also tried with that log path configuration. Noting several things:
• clojure-lsp silently falls back on /tmp/clojure-lsp.out
as log file
◦ We then find the above error message in this log file
• Calva’s command for opening the log file failed silently
◦ In the console log it informs something about VS Code having troubles with files bigger than 50MB
◦ Unfortunately I then removed the file, so I don’t know how big my file was
◦ It took a full reload of the VS Code window to make the command wrk again
• Fixing the log path so to a legal string, but non-existent path (I just changed \
to /
in that path and it doesn’t exist on my machine) I got the errors reported in @U03EXAURGUC’s thread start.
I’ll post the clojure-lsp log from when using a legal string, though non-existent log path, and Calva’s console logs in separate messages.
My main take-aways here are:
• it could be a configuration error, @U03EXAURGUC
• Calva could do better in handling the error, <!subteam^S03BGSAUPTQ>
• clojure-lsp could do better in handling the error, @UKFSJSM38
Fixing the log config so that it is an existing path, things work without issue. So there’s that. 😃
It seems so, but it is not fully conclusive. I can’t reproduce the error with an unparsable log path. Only with a non-existing one. In both cases it makes sense for clojure-lsp to fall back on a default, I think. And to update its serverInfo answer with the file it has fallen back to. That would help Calva open the right file, where the bad-log-path message can be read.
makes sense, I think a check if file exists before creating the logger would be enough fallbacking for the default