dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
2016-12-10T15:33:14.000256Z

Hi, I am trying the dirac-sample for leaning how to use dirac for my other cljs proj., but haven't succeeded with the err msg like "Unable to bootstrap ClojureScript REPL due to a timeout." On repl console, I found the msg.

user=> Dec 09, 2016 3:04:03 AM clojure.tools.logging$eval436$fn__440 invoke
SEVERE: [NREPLTunnelServer#1 of [NREPLTunnel#1]] Received a bootstrap timeout from client [WebSocketServerClient#1] :
 {:op :bootstrap-timeout}
I'm not sure the issue is caused by the timeout, but.. do anyone know how I could change the timeout param?

2016-12-10T15:34:00.000258Z

@tf0054 I would first suggest looking at output from your Dirac Agent console

2016-12-10T15:34:21.000259Z

we could also run agent with debug logging enabled to see more

2016-12-10T15:36:04.000260Z

@darwin Thank you! I will check the Agent param for having debug logging.

2016-12-10T15:36:29.000261Z

wait a bit, I have to find it, it is probably not documented well

2016-12-10T15:36:40.000262Z

so what do you see now in your nREPL terminal (or agent terminal)

2016-12-10T15:39:05.000263Z

@darwin Ah, I didnt write exactly but the quoted msg on my previous post was on the nREPL

2016-12-10T15:39:44.000264Z

that was just a reaction to client timeouting, there should be something more interesting before it

2016-12-10T15:40:22.000265Z

@tf0054 ok, put this to your nrepl :init https://github.com/binaryage/dirac-sample/blob/master/project.clj#L118-L119

2016-12-10T15:41:00.000267Z

or run repl-dev if you are playing with the sample

2016-12-10T15:41:01.000268Z

Hmm. I hope so, but whole msg is like

tf0054@ff204842e21b:~/work/dirac-sample$ lein repl
nREPL server started on port 8230 on host 127.0.0.1 - <nrepl://127.0.0.1:8230>
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0-alpha13
OpenJDK 64-Bit Server VM 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14
    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

user=&gt;
Dirac Agent v0.8.5
Connected to nREPL server at <nrepl://localhost:8230>.
Agent is accepting connections at <ws://localhost:8231>.

user=&gt;

user=&gt; Dec 09, 2016 3:04:03 AM clojure.tools.logging$eval436$fn__440 invoke
SEVERE: [NREPLTunnelServer#1 of [NREPLTunnel#1]] Received a bootstrap timeout from client [WebSocketServerClient#1] :
 {:op :bootstrap-timeout}

user=&gt;

2016-12-10T15:41:12.000269Z

hmm, not useful

2016-12-10T15:41:22.000271Z

I agree 🙂

2016-12-10T15:44:10.000272Z

@tf0054 ah, it would need checkouts, because “dirac.logging” is not part of the public release

2016-12-10T15:44:36.000273Z

you should make it work with this: mkdir checkouts

2016-12-10T15:44:44.000274Z

cd checkouts

2016-12-10T15:45:12.000275Z

git clone <https://github.com/binaryage/dirac.git>

2016-12-10T15:45:43.000276Z

git clone <https://github.com/binaryage/cljs-devtools.git>

2016-12-10T15:46:07.000277Z

this should make lein repl-dev work

2016-12-10T15:47:25.000278Z

I should probably package dirac.logging[1] with dirac library next time https://github.com/binaryage/dirac/tree/master/src/logging/dirac

2016-12-10T15:53:03.000280Z

@darwin Oh. I see, but do you mean I need to compile the Chrome extension to get additional logs? I will try!

2016-12-10T15:53:10.000281Z

no

2016-12-10T15:53:20.000283Z

I want to see what is happening on your nREPL + agent side

2016-12-10T15:53:28.000284Z

at this point

2016-12-10T15:53:43.000285Z

btw. the timeout should be 30s which should be more than enough

2016-12-10T15:54:20.000288Z

you think it timeouts sooner than 30s in your case?

2016-12-10T15:54:48.000289Z

Yes, normally it needs around 10sec.

2016-12-10T15:55:18.000291Z

hmm

2016-12-10T15:55:48.000292Z

ok, try to run that lein repl-dev we will see more

2016-12-10T15:56:03.000293Z

I feel the msg(Unable to bootstrap...) on Dirac console would be shown in 10sec, not 30sec

2016-12-10T15:56:12.000294Z

Thanks I will

2016-12-10T15:57:48.000296Z

chances are, that it does not respect the default from runtime prefs and uses this super-default 5s timeout: https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/nrepl_tunnel_client.cljs#L149

2016-12-10T15:58:14.000298Z

let me check that real quick

2016-12-10T16:06:53.000299Z

Oh.. I didnt know why but I could start repl-dev now (in "checkouts" dir) now according your advice.

2016-12-10T16:06:56.000300Z

btw. that 30s timeout setting propagates on my machine (dev build): https://dl.dropboxusercontent.com/u/559047/dirac-agent-timeout-opts.png

2016-12-10T16:08:05.000303Z

you don’t have to be in checkouts dir

2016-12-10T16:08:25.000304Z

checkouts dir is a lein’s mechanism how to replace some deps with your “dev” versions

2016-12-10T16:08:49.000305Z

we need dirac checkout because dirac.logging is missing in public dirac.jar

2016-12-10T16:14:13.000306Z

I’m looking at the code and don’t see any reason why it should timeout early

2016-12-10T16:18:26.000311Z

I am using the clojure on my docker container on win10 and win10:8080 is mapped to docker's 9977

2016-12-10T16:18:58.000313Z

hmm, so the problem must be in the extension, it gets :bootstrap-info and probably throws or fails somehow

2016-12-10T16:19:19.000314Z

can you look into devtools console of the dirac window? (change the type in extension prefs)

2016-12-10T16:20:16.000317Z

@tf0054 just to make sure, are you using the latest Chrome Canary, right?

2016-12-10T16:20:55.000318Z

btw. Docker is great, but you could be running into some networking issues as well

2016-12-10T16:21:25.000319Z

I am using Chromium Version 57.0.2941.0 (64-bit) downloaded through your release note!

2016-12-10T16:21:30.000320Z

are you docker run your container with —network=host ? or using the default bridge config?

2016-12-10T16:22:09.000322Z

Sorry I will come back online in few hours, but now I have to go bc the cafe is closing now 🙂

2016-12-10T16:22:20.000323Z

ok, np, see you then

2016-12-10T18:54:25.000327Z

on a treadmill

2016-12-10T18:54:38.000328Z

will be back in 30mmins

2016-12-10T18:55:29.000329Z

Aw 🙂 nice.

2016-12-10T20:07:17.000343Z

@tf0054 I’m back, you need port 8231 for agent connection (aka nrepl tunnel) and then 8232-8242 for weasel server(s), agent also needs to connect to nREPL server (8230), but that happens on the host machine so it should not be a problem in docker scenario

2016-12-10T20:19:55.000344Z

@darwin I see. thanks! I appreciate your great support and am excited to have Dirac. The breakpoint is the thing I really want to use.

2016-12-10T20:20:14.000345Z

cool, you are welcome

2016-12-10T20:21:35.000346Z

btw. bleeding edge devtools could be buggy from time to time, better stick to latest versions or stick to specific chromium builds https://github.com/binaryage/dirac/blob/master/docs/faq.md#how-do-i-stick-to-a-particular-dirac-version

2016-12-10T21:29:11.000348Z

I see and will use the extension installed locally. thanks!