Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fly.io gossip glomers challenge 1 doesn't work with a binary file generated from a js file. #90

Closed
aca123321 opened this issue Jul 31, 2024 · 5 comments

Comments

@aca123321
Copy link

aca123321 commented Jul 31, 2024

I'm using the following command to attempt the challenge 1:
./maelstrom test -w echo --bin "../node_solutions/echo/maelstrom-echo" node-count 1 --time-limit 10

What I observe is the following error (I've attached the relevant logs (zipped) for your reference too.
20240730T215850.374+0530.zip)

clojure.lang.ExceptionInfo: Node n1 crashed with exit status 1. Before crashing, it wrote to STDOUT:



And to STDERR:

node:events:515
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE: address already in use :::3001
    at Server.setupListenHandle [as _listen2] (node:net:1422:16)
    at listenInCluster (node:net:1470:12)
    at Server.listen (node:net:1558:7)
    at Function.listen (/snapshot/echo/node_modules/express/lib/application.js:635:24)
    at Object.<anonymous> (/snapshot/echo/out.js)
    at Module._compile (pkg/prelude/bootstrap.js:1926:22)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1979:12)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1449:8)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)
    at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:64:3)
    at Function.runMain (pkg/prelude/bootstrap.js:1980:13)
    at node:internal/main/run_main_module:17:47 {
  code: 'EADDRINUSE',
  errno: -48,
  syscall: 'listen',
  address: '::',
  port: 3001
}

Node.js v18.5.0

Full STDERR logs are available in /Users/aca123321/Desktop/Personal/Fly io distriibuted systems challenges/maelstrom/store/echo/20240730T215850.374+0530/node-logs/n1.log
        at slingshot.support$stack_trace.invoke(support.clj:201)
        at maelstrom.process$stop_node_BANG_.invokeStatic(process.clj:239)
        at maelstrom.process$stop_node_BANG_.invoke(process.clj:217)
        at maelstrom.db$db$reify__16142.teardown_BANG_(db.clj:75)
        at jepsen.db$fn__8744$G__8725__8748.invoke(db.clj:12)
        at jepsen.db$fn__8744$G__8724__8753.invoke(db.clj:12)
        at clojure.core$partial$fn__5908.invoke(core.clj:2642)
        at jepsen.control$on_nodes$fn__8599.invoke(control.clj:314)
        at clojure.lang.AFn.applyToHelper(AFn.java:154)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990)
        at clojure.lang.RestFn.applyTo(RestFn.java:142)
        at clojure.core$apply.invokeStatic(core.clj:671)
        at clojure.core$bound_fn_STAR_$fn__5818.doInvoke(core.clj:2020)
        at clojure.lang.RestFn.invoke(RestFn.java:408)
        at dom_top.core$real_pmap_helper$build_thread__211$fn__212.invoke(core.clj:163)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:667)
        at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.RestFn.applyTo(RestFn.java:132)
        at clojure.core$apply.invokeStatic(core.clj:671)
        at clojure.core$bound_fn_STAR_$fn__5818.doInvoke(core.clj:2020)
        at clojure.lang.RestFn.invoke(RestFn.java:397)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.base/java.lang.Thread.run(Thread.java:1583)```
        
               
        
@aca123321
Copy link
Author

aca123321 commented Jul 31, 2024

BTW, the binary file works perfectly fine on its own though and I've checked multiple times to make sure that no other process is assigned the port 3001 in both the cases.

Screenshot 2024-07-31 at 8 39 03 PM

@aca123321
Copy link
Author

here's the node that'd handle the requests (running on port 3001)
echo.zip

@aca123321 aca123321 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
@aca123321
Copy link
Author

handlers are different. An express web server is not what's required here

@aphyr
Copy link
Contributor

aphyr commented Jul 31, 2024

I'm not sure why you're getting this with --node-count 1, which should spawn only one copy of your process, but presumably something else has bound the port. Find that process and you'll have your answer. :-)

You, uh, don't need to bind any network ports at all, by the way. I assume you've got some other reason for doing this, but debugging it is sort of out of scope for Maelstrom.

@yaseen-un
Copy link

I found the node.js used in the demo post creating this issue. This is resolved now. Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants