Local docker regression: REALTIME_IP_VERSION is ignored
Bug report
Describe the bug
Running a self-hosted instance on a server with ipv6 disabled is not working.
According the doc, setting the environment variable REALTIME_IP_VERSION to the value ipv4 should make the server bind to ipv4 only, but we still get the error:
num_acceptors: 100,
max_connections: 1000,
socket_opts: [
:inet6,
{:port,
4000}
]
}) for reason :eafnosupport (address family not supported by protocol family)
This looks like a regression as this was supposed to be fixed: https://github.com/supabase/realtime/pull/253
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Disable ipv6 on your server
- Add the environment variable REALTIME_IP_VERSION in the docker compose
- run
docker compose up -d - Check the logs
docker logs realtime-dev.supabase-realtime
Expected behavior
Container realtime-dev.supabase-realtime crashes
System information
- OS: RHEL9
@jbertozzi I think https://github.com/supabase/supabase/issues/13816 gives some clarity. Honestly, they just REALLY don't care about the open source/self-hosting side of things. We could fork of course... But honestly, they just simply don't care.
FYI @aantti
Thanks for flagging, I'll take a look.
@jbertozzi Curious, what is the Realtime version you're trying to use? 🤔
@aantti I tried on the latest and greatest from 2 weeks ago and still faced the same issue - hence me finding this topic and rudely inserting myself!
@AntonOfTheWoods No problem at all - but what stumps me quite a bit is that I can't seem to find REALTIME_IP_VERSION anywhere in the Realtime codebase (there's DB_IP_VERSION but it's for something else). If I'm not mistaken, it's been deprecated and removed quite a long time ago (in 2022?).
I haven't seen any issues with Realtime and IPv4-only hosts, I tested it again yesterday with 2.76.5 and it correctly works without IPv6 enabled. In fact, I believe - unless specifically enabled, self-hosted Supabase containers won't have IPv6 configured.
Adding REALTIME_IP_VERSION="ipv4" to the environment doesn't affect current Realtime.
@jbertozzi Are you running just Realtime or self-hosted Supabase, btw? Still curious, what version, what exact environment, and how to possibly recreate what you're dealing with.
@aantti thanks for the update. It explains a few things! Are you saying that you have successfully launched it on hosts that had ipv6 disabled in the linux boot cmd, i.e, GRUB_CMDLINE_LINUX_DEFAULT="... ipv6.disable=1 ..."?
@AntonOfTheWoods No, I was primarily referring to the REALTIME_IP_VERSION not being a configuration option anymore, and that on a no-IPv6-address-configured VPS (but with IPv6 stack still present), it works 😢
I've just rented a dedicated server, disabled IPv6 fully via grub settings, and I can confirm - when no IPv6 in the kernel, Realtime is failing as described above (as does Studio, btw - but that's because of the current HOSTNAME configuration in docker-compose.yml).
I'll pass this to the Realtime team.
I've just rented a dedicated server, disabled IPv6 fully via grub settings, and I can confirm - when no IPv6 in the kernel, Realtime is failing as described above (as does Studio, btw - but that's because of the current
HOSTNAMEconfiguration indocker-compose.yml).
Yep, I found and fixed the Studio issue - very simple. My initial searched suggested that sort of thing would also work for realtime, given the "fix" that was done back a few years ago.
And thanks for going to all that trouble. An incus/lxc or lima VM would have sufficed - that's what I'm using but that is definitely industrial level repro!
I'll pass this to the Realtime team.
You're a gentleman and a scholar!
:tada: This issue has been resolved in version 2.83.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: