Hello! Why does running 0.8.0-alpha5 via tools deps with :main-opts ["-m" "nrepl.cmdline" "--port" "9832"]
fail with
> Execution error (AssertionError) at nrepl.core/connect (core.clj:168).
> Assert failed: port
? I expected it to start the server at the given port, not trying to connect to one?! What do I do wrong? Thank you!
How are you invoking clojure
?
I have an alias like this in my deps.edn
:
:aliases {:nrepl/server {:extra-deps {nrepl {:mvn/version "0.8.0-alpha5"}}
:main-opts ["--main" "nrepl.cmdline" "--port" "1234"]}}
And I invoke it like this:
$ clojure -A:nrepl/server
And it works fine.Also, have you tried -Srepro
? Maybe there’s something in your ~/.clojure/deps.edn
that causes the issue.
(Also, on an unrelated note, I absolutely despise how Slack won’t let me just use Markdown any more…)
Thanks a lot! The solution was simple: rm ~/.clojure/deps.edn
🙂 I had the nrepl profile defined there as well, differently. Surprisingly the local deps.edn does not take precedence...
Well, you could have just removed the alias instead of deleting the whole file, but I’m glad the issue’s solved. 🙂
sure 🙂
Question 2: After having started a server as described above ☝️ I try to connect to it (same options plus --connect
) but it fails with
> Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response
Why? Thank you!
☝️ fixed it by downgrading to alpha1
$ clojure -Srepro -Sdeps '{:deps {nrepl {:mvn/version "0.8.0-alpha5"}}}' --main nrepl.cmdline --port 1234
Followed by:
clojure -Srepro -Sdeps '{:deps {nrepl {:mvn/version "0.8.0-alpha5"}}}' --main nrepl.cmdline --connect --port 1234
Seems to work for me.You could maybe add -J-Dclojure.main.report=stderr
to your command-line invocation and show us the full stack trace — that might be helpful.
Thank you! I found the problem. I am running it inside a Docker container and thought that the default bind addr. of 127.0.0.1 is ok when I map the docker port to a local port but obviously not. So the fix was to add -b 0.0.0.0
to the server inside Docker