Fork me on GitHub
#biff
<
2020-06-13
>
tbrooke02:06:39

I cloned Biff cd’d to example did ./task setup ./task dev - got repl connected, and did a build of app but nothing at localhost:8080 got some warnings in terminal but nothing looked fatal. Did I miss something?

foo03:06:25

no, that should be everything. Did you see a System started message in the terminal? Could you check if there's a file at biff/example/www/localhost/index.html? Would you mind pasting the output of ./task dev here?

tbrooke11:06:38

example git:(master) ✗ ./task dev system | Tmux socket name: overmind-example-dVQVZT69AyewrKw79q2PBY system | Tmux session ID: example system | Listening at ./.overmind.sock cljs | Started with pid 65979... repl | Started with pid 65978... cljs | shadow-cljs - config: /Users/tmb/Coding/Clojure/biff/example/shadow-cljs.edn cljs | shadow-cljs - starting via “clojure” 07:41:29.353 [main] INFO crux.hash.jnr - dlopen(libgcrypt.dylib, 9): image not found cljs | 07:41:29.378 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider 07:41:29.444 [main] INFO crux.hash - Using libcrypto (OpenSSL) for ID hashing. cljs | 07:41:30.315 [main] DEBUG io.undertow - starting undertow server [email protected] cljs | 07:41:30.325 [main] INFO org.xnio - XNIO version 3.7.2.Final cljs | 07:41:30.342 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.7.2.Final cljs | 07:41:30.456 [main] INFO org.jboss.threads - JBoss Threads version 2.3.2.Final cljs | 07:41:30.473 [XNIO-1 I/O-1] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-1’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.473 [XNIO-1 I/O-3] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-3’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.473 [XNIO-1 I/O-4] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-4’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.473 [XNIO-1 I/O-2] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-2’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.474 [XNIO-1 I/O-5] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-5’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.474 [XNIO-1 I/O-6] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-6’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.475 [XNIO-1 I/O-7] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-7’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.475 [XNIO-1 I/O-8] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 I/O-8’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.475 [XNIO-1 Accept] DEBUG org.xnio.nio - Started channel thread ‘XNIO-1 Accept’, selector http://sun.nio.ch[email protected] cljs | 07:41:30.478 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 9630 cljs | shadow-cljs - server version: 2.8.40 running at http://localhost:9630 cljs | shadow-cljs - nREPL server started on port 7890 07:41:34.802 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider Starting :biff.core/toggle-nrepl :example/core :biff/init :biff/console :biff/web-server 07:41:37.510 [main] DEBUG crux.memory - :pool-allocation-stats {:allocated 131072, :deallocated 0, :in-use 131072} repl | 07:41:37.525 [crux-tx-consumer] INFO crux.tx - Started tx-consumer repl | 07:41:37.528 [crux-tx-consumer] DEBUG crux.memory - :pool-allocation-stats {:allocated 262144, :deallocated 0, :in-use 262144} WARNING: An illegal reflective access operation has occurred repl | WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/tmb/.m2/repository/org/jboss/xnio/xnio-nio/3.3.6.Final/xnio-nio-3.3.6.Final.jar) to constructor http://sun.nio.ch.KQueueSelectorProvider() repl | WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2 repl | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations repl | WARNING: All illegal access operations will be denied in a future release 07:41:37.936 INFO [org.projectodd.wunderboss.web.Web] (main) Registered web context / repl | System started. cljs | 07:42:38.016 [XNIO-1 I/O-7] DEBUG io.undertow.websockets.core.request - Attempting websocket handshake with [email protected]2886b56 on HttpServerExchange{ GET /api/ws} cljs | 07:42:38.017 [XNIO-1 I/O-7] DEBUG io.undertow.request - Upgrading request HttpServerExchange{ GET /api/ws} cljs | 07:42:38.145 [XNIO-1 I/O-7] DEBUG io.undertow.websockets.core.request - UT025003: Decoding WebSocket Frame with opCode 1 cljs | 07:42:38.155 [XNIO-1 I/O-7] DEBUG io.undertow.websockets.core.request - UT025003: Decoding WebSocket Frame with opCode 1 cljs | 07:42:38.156 [XNIO-1 I/O-7] DEBUG io.undertow.websockets.core.request - UT025003: Decoding WebSocket Frame with opCode 1 cljs | 07:43:38.364 [XNIO-1 I/O-8] DEBUG io.undertow.request - Timing out idle connection from /0:0:0:0:0:0:0:1:65271 cljs | 07:43:41.841 [XNIO-1 I/O-1] DEBUG io.undertow.request - Timing out idle connection from /0:0:0:0:0:0:0:1:65270 cljs | 07:45:05.317 [XNIO-1 I/O-7] DEBUG io.undertow.websockets.core.request - UT025003: Decoding WebSocket Frame with opCode 1 cljs | 07:46:01.620 [XNIO-1 I/O-2] DEBUG io.undertow.request - Timing out idle connection from /0:0:0:0:0:0:0:1:65493

foo19:06:22

Everything looks good in that output. Going to localhost:8080 should serve files from biff/example/www/localhost/. Is there an index.html file in that directory?

tbrooke21:06:50

retried checked index.html - it contains a login form did a force compile in the shadow-cljs dashboard - no error messages - after a fairly long wait I get a 404

foo22:06:49

I think I've found the issue. I've pushed a new commit to Biff. Set :sha to "668ebd1ade0abf57ec5963a23fa8678819e5cb1e" in biff/example/config.edn and try running ./task dev again. The update (https://github.com/jacobobryant/biff/commit/668ebd1ade0abf57ec5963a23fa8678819e5cb1e) sets the default port to 8080 instead of nil. Immutant is supposed to default to 8080 anyway (and it has been for me at least), but evidently that's not happening in your environment for some reason.

tbrooke23:06:05

That helps but I get a “not found” at http://localhost:8080/index instead of a login

foo23:06:43

ok, progress at least. Can you add the following :example/debug component to example.core/components?

(def components
  [{:name :example/debug
    :requires [:biff/web-server]
    :start (fn [sys]
             (prn (select-keys sys [:biff.web/host->handler]))
             sys)}
   {:name :example/core
    :requires [:biff/init]
    :required-by [:biff/web-server]
    :start start-example}])
Then run ./task repl (`./task dev` is fine too, but it'll take longer since it starts shadow-cljs which we don't need for debugging this)

foo23:06:45

actually hold on for a second, I may need to update that component

foo23:06:13

ah I got the :requires field wrong. I've edited the code sample; go ahead and try that.

foo23:06:29

this is the output I get:

#:biff.web{:host->handler {"localhost" #object[ring.middleware.ssl$wrap_hsts$fn__13477 0x56cdcae6 "[email protected]"]}}
I suspect that the "localhost" key will not be present for you. If it is instead "http://example.com", that would suggest that the BIFF_ENV environment variable isn't getting set/read correctly, and thus the :dev portion of config.edn isn't being used. However... if that were the case, I'd expect Crux to try establishing a postgres connection and then failing. so let's just see what the output you get is and go from there.