lustre-labs / dev-tools

Lustre's CLI and development tooling: zero-config dev server, bundling, and scaffolding.
55 stars 18 forks source link

Socket error: Eafnosupport #29

Closed phstrauss closed 7 months ago

phstrauss commented 7 months ago

Hello Lustre dev team, I've got an error using Lustre 4.1.8 on a Linux Debian box with Gleam 1.1.0 installed using Nix, it's probably on my side, something missing on my system. Here mycofront.gleam is the third example available in Lustre git of the day. I've added lustre and lustre_ui to my project.

My gleam.toml file:

name = "mycofront"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "username", repo = "project" }
# links = [{ title = "Website", href = "https://gleam.run" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
gleam_stdlib = ">= 0.34.0 and < 2.0.0"
lustre = ">= 4.1.8 and < 5.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
lustre_dev_tools = ">= 1.2.2 and < 2.0.0"
lustre_ui = ">= 0.6.0 and < 1.0.0"

Then invoking "gleam run -m lustre/dev start" it fails with:

  Compiling lustre_dev_tools
  Compiling lustre_ui
  Compiling mycofront
   Compiled in 18.87s
    Running lustre/dev.main
=ERROR REPORT==== 25-Apr-2024::15:19:54.519824 ===
backend port not found: inotifywait

✅ Project compiled successfully
⠼ Downloading from https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.10.tgz=WARNING REPORT==== 25-Apr-2024::15:20:14.500323 ===
Description: "Server authenticity is not verified since certificate path validation is not enabled"
     Reason: "The option {verify, verify_peer} and one of the options 'cacertfile' or 'cacerts' are required to enable this."

✅ Esbuild installed!
✅ Bundle produced at `./priv/static/mycofront.mjs`
=ERROR REPORT==== 25-Apr-2024::15:20:19.714648 ===
backend port not found: inotifywait

I ran into an error while trying to start the development server. Here's the
error message I got:

    AcceptorFailed(Abnormal("Child failed to start during initialisation: Abnormal(\"Socket error: Eafnosupport\")"))

Please open an issue at https://github.com/lustre-labs/dev-tools/issues/new with
some details about what you were trying to do when you ran into this issue.

What am I missing?

phstrauss commented 7 months ago

Note that I've disabled IPv6 in my kernel. Could it be it? I've now installed inotify-tools but still the same error. Erlang is from Debian.

hayleigh-dot-dev commented 7 months ago

The install instructions call out that Linux users need both inotify-tools and a C compiler available. I am not familiar with Nix and I don't use it, but I would guess you don't have one available so the port is not being built.

Could you make sure you have a C compiler available in the project and try again, and get back to me if it's still not working.

phstrauss commented 7 months ago

Hello,

Yes I have (and already had) a C compiler, gcc:

(.pylocal) catseye@PulseG2:~/VMs$ cc -v
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 13.2.0-23' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-13 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-libstdcxx-backtrace --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/reproducible-path/gcc-13-13.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/reproducible-path/gcc-13-13.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.0 (Debian 13.2.0-23)

I had gleam 1.0.0 and lustre 4.1.2 working on the same box some days back, then reinstalled nix and installed gleam 1.1.0.

hayleigh-dot-dev commented 7 months ago

I poked around some more and I can only guess how you've added inotify-tools with Nix has not worked 😅 If you search around you might be able to find some examples for phoenix and adapt those.

Elixir Phoenix also uses the same underlying library for file watching stuff so there's bound to be a flake or a nix-shell script or something you can adapt!

phstrauss commented 7 months ago

I rebooted using the Debian default kernel, and it works, then enabled IPv6 in my custom kernel, rebuilt it and rebooted, and it works, so this was definitively IPv6. The code from the development server could emit a warning rather than bailing out when it can't create a socket for IPv6. Thanks for your time it's solved on my side.

hayleigh-dot-dev commented 7 months ago

No part of the code does ipv6 things. Not in fs and not in the dev tools. I'm glad you got it working but I think that might have been a coincidence!