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

ENOENT when running via podman #635

Open asymmetric opened 3 years ago

asymmetric commented 3 years ago

What's the problem you want solved?

I followed the Docker instructions, while under the hood using podman.

After bulding the image with docker build --tag oasis --file contrib/Dockerfile ., I tried running it with:

docker run --mount type=volume,src=ssb,target=/home/node/.ssb --publish 127.0.0.0:3000:3000 --rm oasis

(note: I had to specify type=volume above)

This failed with

2021-03-15T14:10:19.602Z oasis No configuration file found at /home/node/.config/oasis/default.json, using built-in default values.
2021-03-15T14:10:19.603Z oasis No custom style file found at /home/node/.config/oasis/custom-style.css, ignoring this stylesheet.
2021-03-15T14:10:20.790Z oasis Listening on http://0.0.0.0:3000
/home/node/app/src/index.js:132
    throw err;
    ^

Error: spawn xdg-open ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn xdg-open',
  path: 'xdg-open',
  spawnargs: [ 'http://0.0.0.0:3000' ]
}

Worth pointing out that I'm running NixOS, and that xdg-open is at /nix/store/41iyp469y2c9bpkg8rggyk2hr6w5m73z-xdg-utils-1.1.3/bin/xdg-open.

christianbundy commented 3 years ago

Thanks for reporting this problem. Could you try adding the --no-open flag?

asymmetric commented 3 years ago

That did get me further:

❯ podman run --mount type=volume,src=ssb,target=/home/node/.ssb --publish 127.0.0.0:3000:3000 --rm oasis node . --host 0.0.0.0 --allow-host localhost --no-open
WARN[0000] Found default OCIruntime /nix/store/hcr9g9vwvp3iqrh137qh80y7ai3ijbbi-crun-0.14.1/bin/crun path which is missing from [engine.runtimes] in containers.conf
WARN[0000] Found default OCIruntime /nix/store/hcr9g9vwvp3iqrh137qh80y7ai3ijbbi-crun-0.14.1/bin/crun path which is missing from [engine.runtimes] in containers.conf
WARN[0000] Found default OCIruntime /nix/store/hcr9g9vwvp3iqrh137qh80y7ai3ijbbi-crun-0.14.1/bin/crun path which is missing from [engine.runtimes] in containers.conf
2021-03-30T20:58:41.043Z oasis No configuration file found at /home/node/.config/oasis/default.json, using built-in default values.
2021-03-30T20:58:41.044Z oasis No custom style file found at /home/node/.config/oasis/custom-style.css, ignoring this stylesheet.
2021-03-30T20:58:42.131Z oasis Listening on http://0.0.0.0:3000
2021-03-30T20:58:42.145Z oasis Starting Scuttlebutt service
ssb-friends: stream legacy api used
about-name-warmup: 82.179ms

(Note that I had to re-specify the contents of CMD, because it gets overwritten by any args one passes to run - ENTRYPOINT would be a better choice, AFAIK)

Turns out that the instructions in docs/with-docker.md have an error: --publish 127.0.0.0:3000:3000 should be --publish 127.0.0.1:3000:3000.

After changing that, I can access oasis at 0.0.0.0:3000!

asymmetric commented 3 years ago

See #647 for a documentation fix re: port mapping.