Subject: Application Cannot Connect to External Supabase DB - ENETUNREACH (IPv6)
arnoold
FREEOP

2 months ago

Hello Railway Team,

My application is unable to connect to my external Supabase database and is consistently failing with the following error: Database connection failed: connect ENETUNREACH 2600:1f1c:f9:4d0f:4da5:5ed2:f4d1:7fb5:5432

Here are the details:

  • Railway Project:YT-manage-V4

  • Latest Deployment ID:d967ebf2 (or provide the latest one)

  • Database Host:db.ychabajmtnknhhmxqqvk.supabase.co

We have already performed extensive troubleshooting and can confirm the following:

  1. Environment variables are correctly loaded by the application.

  2. Supabase firewall is completely open. We have confirmed that rules for 0.0.0.0/0 (all IPv4) and ::/0 (all IPv6) are active in our Supabase project's Network Restrictions.

  3. We have tried to force IPv4 connections, both via the start command (--dns-result-order=ipv4first) and programmatically within the Node.js application (dns.setDefaultResultOrder('ipv4first')). Neither method worked; the application still attempts to connect via IPv6 and fails.

Given that the firewall is open and IPv4-forcing methods have failed, this strongly suggests an issue within the Railway networking environment that is preventing outbound connectivity to our Supabase host.

Could you please investigate this from your end?

Thank you.

Solved$10 Bounty

4 Replies

Railway
BOT

2 months ago


brody
EMPLOYEE

2 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 2 months ago


uxuz
MODERATOR

2 months ago

Hey, you are trying to connect to Supabase via their direct connection which is currently not supported as it is IPv6, unless you purchase an additional add on on Supabase to make it also be available on IPv4. Please use one of the pooler connections Supabase provide, as they are IPv4 compatible.

Attachments


catalinzugravu
HOBBY

2 months ago

Switch your Railway DATABASE_URL to the Supavisor (pooler) connection string.


noahd
EMPLOYEE

2 months ago

Hey there! The docs talk about this but outbound ipv6 is not allowed and will fail.

https://docs.railway.com/reference/outbound-networking#outbound-ipv6


Status changed to Solved brody 2 months ago


Loading...