Cider: Crash on Jack-in

Created on 12 Feb 2019  ·  9Comments  ·  Source: clojure-emacs/cider

I've been writing some Clojure on the side for about 6 months, and the setup always trips me up. I still haven't done it in under 2 days :)

Hopefully this is a bug and not me missing something

I was having some unrelated issue with my machine, so I started from a fresh install

KDE neon 5.14
Kernel: x86_64 Linux 4.15.0-45-generic

(this basically Ubuntu 18.04 LTS)

I then installed OpenJDK 11

geokon@ux305-neon:~$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)

Then I downloaded the latest leiningen, added it to ~/.local/bin , rebooted and ran lein

Everything downloaded and "installed" just fine. When I run lein version I get:

Leiningen 2.9.0 on Java 10.0.2 OpenJDK 64-Bit Server VM

I create a new project with lein new app test-repl and go into it. Running lein repl everything work and I get

~/USB/Projects/test-repl $ lein repl
nREPL server started on port 42373 on host 127.0.0.1 - nrepl://127.0.0.1:42373
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 10.0.2+13-Ubuntu-1ubuntu0.18.04.4
    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

test-repl.core=> 

I tested simple (+ 1 1) commands and everything seems fine. Running (-main) also works

I then run Emacs. Running version I get:

GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-23, modified by Debian

In my init.el I have

(use-package cider
  :ensure t
  :init (setq org-babel-clojure-backend 'cider))

I open test-repl/src/test_repl/core.clj and run cider-jack-in . In the *Messages* buffer I see a line that read

[nREPL] Starting server via /home/geokon/.local/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0\"\] -- repl :headless :host localhost...

Note how here it's saying nrepl 0.5.3 and in the lein repl case it was saying 0.6.0. I have no idea where these version number come from. To double check I ran cider-version and got

CIDER 0.21.0snapshot (package: 20190125.1339)

which seems recent enough

I then switch to the buffer *nrepl-server Projects/test-repl:localhost* in which I see the following

Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Exception in thread "main" Syntax error compiling var at (/tmp/form-init14841299051483894984.clj:1:8941).
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.access$300(Compiler.java:38)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.eval(Compiler.java:7173)
    at clojure.lang.Compiler.eval(Compiler.java:7166)
    at clojure.lang.Compiler.eval(Compiler.java:7166)
    at clojure.lang.Compiler.load(Compiler.java:7635)
    at clojure.lang.Compiler.loadFile(Compiler.java:7573)
    at clojure.main$load_script.invokeStatic(main.clj:452)
    at clojure.main$init_opt.invokeStatic(main.clj:454)
    at clojure.main$init_opt.invoke(main.clj:454)
    at clojure.main$initialize.invokeStatic(main.clj:485)
    at clojure.main$null_opt.invokeStatic(main.clj:519)
    at clojure.main$null_opt.invoke(main.clj:516)
    at clojure.main$main.invokeStatic(main.clj:598)
    at clojure.main$main.doInvoke(main.clj:561)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:705)
    at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context
    at clojure.lang.Util.runtimeException(Util.java:221)
    at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
    ... 35 more

After a while I get all that in a giant error message with a Subprocess failed appended

Please let me know if I'm missing an information

Most helpful comment

Could you update to the latest version on MELPA (20190212.1312) and try again?

All 9 comments

I think @cichli just fixed this here
https://github.com/clojure-emacs/cider/pull/2579

Could you update to the latest version on MELPA (20190212.1312) and try again?

Oh yikes. So I guess I just had bad timing :)
I've updated and I can jack in now. Thanks for all your hard work on this - I really appreciate it. And I appreciate you guys getting back on this issue so fast

The only difference I'm seeing from before is that after I jack in (from test-repl/src/test_repl/core.clj or test-repl/project.clj ) I'm in the user namespace and not in the project namespace (here being test-repl). So the REPL line starts with a

user> 

So I just need to type out the full name to run -main , ie. (test-repl.core/-main)

@geokon-gh the user namespace is the expected namespace. I think lein offers a way to set an initial namespace but you need to specify it. Can you clarify if you are taking special steps to specify an initial namespace? If CIDER ignores this we have a problem but generally CIDER can't ignore tooling directives like that.

@dpsutton I just tried running the same exact app/files on another machine. The system has a slightly older Clojure installation - and it opened up on

test-repl.core> 

I set that machine up just a few weeks ago

;; CIDER 0.21.0snapshot (package: 20190125.1339), nREPL 0.5.3
;; Clojure 1.10.0, Java 11.0.1
~/USB/Projects/test-repl/src/test_repl $ lein -version
Leiningen 2.8.3 on Java 11.0.1 OpenJDK 64-Bit Server VM

I never did anything special to have it open up in the namespace - it was just the default behavior. But if you say the behavior is normal then I'll close the issue...

The version in melpa stable (0.20.0) has this bug

@geokon-gh You need to specify the initial ns to have the REPL open in that ns instead of user.

for me, version 0.21.0 has this issue:

  • cider 0.21.0
  • clj-refactor 20190117.1235
  • cider-eval-sexp-fu 20190123.1513
  • clojure-mode 20190217.226

and either lein 2.9 or 2.8.X

Retrieving cider/orchard/0.4.0/orchard-0.4.0.pom from clojars Retrieving cider/orchard/0.4.0/orchard-0.4.0.jar from clojars Retrieving cider/cider-nrepl/0.20.0/cider-nrepl-0.20.0.jar from clojars Retrieving cider/cider-nrepl/0.21.1/cider-nrepl-0.21.1.pom from clojars Retrieving cider/cider-nrepl/0.21.1/cider-nrepl-0.21.1.jar from clojars Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1). Exception in thread "main" Syntax error compiling var at (/private/var/folders/_m/_cdm11pn14lfmg_fg5z041ch0000gn/T/form-init7975803055163313277.clj:1:9303). at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114) at clojure.lang.Compiler.analyze(Compiler.java:6789) at clojure.lang.Compiler.analyze(Compiler.java:6745) at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108) at clojure.lang.Compiler.analyze(Compiler.java:6789) at clojure.lang.Compiler.analyze(Compiler.java:6745) at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108) at clojure.lang.Compiler.analyze(Compiler.java:6789) at clojure.lang.Compiler.access$300(Compiler.java:38) at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106) at clojure.lang.Compiler.analyze(Compiler.java:6789) at clojure.lang.Compiler.analyze(Compiler.java:6745) at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120) at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467) at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104) at clojure.lang.Compiler.analyze(Compiler.java:6789) at clojure.lang.Compiler.eval(Compiler.java:7173) at clojure.lang.Compiler.eval(Compiler.java:7166) at clojure.lang.Compiler.eval(Compiler.java:7166) at clojure.lang.Compiler.load(Compiler.java:7635) at clojure.lang.Compiler.loadFile(Compiler.java:7573) at clojure.main$load_script.invokeStatic(main.clj:452) at clojure.main$init_opt.invokeStatic(main.clj:454) at clojure.main$init_opt.invoke(main.clj:454) at clojure.main$initialize.invokeStatic(main.clj:485) at clojure.main$null_opt.invokeStatic(main.clj:519) at clojure.main$null_opt.invoke(main.clj:516) at clojure.main$main.invokeStatic(main.clj:598) at clojure.main$main.doInvoke(main.clj:561) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.lang.Var.applyTo(Var.java:705) at clojure.main.main(main.java:37) Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context at clojure.lang.Util.runtimeException(Util.java:221) at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106) ... 35 more Subprocess failed

interestingly something appears to still be pulling 0.20.0 (see first few lines)

Looks like it was because of lein-check-namespace-decls:
https://github.com/camsaul/lein-check-namespace-decls/issues/5

Was this page helpful?
0 / 5 - 0 ratings