BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.58k stars 212 forks source link

Fresh Calva VS-Code install - Cannot Jack-in, Unhandled REPL handler exception #2316

Open mattpenner opened 9 months ago

mattpenner commented 9 months ago

I am starting to learn Clojure on Windows 10 and just installed the Calva VS-Code extension. Upon trying to run the Calva: Fire up the Getting Started REPL files I get the following error in the Terminal:

This is a pseudo terminal, only used for hosting the Jack-in REPL process. It takes no input.
Pressing ctrl+c with this terminal focused, killing this terminal, or closing/reloading the VS Code window will all stop/kill the Jack-in REPL process.

⚡️ Starting the REPL ⚡️ using the below command line:
pushd c:\Users\mpenner\AppData\Local\Temp\betterthantomorrow.calva\z2pyt6 & java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.0.0""},cider/cider-nrepl {:mvn/version,""0.28.5""}}}" -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" & popd
nREPL server started on port 58976 on host 127.0.0.1 - nrepl://127.0.0.1:58976
ERROR: Unhandled REPL handler exception processing message {:op eval, :code *ns*, :id 1}

The out.calva-repl window states:

; This is the Calva evaluation results output window.
; TIPS: The keyboard shortcut `ctrl+alt+o o` shows and focuses this window
;   when connected to a REPL session.
; Please see https://calva.io/output/ for more info.
; Happy coding! ♥️

; Jacking in...
; Starting Jack-in Terminal: pushd c:\Users\mpenner\AppData\Local\Temp\betterthantomorrow.calva\z2pyt6 & java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.0.0""},cider/cider-nrepl {:mvn/version,""0.28.5""}}}" -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" & popd
; Using host:port 127.0.0.1:65238 ...
; Hooking up nREPL sessions ...
; nREPL connection failed: Error: read ECONNRESET
; Failed connecting.
; Jacking in...
; Starting Jack-in Terminal: pushd c:\Users\mpenner\AppData\Local\Temp\betterthantomorrow.calva\z2pyt6 & java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.0.0""},cider/cider-nrepl {:mvn/version,""0.28.5""}}}" -M -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" & popd
; Using host:port 127.0.0.1:58976 ...
; Hooking up nREPL sessions ...

The VS-Code output screen shows:

Welcome to Calva. Happy Clojure and ClojureScript coding! ❤️

Please check these resources out:
  Calva Documentation: https://calva.io/
  #calva at the Clojurians Slack: https://clojurians.slack.com/messages/calva/
  Bug reports: https://github.com/BetterThanTomorrow/calva/issues

If you like Calva, please consider how you can contribute: https://github.com/BetterThanTomorrow/calva/wiki/How-to-Contribute

Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
  nREPL dependencies configured:
    nrepl: 1.0.0
    cider-nrepl: 0.28.5
    cider/piggieback: 0.5.3
  clojure-lsp version configured: latest

If you are new to Calva, please see: https://calva.io/getting-started/
  And please consider the command: **Calva: Fire up the Getting Started REPL**

Calva version used: v2.0.388

I don't see any other errors, error codes, etc.

Just before this I installed Java via adoptium and installed Leiningen via https://ericnormand.me/guide/how-to-install-clojure#windows and restarted.

The Clojure Lein REPL works just fine in the command line.

I am using VS-Code 1.82.2 on Win10 10.0.19045. I do have several VS-Code extensions running for other projects I work on (PowerShell, Angular, Android, etc.).

I have tried starting VS-Code as an administrator, ran the Getting Started overwriting the temp downloaded files or using them, restarted VS-Code several times, and restarted my laptop. Can't seem to get this to work with my current knowledge.

PEZ commented 9 months ago

Hi! Thanks for the report, and for the details. I can't say I understand what's going on, but it all looks eerly similar to this issue reported earlier today/yesterday:

Though, there we saw kubernetes and docker being involved somehow. But can you check if you have the WSL extension enabled and, if so, if it makes a difference disabling it?

mattpenner commented 9 months ago

Thanks @PEZ , I saw that issue as well. I do not have the WSL loaded and could find no mention of it in my extensions. Unless this is now happening under the hood I do not see that this is involved.

I also just disabled all of my extensions other than CALVA: Clojure & ClojureScript Interactive Programming and Calva Spritz. However, even after reloading VSC I still get the same result. I also tried to run VSC as Administrator, and had the same output.

The output errors are pretty slim. Any other ideas of where I could pull more verbose error logs from?

PEZ commented 9 months ago

It could be that the error message gets lost because it's being directed to the repl client which disconnects on the error. Pure speculation here, but you could try to disable Calva: Redirect Server Output To Repl

image

And see if you get a trace in the jack-in terminal.

Which version of Java are you using?

mattpenner commented 9 months ago

@PEZ Thanks for the quick and responsive replies. ☺️

I get the following Java version info:

openjdk version "17.0.8.1" 2023-08-24
OpenJDK Runtime Environment Temurin-17.0.8.1+1 (build 17.0.8.1+1)
OpenJDK 64-Bit Server VM Temurin-17.0.8.1+1 (build 17.0.8.1+1, mixed mode, sharing)

I unchecked the Redirect Server Out to Repl setting you mentioned, but after reloading there was no change. No additional info is in the Terminal or Output screens. 😕

PEZ commented 9 months ago

Thanks! From the messages we do get it seems the error occurs in the nrepl server. Maybe there's a way to get it to be more verbose... There are also a newer version of nrepl than Calva is using by default. There's a slim chance it could work by configuring Calva to use it (1.1.0-alpha1).

I started to suspect that there's some kind of problem in the combination of OS and VS Code version. So I tried to connect on a Windows box I have access to with an older version of VS Code (1.77 something, I forgot to take a note) and upgraded to latest (1.82.2, like you have). Unfortunately (well...) I could still connect. I'm not sure what version of Windows I am using, I'm a Windows noob...)

You could try see if it might be a VS Code version thing by using an older version. There are versions here: https://github.com/ewanharris/vscode-versions I think 1.81.1 might be of interest, seeing how the Electron and Node has been bumped after that. I would do this test if I could reproduce the problem, but so far I can't.

kapitaali commented 8 months ago

I am getting this same error too with 2.0.392. Not using VSCode but Flatpak VSCodium on Pop!_OS:

Version: 1.83.1 Release: 23285 Commit: 36d13de33ac0d6c684f10f99cff352e2f58228b3 Date: 2023-10-12T18:26:29.496Z Electron: 25.8.4 ElectronBuildId: undefined Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Linux x64 6.5.6-76060506-generic

bpringe commented 8 months ago

Just to be more thorough, you can also check the developer console (Help -> Toggle Developer Tools -> Console tab) for errors, as well as enable the logs between the nrepl server and client and check those. Since it does seem like the nrepl server is at least starting, you might see some helpful info in those nrepl logs.