Fork me on GitHub
#cider
<
2019-12-23
>
andrea.crotti10:12:19

something weird going on since yesterday, starting a repl with cider I get

Caused by: java.lang.IllegalAccessError: reader-error does not exist
 at clojure.core$refer.invokeStatic (core.clj:4249)
    clojure.core$refer.doInvoke (core.clj:4217)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invokeStatic (core.clj:667)
    clojure.core$load_lib.invokeStatic (core.clj:5966)
    clojure.core$load_lib.doInvoke (core.clj:5928)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invokeStatic (core.clj:667)

andrea.crotti10:12:40

works fine if I do lein repl from the terminal, anyone else seeing this?

andrea.crotti10:12:03

I'm on CIDER 0.24.0snapshot (package: )

jumar10:12:41

Hmm. Funny. I've just tried to start our app and suddenly getting this error when I try to run cider-jack-in :

error in process sentinel: Could not start nREPL server: clojure.lang.Compiler$CompilerException: Syntax error compiling at (clojure/tools/reader/edn.clj:41:7).
#:clojure.error{:phase :compile-syntax-check, :line 41, :column 7, :source "clojure/tools/reader/edn.clj"}
 at clojure.lang.Compiler.analyze (Compiler.java:6808)
...
lein repl works fine I tried to add an explicit dependency on tools.reader into my project.clj:
[org.clojure/tools.reader "1.3.2"]
But that doesn't help.

jumar10:12:05

I've found this one: https://github.com/clojure-emacs/cider/issues/2236 But they say adding an explicit dependency on tools.reader did help them

andrea.crotti10:12:07

ah right I'm not the only one then, and doesn't actually happen in all the projects either

andrea.crotti10:12:06

I cleared also everything I had in my lein profiles just to be sure

jumar10:12:11

And still the same error?

andrea.crotti10:12:34

yes same thing

andrea.crotti10:12:11

also adding tools.reader as dependency doesn't help

andrea.crotti10:12:55

starting the repl from the terminal and doing cider-connect works

andrea.crotti10:12:18

so definitively one of the libraries used in the cider startup is acting funny

andrea.crotti10:12:28

I get the same problem with an open source project btw: https://github.com/FundingCircle/topology-grapher/ if anyone else could give it a try, I'll file an issue in the meanwhile or reopen that same one?

andrea.crotti10:12:28

I just tried even starting with Emacs -Q with 0 config and it's the same problem

dominicm10:12:31

Do you have refactor installed?

andrea.crotti10:12:07

clj-refactor is an installed package. Status: Installed in ‘clj-refactor-20191217.909/’ (unsigned). Version: 20191217.909

andrea.crotti10:12:22

should I try to delete that?

andrea.crotti10:12:08

mm no same thing after I delete it

andrea.crotti10:12:56

strange thing is that everything was working fine until a few days ago, but I don't even see any suspicious commit recently

jumar10:12:30

Yep, the same for me too. I had older cider release from september so I tried to upgrade but the issue remains even with the latest version

andrea.crotti10:12:58

is the full lein command printed somewhere apart from the minibuffer? it doesn't go to Messages, would be nice to see that

andrea.crotti10:12:12

trying to run it without some arguments

jumar10:12:13

It goes to messages 😉

jumar10:12:41

/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl :headless :host localhost

jumar10:12:23

I get further if I exclude the refactor-nrepl plugin but then it freezes before the repl prompt shows up:

/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl :headless :host localhostWARNING!!! version ranges found for:
[org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4"] -> [org.eclipse.xtext/org.eclipse.xtext.xbase.lib "2.8.4"] -> [com.google.guava/guava "[10.0.1,14.0.1]"]
Consider using [org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4" :exclusions [com.google.guava/guava]].
[org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4"] -> [org.eclipse.xtend/org.eclipse.xtend.lib.macro "2.8.4"] -> [com.google.guava/guava "[10.0.1,14.0.1]"]
Consider using [org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4" :exclusions [com.google.guava/guava]].
[org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4"] -> [org.eclipse.xtend/org.eclipse.xtend.lib.macro "2.8.4"] -> [org.eclipse.xtext/org.eclipse.xtext.xbase.lib "2.8.4"] -> [com.google.guava/guava "[10.0.1,14.0.1]"]
Consider using [org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4" :exclusions [com.google.guava/guava]].

Instrumented specs
nREPL server started on port 57012 on host localhost - 

# and then nothing ...

jumar10:12:08

Btw. you can customize that via prefix, e.g. C-u , ' But that doesn't help anyway in this case 🙂

jumar10:12:56

Btw. I'm using spacemacs

andrea.crotti10:12:36

well for me it works with the full command from the shell

$ /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl
nREPL server started on port 64850 on host 127.0.0.1 - 

REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 12.0.1+12
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=>

andrea.crotti10:12:20

ah the reason why I don't see it in Messages is that the buffer size is too small

andrea.crotti10:12:26

and I lose that message 😄

andrea.crotti10:12:02

message-buffer-max-lines should help

jumar10:12:40

Ah, that's interesting. For me the error is basically the same regardless if I run it from Cider or from cmd - it's weird that it's different for you; But then I experience a slightly different issue:

clojure.lang.Compiler$CompilerException: Syntax error compiling at (clojure/tools/reader/edn.clj:41:7).
#:clojure.error{:phase :compile-syntax-check, :line 41, :column 7, :source "clojure/tools/reader/edn.clj"}

andrea.crotti10:12:42

ok yeah anyway it's definitively refactor-nrepl somehow, I reproduced it also in the shell now

👍 4
andrea.crotti10:12:56

no I think it's the same error

andrea.crotti10:12:14

I was testing on another project, in that project it didn't actually fail

jumar10:12:32

I tried refactor-nrepl 2.4.0 but it freezes in a similar way as if I try to exclude it completely

jumar10:12:41

Yep, other (simpler) project works for me too

jumar10:12:01

I have tons of dependencies so it's hard to tell....

andrea.crotti10:12:33

maybe one of these changes

andrea.crotti11:12:07

to me this command works /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[com.billpiel/sayid\ \"0.0.18\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl :headless :host localhost, so using 2.4.0 for refactor-nrepl

practicalli-johnny11:12:14

I suggest also removing sayid from your Cider configuration when having issues, especially with newer versions of Cider and nrepl. Cider has its own debugger and Sayid does not get a lot of maintenance as far as I know.

andrea.crotti12:12:47

the question is how do I actually disable it?

andrea.crotti12:12:56

I mean apart from running the command manually in the repl without the extra args

andrea.crotti12:12:04

can't find anything in the cider config to do that

practicalli-johnny12:12:03

Sayid no longer includes Cider by default, so it seems you have some code to add the sayid package (or did a packages-list-packages install). If you are using Spacemacs develop branch then just update spacemacs (git pull) and check your .spacemacs layer configuration is not including sayid (no sayid variable or sayid variable set to nil)

andrea.crotti12:12:44

the problem is not sayid it's refactor-nrepl

practicalli-johnny12:12:46

You are running sayid based on the lein command line in Emacs when running cider-jack-in. Sayid has been a cause of many issues in the past. Unless you are actively debugging your entire project on a regular basis, then it is recommended that you remove sayid. The same goes for clj-refactor. Even if there is a bug elsewhere, sayid and clj-refactor should be removed unless your development workflow actively depends on them to avoid experiencing issues that seem to be other packages when really these packages are the cause.

andrea.crotti11:12:23

so yeah definitively that, can I just disable it entirely somehow?

andrea.crotti11:12:19

I can't find how to disable refactor-nrepl entirely or at least pin it to 0.24 btw

jumar11:12:48

I've tried to build my own version but ./build.sh install failed (`Caused by: http://java.io.FileNotFoundException: Could not locate clojure/spec/alpha__init.class or clojure/spec/alpha.clj on classpath.`)

andrea.crotti11:12:07

probably too old version of clojure?

jumar11:12:28

lein do clean, install works but I'm not sure that's the proper way to do it

andrea.crotti12:12:36

if anyone wants a workaround in the meanwhile just: • checkout locally the refactor-nrepl project • git checkout e35af1d1b972cfecbf5e857384234ac3f683652d to get to a working version • lein install to install it in your maven dir (overriding the 2.5.0-SNAPSHOT that would be downloaded)

jumar12:12:22

Exactly what I did too. Seems to work fine

Daniel Slutsky18:12:27

Thank you so much for this @U0524T275!

andrea.crotti12:12:52

with that it should all work locally (at least it does for me)