Hi all,
One of my users is reporting a very strange issue with nREPL,
Cursive #290. The summary is that for their large main application, when they connect with the REPL from Cursive they get a ConnectException: Operation timed out. The REPL is started with Leiningen, and this works fine from the command line. This affects everyone in their office and also happens when they work from home, which makes me think it's not an obvious issue with their network config, at least. Oddly, smaller toy projects work fine so I think I can rule out firewall issues.
One potential problem I've found is that I was binding the server to 127.0.0.1 but connecting the client to localhost. I saw in the lein code that they changed that a while back because of unspecified IPV6 issues. Reading around, I believe that's just in case the user has ::1 ahead of 127.0.0.1 in their hosts file. In any case if that were the problem I'd expect a connection refused, not a timeout. Either way, I've given them a dev build to test and I'm waiting to hear back.
The code I'm using to connect is fairly unexceptional:
(repl/print state (str "Connecting to " description "...\n"))
(if-let [connection (try
(nrepl/connect :host host :port port)
(catch Exception e
(print-exception state "Error connecting" e)
(stop state)
nil))]
According to their report, the error is definitely in the nrepl/connect call.
One thing that is different between Cursive and lein is the JVM used. They're on macs, so they're running Cursive under an Apple 1.6 JVM but lein under an Oracle (or maybe OpenJDK, now that I think of it) 1.7 JVM. This gave them previous issues with client certs when connecting to clojars, but I'm not sure how that would affect this.
Does anyone have any idea what might be going on here? I must admit I'm running out of ideas - any suggestions gratefully accepted.