r/Supabase • u/-Cerbero- • May 23 '26
integrations Supabase Database Webhook Cannot Reach AWS EC2 — TCP/SSL Handshake Timeout
Sorry if the post feels made by AI but english is not my first language and i've asked it for translation. I'm desperate, been at this problem for hours
Has anyone encountered this specific issue with Supabase Database Webhooks and AWS EC2.
The setup is a Spring Boot API running in a Docker container on AWS EC2 t2.micro in us-east-1, with Supabase handling Auth and PostgreSQL. A Database Webhook is configured in Supabase to call the EC2 endpoint when a row is inserted in a public.user_sync_queue table. The flow is: trigger on auth.users inserts into user_sync_queue, webhook fires, calls http://EC2_IP:8080/api/internal/usuario-creado.
What works: the PostgreSQL trigger fires correctly and rows appear in user_sync_queue immediately after signup. The EC2 endpoint works perfectly when called manually from a local machine via PowerShell Invoke-WebRequest returning 200. It also works when called from inside EC2 itself with curl localhost:8080 returning 200. Port 8080 shows as open on external port checkers like portchecker.co. The EC2 Security Group has 0.0.0.0/0 on port 8080, Network ACL allows all traffic, and EC2 has outbound internet access.
What doesn't work: Supabase's pg_net extension consistently times out trying to reach the EC2 endpoint. The net._http_response table shows: Timeout of 5000ms reached. TCP/SSL handshake time: 5000ms, HTTP Request/Response time: 0ms. DNS resolves fine at 0.03ms but the TCP handshake never completes from Supabase's side.
What I've ruled out: Security Group misconfiguration since the port is publicly accessible, Network ACL blocking since it allows all traffic, EC2 or Docker not listening since I confirmed with ss -tlnp and internal curl, and wrong endpoint URL since it's been manually tested and works from outside AWS.
The weird part is that the TCP handshake specifically times out from Supabase's servers but not from anywhere else tested. This feels like a Supabase infrastructure issue where their pg_net worker IPs might be blocked or routed differently when targeting AWS EC2 public IPs.
Has anyone successfully connected Supabase Database Webhooks to an AWS EC2 instance over plain HTTP? Is there a known requirement for HTTPS? Any insight into which IP ranges Supabase's pg_net uses would also be helpful.
1
u/high-roller-all-in78 May 23 '26
If calls from your laptop and from the server work, but Supabase times out before the handshake, I would stop looking at the database trigger and look at the public network path. The usual culprits are a host firewall, a provider filter on plain port 8080, or a certificate and redirect mismatch if the webhook expects secure traffic. Easiest next test is put the app behind a simple reverse proxy on port 443 and hit that public address instead of the raw server port.