fraction / oasis

Free, open-source, peer-to-peer social application that helps you follow friends and discover new ones on Secure Scuttlebutt (SSB).
http://oasis-demo.fraction.io
GNU Affero General Public License v3.0
286 stars 42 forks source link

Can't start Oasis if loopback device has IPv6 address (OpenBSD) #464

Closed rapenne-s closed 3 years ago

rapenne-s commented 3 years ago

What's the problem you want solved?

I'm trying to run Oasis on OpenBSD 6.8

  oasis No configuration file found at /home/test/.config/oasis/default.json, using built-in default values. +0ms
  oasis Listening on http://localhost:3000 +855ms
  oasis Starting Scuttlebutt service +0ms
/home/test/oasis/src/index.js:107
    throw err;
    ^

Error: listen EINVAL: invalid argument ::1:8989
    at Server.setupListenHandle [as _listen2] (net.js:1292:21)
    at listenInCluster (net.js:1357:12)
    at doListen (net.js:1496:7)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
Emitted 'error' event on WebSocketServer instance at:
    at Server.WebSocketServer._onServerError (/home/test/oasis/node_modules/ws/lib/WebSocketServer.js:82:50)
    at Server.emit (events.js:311:20)
    at emitErrorNT (net.js:1336:8)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'EINVAL',
  errno: 'EINVAL',
  syscall: 'listen',
  address: '::1',
  port: 8989
}

I tried to force the host to be 127.0.0.1 with the config file /home/test/.config/oasis/default.json without better result.

{
 "host": "127.0.0.1"
}

I tried following the build git (git clone, cd into and npm install --only=prod), and I start oasis with node . from the sources directory.

Is there a solution you'd like to recommend?

Disabling all IPv6 address on the loopback device allows to start oasis. This is really a workaround and I don't recommend using it.

ifconfig lo0 -inet6

Default ifconfig lo0 output

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
    index 3 priority 0 llprio 3
    groups: lo
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
    inet 127.0.0.1 netmask 0xff000000
christianbundy commented 3 years ago

Sorry you're facing this. I don't have a fix, but I'm guessing it's probably somewhere deep in the stack. Is there any interesting info if you run with export DEBUG='*' oasis?

rapenne-s commented 3 years ago

While trying to run ssb-server separately (for patchfoo) I got the exact same error so I'll report this to ssb-server.