Fork me on GitHub
#cider
<
2019-10-11
>
qythium07:10:04

I got a bunch of errors recently when working offline and just navigating around a file, it looks like eldoc is trying to connect to Clojuredocs and throwing an exception:

ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns ***, :symbol if-let, :session 40218e58-e5a0-427c-8f71-4b37ea36214f, :id 30160}
java.net.UnknownHostException: 
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
	at java.base/java.net.Socket.connect(Socket.java:591)
	at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)
	at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
	at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
	at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
	at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)
	at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1075)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1581)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
	...

qythium07:10:39

Is it a known issue? I recall seeing discussion about it recently but couldn't find any mention on the github page

bozhidar10:10:40

@qythium Supposedly we fixed this in the most recent Orchard release, which is used by CIDER 0.23.

bozhidar10:10:51

Perhaps you’re still on 0.22?

qythium10:10:59

I'm on 23.0 in emacs, but I start a repl in a terminal and then connect to it instead of jacking in, maybe the cider-nrepl dep is outdated

bozhidar10:10:43

You need cider-nrepl 0.22.4 if I recall correctly.

qythium10:10:10

That's odd, I specified {cider/cider-nrepl "RELEASE"} in my deps.edn thinking it would always pull the latest version, but it was in fact 0.21.1 according to clj -Stree

qythium10:10:18

thanks for the help!

bozhidar10:10:15

You’re welcome!

qythium13:10:46

Now I'm getting an odd middleware error on printing large data structures:

qythium13:10:19

(sorry for screenshot, the stacktrace doesn't appear anywhere else in the REPL output)

qythium13:10:44

I have no idea how to debug this further - any attempt to print values in the middleware functions results in a stackoverflow and having to restart the REPL

qythium13:10:02

but it looks like inside cider.nrepl.middleware.track-state/make-transport, the variable status is expected to be a set but it gets passed a list (:nrepl.middleware.print/truncated)

qythium13:10:09

here's an example input which triggers it, appears to be linked to the Emacs variable cider-print-quota

((fn gen [n]
   (if (zero? n) 0 {n (repeat n (gen (dec n)) )}))
 10)

bozhidar14:10:43

Why did you disable print streaming in Emacs?

bozhidar14:10:44

Although in general non-streamed prints should continue to function normally, so I’m not quite sure what’s the triggering the unhandled error.

bozhidar14:10:59

Btw, it seems your error is coming from the track-state middleware, but we haven’t changed this in ages and I’m wondering how can something like this happen.

qythium14:10:10

oh, what's print streaming? I didn't disable anything in Emacs as far as I know

bozhidar14:10:43

Basically it splits big results over multiple nREPL messages to improve the response time and to make it possible to interrupt printing some huge output.

bozhidar14:10:23

By default CIDER will enable streaming.

qythium05:10:01

again, I don't know how the internals work but changing that to "1" solved my issue

qythium15:10:32

hmm, I didn't disable that by setting cider-print-quota to nil, but changing the value of the quota changes the threshold where the error occurs.

qythium15:10:28

even stranger, the error only happens in a project with dozens of dependencies (which I can't share here), and then only when the REPL session is started outside of emacs and connected instead of jacked in.

qythium15:10:04

I'll try to investigate further and provide a minimal repro

jpmonettas15:10:41

hi everybody! I see orchard.inspect/def-current-value which is exactly what I was looking for but I see no reference to it in cider-nrepl, am I missing something or is just not implemented yet?