Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL does not automatically select .shadow-cljs/nrepl.port for nREPL connection type #2759

Closed
jdhollis opened this issue Dec 25, 2022 · 2 comments
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@jdhollis
Copy link

Hi, Colin.

Ran into an issue with “Use standard port file” with an “nREPL” connection type to shadow-cljs. It seems that .shadow-cljs/socket-repl.port is being picked up instead, resulting in the following exception:

Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response: Disconnected from remote server.

If I explicitly specify .shadow-cljs/nrepl.port, everything works as expected.

Screen Shot 2022-12-25 at 2 40 51 PM

For reference, I’m using IntelliJ 2022.3.1 (Build #IU-223.8214.52) with Cursive 1.12.7-eap1-2022.3.

@zampino
Copy link

zampino commented Jan 31, 2023

I actually do have the same issue after upgrading to Cursive 1.12.7 2022.3 - IntelliJ IDEA 2022.3.2 (CE).
My nREPL is started by an external process and puts a file .nrepl-port at project source root.

My setting: Edit Configurations > Remote REPL > Use port from REPL file > Use standard port file no longer works and produces:

Connecting to remote nREPL server...
Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response: Disconnected from remote server.

Our nREPL is not started by shadow, and it produces a regular .nrepl-port file. In fact, by setting the option Specify custom port file to .nrepl-port it does connect fine as mentioned by @jdhollis.

@zampino
Copy link

zampino commented Feb 13, 2023

This is the stacktrace from IntelliJ:

java.lang.Throwable: Error reading from nREPL client
java.lang.ArithmeticException: long overflow
 at java.lang.Math.multiplyExact (Math.java:1004)
    clojure.lang.Numbers.multiply (Numbers.java:1971)
    nrepl.bencode$read_long.invokeStatic (bencode.clj:129)
    nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
    nrepl.bencode$read_long.invokeStatic (bencode.clj:127)
    nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
    nrepl.bencode$read_long.invokeStatic (bencode.clj:127)
    nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
    nrepl.bencode$read_long.invokeStatic (bencode.clj:127)
    nrepl.bencode$read_long.invokePrim (bencode.clj:-1)
    nrepl.bencode$read_netstring_STAR_.invokeStatic (bencode.clj:156)
    nrepl.bencode$read_netstring_STAR_.invoke (bencode.clj:154)
    nrepl.bencode$read_token.invokeStatic (bencode.clj:247)
    nrepl.bencode$read_token.invoke (bencode.clj:237)
    nrepl.bencode$read_bencode.invokeStatic (bencode.clj:257)
    nrepl.bencode$read_bencode.invoke (bencode.clj:254)
    nrepl.transport$bencode$fn__4147$fn__4148.invoke (transport.clj:113)
    nrepl.transport$bencode$fn__4147.invoke (transport.clj:113)
    nrepl.transport$fn_transport$fn__4112.invoke (transport.clj:42)
    clojure.core$binding_conveyor_fn$fn__5823.invoke (core.clj:2047)
    clojure.lang.AFn.call (AFn.java:18)
    java.util.concurrent.FutureTask.run (FutureTask.java:264)
    java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    java.lang.Thread.run (Thread.java:833)

	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
	at cursive.logging$do_error.invokeStatic(logging.clj:60)
	at cursive.logging$do_error.invoke(logging.clj:59)
	at cursive.logging$do_log.invokeStatic(logging.clj:45)
	at cursive.logging$do_log.doInvoke(logging.clj:38)
	at clojure.lang.RestFn.invoke(RestFn.java:464)
	at cursive.repl.nrepl$start$reify__5248.run(nrepl.clj:151)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:246)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

@cursive-ide cursive-ide added this to the 1.12.8 milestone Mar 9, 2023
@cursive-ide cursive-ide modified the milestones: 1.12.8, 1.12.8-eap4 Mar 13, 2023
@cursive-ide cursive-ide added the bug Marks issues describing bugs label Mar 13, 2023
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

3 participants