emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.81k stars 892 forks source link

LSP cannot find nrepl when the project root directory path contains special characters #4306

Open allentiak opened 10 months ago

allentiak commented 10 months ago

Thank you for the bug report

Bug description

I tried to open a Clojure project from the following path: /home/allentiak/Documents/Conferencias y Cursos (míos)/ddd-design.recipes-automatic.contract.enforcing/2024.03.15--bob.konferenz/domain-modelling--clojure, and nrepl could not be loaded.

I got an LSP internal error.

Moving the project root to a path without the special characters should fix the problem.

I tried it with /home/allentiak/tmp/really/long/path/with/no/spaces/nor/special/characters/just/adding/more/words/and/levels/to/the/path/for/the/sake/of/it/and/to/make/sure/it/is/not/the/special/chars/in/the/path/domain-modelling--clojure and it worked just fine.

Removing the (, the ), and the í from the original path also works. (No need to remove the spaces.)

Steps to reproduce

Expected behavior

The project should work normally.

Which Language Server did you use?

lsp-clojure

OS

Linux

Error callstack

2024-01-21T21:36:57.019Z  INFO [clojure-lsp.server:599] - [SERVER] Starting server...
2024-01-21T21:36:57.023Z  DEBUG [clojure-lsp.nrepl:21] - nrepl not found, skipping nrepl server start...
2024-01-21T21:36:57.024Z  INFO [clojure-lsp.server:486] - Initializing...
2024-01-21T21:36:57.092Z  INFO [clojure-lsp.db:77] - [DB] Reading transit analysis cache from /home/allentiak/devel/domain-modelling--clojure/.lsp/.cache/db.transit.json db took 67ms
2024-01-21T21:36:57.103Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 10ms
2024-01-21T21:36:57.155Z  INFO [clojure-lsp.classpath:104] - Finding classpath via `/usr/local/bin/clojure -A:test:dev -Spath`
2024-01-21T21:36:57.168Z  DEBUG [clojure-lsp.classpath:116] - Classpath found, paths:  ["test" "src" "resources" "/home/allentiak/.m2/repository/com/github/seancorfield/expectations/2.0.165/expectations-2.0.165.jar" "/home/allentiak/.m2/repository/kaocha-noyoda/kaocha-noyoda/2019-06-03/kaocha-noyoda-2019-06-03.jar" "/home/allentiak/.m2/repository/lambdaisland/kaocha/1.87.1366/kaocha-1.87.1366.jar" "/home/allentiak/.m2/repository/metosin/malli/0.13.0/malli-0.13.0.jar" "/home/allentiak/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar" "/home/allentiak/.m2/repository/org/clojure/test.check/1.1.1/test.check-1.1.1.jar" "/home/allentiak/.m2/repository/aero/aero/1.1.6/aero-1.1.6.jar" "/home/allentiak/.m2/repository/com/nextjournal/beholder/1.0.2/beholder-1.0.2.jar" "/home/allentiak/.m2/repository/expound/expound/0.9.0/expound-0.9.0.jar" "/home/allentiak/.m2/repository/hawk/hawk/0.2.11/hawk-0.2.11.jar" "/home/allentiak/.m2/repository/lambdaisland/deep-diff2/2.10.211/deep-diff2-2.10.211.jar" "/home/allentiak/.m2/repository/lambdaisland/tools.namespace/0.3.256/tools.namespace-0.3.256.jar" "/home/allentiak/.m2/repository/meta-merge/meta-merge/1.0.0/meta-merge-1.0.0.jar" "/home/allentiak/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar" "/home/allentiak/.m2/repository/org/clojure/tools.cli/1.0.219/tools.cli-1.0.219.jar" "/home/allentiak/.m2/repository/org/tcrawley/dynapath/1.1.0/dynapath-1.1.0.jar" "/home/allentiak/.m2/repository/progrock/progrock/0.1.2/progrock-0.1.2.jar" "/home/allentiak/.m2/repository/slingshot/slingshot/0.12.2/slingshot-0.12.2.jar" "/home/allentiak/.m2/repository/borkdude/dynaload/0.3.5/dynaload-0.3.5.jar" "/home/allentiak/.m2/repository/borkdude/edamame/1.3.23/edamame-1.3.23.jar" "/home/allentiak/.m2/repository/fipp/fipp/0.6.26/fipp-0.6.26.jar" "/home/allentiak/.m2/repository/mvxcvi/arrangement/2.1.0/arrangement-2.1.0.jar" "/home/allentiak/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar" "/home/allentiak/.m2/repository/io/methvin/directory-watcher/0.17.3/directory-watcher-0.17.3.jar" "/home/allentiak/.m2/repository/net/incongru/watchservice/barbary-watchservice/1.0/barbary-watchservice-1.0.jar" "/home/allentiak/.m2/repository/lambdaisland/clj-diff/1.4.78/clj-diff-1.4.78.jar" "/home/allentiak/.m2/repository/org/clojure/core.rrb-vector/0.1.2/core.rrb-vector-0.1.2.jar" "/home/allentiak/.m2/repository/org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.jar" "/home/allentiak/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar" "/home/allentiak/.m2/repository/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar" "/home/allentiak/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar"]
2024-01-21T21:36:57.168Z  INFO [clojure-lsp.source-paths:85] - [Startup] Using source-paths from classpath: ["/home/allentiak/devel/domain-modelling--clojure/test" "/home/allentiak/devel/domain-modelling--clojure/resources" "/home/allentiak/devel/domain-modelling--clojure/src"]
2024-01-21T21:36:57.169Z  INFO [clojure-lsp.startup:142] - Copying kondo configs from classpath to project if any...
2024-01-21T21:36:57.212Z  WARN [clojure-lsp.kondo:363] - Non-fatal error from clj-kondo: Configs copied:
- .clj-kondo/com.github.seancorfield/expectations
- .clj-kondo/metosin/malli

2024-01-21T21:36:57.212Z  INFO [clojure-lsp.startup:144] - Copied kondo configs, took 43ms secs.
2024-01-21T21:36:57.212Z  INFO [clojure-lsp.startup:113] - Analyzing classpath for project root /home/allentiak/devel/domain-modelling--clojure
2024-01-21T21:36:57.212Z  INFO [clojure-lsp.kondo:394] - No new paths to analyze
2024-01-21T21:36:57.212Z  INFO [clojure-lsp.startup:128] - External classpath paths analyzed, took 0ms
2024-01-21T21:36:57.212Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:36:57.232Z  INFO [clojure-lsp.startup:134] - Manual GC after classpath scan took 20ms
2024-01-21T21:36:57.233Z  INFO [clojure-lsp.startup:277] - Caching db for next startup...
2024-01-21T21:36:57.233Z  INFO [clojure-lsp.startup:290] - [Startup] Analyzing source paths for project root /home/allentiak/devel/domain-modelling--clojure
2024-01-21T21:36:57.248Z  INFO [clojure-lsp.db:61] - Manual GC before upsert db took 15ms
2024-01-21T21:36:57.248Z  INFO [clojure-lsp.startup:75] - [Startup] Project only paths analyzed by clj-depend, took 0ms
2024-01-21T21:36:57.258Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:36:57.259Z  INFO [clojure-lsp.kondo:242] - Linting whole project for unused-public-var took 1ms
2024-01-21T21:36:57.259Z  WARN [clojure-lsp.kondo:363] - Non-fatal error from clj-kondo: No configs copied.

2024-01-21T21:36:57.259Z  INFO [clojure-lsp.startup:71] - [Startup] Project only paths analyzed by clj-kondo, took 11ms
2024-01-21T21:36:57.259Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:36:57.260Z  INFO [clojure-lsp.handlers:192] - [Startup] Analyzing test paths for project root file:///home/allentiak/devel/domain-modelling--clojure
2024-01-21T21:36:57.260Z  INFO [clojure-lsp.feature.clojuredocs:21] - [Clojuredocs] Refreshing clojuredocs cache...
2024-01-21T21:36:57.260Z  INFO [clojure-lsp.handlers:165] - :initialize 236ms
2024-01-21T21:36:57.260Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:36:57.260Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:36:57.261Z  INFO [clojure-lsp.server:164] - :refreshing-test-tree 1ms
2024-01-21T21:36:57.261Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 1ms
2024-01-21T21:36:57.261Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:36:57.262Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:36:57.262Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:36:57.271Z  INFO [clojure-lsp.server:508] - Initialized!
2024-01-21T21:36:57.273Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:36:57.273Z  WARN [clojure-lsp.kondo:363] - Non-fatal error from clj-kondo: No configs copied.

2024-01-21T21:36:57.273Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:36:57.274Z  INFO [clojure-lsp.handlers:197] - :did-open 2ms
2024-01-21T21:36:57.274Z  INFO [clojure-lsp.server:164] - :refreshing-test-tree 0ms
2024-01-21T21:36:57.274Z  INFO [clojure-lsp.handlers:488] - :code-lens 0ms
2024-01-21T21:36:57.299Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:36:57.355Z  INFO [clojure-lsp.db:65] - [DB] Upserting transit analysis to /home/allentiak/devel/domain-modelling--clojure/.lsp/.cache/db.transit.json cache took 106ms
2024-01-21T21:36:57.585Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:36:57.587Z  INFO [clojure-lsp.handlers:294] - :document-symbol 2ms
2024-01-21T21:36:57.587Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:36:57.588Z  INFO [clojure-lsp.handlers:294] - :document-symbol 1ms
2024-01-21T21:36:57.592Z  INFO [clojure-lsp.handlers:475] - :code-actions 7ms
2024-01-21T21:36:57.592Z  INFO [clojure-lsp.handlers:475] - :code-actions 5ms
2024-01-21T21:36:57.601Z  INFO [clojure-lsp.handlers:488] - :code-lens 0ms
2024-01-21T21:36:57.617Z  INFO [clojure-lsp.handlers:488] - :code-lens 0ms
2024-01-21T21:36:57.850Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:36:57.851Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:36:58.303Z  INFO [clojure-lsp.feature.clojuredocs:23] - [Clojuredocs] Refreshing clojuredocs cache took 1043ms.
2024-01-21T21:37:00.222Z  INFO [clojure-lsp.db:77] - [DB] Reading transit analysis cache from /home/allentiak/.cache/clojure-lsp/db.transit.json db took 1919ms
2024-01-21T21:37:00.222Z  INFO [clojure-lsp.feature.java-interop:271] - [Java] JDK source already present on global LSP cache dir.
2024-01-21T21:37:00.560Z  INFO [clojure-lsp.feature.java-interop:319] - [Java] Analyzing JDK source via clj-kondo...
2024-01-21T21:37:02.000Z  INFO [clojure-lsp.handlers:436] - :hover 1ms
2024-01-21T21:37:02.300Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:02.302Z  INFO [clojure-lsp.handlers:475] - :code-actions 2ms
2024-01-21T21:37:19.836Z  INFO [clojure-lsp.handlers:436] - :hover 1ms
2024-01-21T21:37:20.131Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:20.143Z  INFO [clojure-lsp.handlers:475] - :code-actions 12ms
2024-01-21T21:37:24.111Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:24.112Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:37:27.633Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:27.646Z  INFO [clojure-lsp.handlers:475] - :code-actions 13ms
2024-01-21T21:37:28.910Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:28.911Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:37:48.588Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:48.590Z  INFO [clojure-lsp.handlers:475] - :code-actions 2ms
2024-01-21T21:37:49.448Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:49.457Z  INFO [clojure-lsp.handlers:475] - :code-actions 10ms
2024-01-21T21:37:51.567Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:51.567Z  INFO [clojure-lsp.handlers:475] - :code-actions 20ms
2024-01-21T21:37:54.488Z  INFO [clojure-lsp.handlers:436] - :hover 1ms
2024-01-21T21:37:54.488Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:37:54.498Z  INFO [clojure-lsp.handlers:475] - :code-actions 13ms
2024-01-21T21:38:10.363Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:10.364Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:38:15.225Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:15.226Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:38:17.461Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:17.462Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:38:18.877Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:18.878Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:38:45.491Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:38:45.491Z  WARN [clojure-lsp.kondo:363] - Non-fatal error from clj-kondo: No configs copied.

2024-01-21T21:38:45.491Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
2024-01-21T21:38:45.492Z  INFO [clojure-lsp.handlers:197] - :did-open 8ms
2024-01-21T21:38:45.492Z  INFO [clojure-lsp.server:164] - :refreshing-test-tree 0ms
2024-01-21T21:38:45.504Z  INFO [clojure-lsp.handlers:488] - :code-lens 0ms
2024-01-21T21:38:45.517Z  INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms
2024-01-21T21:38:45.524Z  INFO [clojure-lsp.handlers:294] - :document-symbol 0ms
2024-01-21T21:38:45.524Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:45.525Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:38:45.543Z  INFO [clojure-lsp.handlers:488] - :code-lens 0ms
2024-01-21T21:38:45.557Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 0ms
2024-01-21T21:38:45.557Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 0ms
2024-01-21T21:38:45.557Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 1ms
2024-01-21T21:38:45.558Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 0ms
2024-01-21T21:38:45.558Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 0ms
2024-01-21T21:38:45.558Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 0ms
2024-01-21T21:38:45.558Z  INFO [clojure-lsp.handlers:495] - :resolve-code-lens 0ms
2024-01-21T21:38:46.843Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:46.844Z  INFO [clojure-lsp.handlers:436] - :hover 1ms
2024-01-21T21:38:46.846Z  INFO [clojure-lsp.handlers:475] - :code-actions 3ms
2024-01-21T21:38:53.258Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:38:53.605Z  INFO [clojure-lsp.handlers:475] - :code-actions 348ms
2024-01-21T21:38:58.461Z  INFO [clojure-lsp.handlers:248] - :prepare-rename 0ms
2024-01-21T21:39:00.950Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-01-21T21:39:00.952Z  INFO [clojure-lsp.handlers:475] - :code-actions 2ms
2024-01-21T21:39:00.952Z  INFO [clojure-lsp.handlers:436] - :hover 2ms
2024-01-21T21:39:17.700Z  INFO [clojure-lsp.handlers:475] - :code-actions 2ms
2024-01-21T21:39:40.600Z  INFO [clojure-lsp.handlers:436] - :hover 1ms
2024-01-21T21:39:42.301Z  INFO [clojure-lsp.handlers:475] - :code-actions 2ms
2024-01-21T21:39:45.241Z  INFO [clojure-lsp.handlers:475] - :code-actions 2ms
2024-01-21T21:39:49.973Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2024-01-21T21:40:51.071Z  INFO [clojure-lsp.feature.java-interop:180] - [Java] Analyzing JDK source with clj-kondo took 230511ms
2024-01-21T21:40:51.161Z  INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 86ms
2024-01-21T21:40:53.730Z  INFO [clojure-lsp.db:77] - [DB] Reading transit analysis cache from /home/allentiak/.cache/clojure-lsp/db.transit.json db took 2561ms
2024-01-21T21:40:54.228Z  INFO [clojure-lsp.db:61] - Manual GC before upsert db took 493ms
2024-01-21T21:40:56.628Z  INFO [clojure-lsp.db:65] - [DB] Upserting transit analysis to /home/allentiak/.cache/clojure-lsp/db.transit.json cache took 2400ms
2024-01-21T21:40:56.629Z  INFO [clojure-lsp.feature.java-interop:321] - [Java] JDK source analyzed and cached successfully.

Anything else?

No response

ericdallo commented 10 months ago

@allentiak I think you are misunderstanding, that nrepl server is one that clojure-lsp starts only for development of clojure-lsp itself purposes, the "prod" binary is intended to not find nrepl, also clojure-lsp uses static analysis so all features do not require or relat to a repl.

ericdallo commented 10 months ago

I accidentally closed the issue, but could you explain a little bit better what is the internal error? if it was just that nrepl mention, I think we can close this issue

allentiak commented 7 months ago

@ericdallo

I don't really know what the internal error is. All I know is that as soon as I moved the project with a path that didn't contain any of the aforementioned non-ASCII characters, the error disapeared.

ericdallo commented 7 months ago

@allentiak But what error? I don't see any error in the provided logs