Closed edenworky closed 8 months ago
Interesting--I just tried creating a new project on my own machine and it works there, so there must be some environmental difference. If you run sudo netstat -nlp | grep 8080
before running bb dev
, does that return anything?
Before, there's nothing. After I run it and I get the error, I get
tcp6 0 0 :::8080 :::* LISTEN 62893/java
Edit: Wow, I'm never replying on email again
hmmmm
quite befuddling. can you try running something else on port 8080 and see if it works? like nc -l -p 8080
I think (not at my computer to verify that's the right command), and then try a curl http://localhost:8080
just to be sure it's working.
if that works, the next step I suppose would be to comment out the use-jetty
line in your app's main namespace, then run bb dev
, then while it's running try the netstat
again.
What operating system are you on by the way?
I can host lots of stuff on :8080
, not sure if I understood your meaning. I can run nc
like you said and see an incoming request, works as expected to my understanding.
I use Pop!_OS Linux pop-os 6.5.6-76060506-generic #202310061235~1697396945~22.04~9283e32 SMP PREEMPT_DYNAMIC Sun O x86_64 x86_64 x86_64 GNU/Linux
. It's usually equivalent to Ubuntu.
When I comment out use-jetty
, bb dev
finishes booting up and says it's listening on :8080
(which doesn't show up in netstat
) and the REPL is on :7888
(which does show up in netstat
).
I can host lots of stuff on :8080, not sure if I understood your meaning.
OK, good--just wanted to run an additional check that there wasn't something else running on 8080
.
I still have no clue how Biff could be triggering this error, but we can just keep trying to narrow it down. Let's try from two directions:
First, can you run the following from your Biff project directory without getting errors?
$ clj
Clojure 1.11.1
user=> (require '[ring.adapter.jetty9 :as jetty])
nil
user=> (jetty/run-jetty (constantly {:status 200, :body "hello"}) {:host "0.0.0.0", :port 8080})
[main] INFO org.eclipse.jetty.server.Server - jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 17.0.9+9-Ubuntu-120.04
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@5b4d25e7{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@38704ff0{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
[main] INFO org.eclipse.jetty.server.Server - Started Server@267517e4{STARTING}[10.0.7,sto=0] @3472ms
# in another terminal:
$ curl http://localhost:8080
hello
That's ultimately what the use-jetty
component runs.
Second, if you uncomment the use-jetty
component but comment out the use-xt
, use-queues
, and use-tx-listener
components, and then you run bb dev
, does the error still happen? If yes, then what if instead of bb dev
you run source secrets.env; BIFF_ENV=dev clj -M -m com.example
(replacing com.example
with whatever you chose for your project's main namespace--though from the stacktrace earlier it looks like you left it as com.example
)?
I'll go ahead and close this, but happy to reopen if you want to continue debugging this together.
On running
bb dev
in a fresh install, it sayslocalhost:8080
is already in use even though it's not before I run it, and afterwards there's a hanging java process listening onlocalhost:8080
which I have to kill manually.This is what it prints to the terminal:
This is the full error log: