Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(supabase): explain ip allow list rejections during source setup (#111495)

Tom Owersc6781eae0ba1
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py
index c75171739cd2..2b1e89dd67b3 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/source.py
@@ -240,6 +240,14 @@ PostgresErrors = {
"Your database user isn't allowed to sign in. Grant it the LOGIN privilege or use a "
"different user, then try again."
),
+ # Supavisor rejects a client IP outside the project's network restrictions with
+ # "FATAL: (EADDRNOTALLOWED) address not in tenant allow_list: ...". `get_non_retryable_errors`
+ # already handles this on the streaming path; map it here too so validation returns an
+ # actionable message instead of the generic fallback.
+ "address not in tenant allow_list": (
+ "Your database provider rejected the connection because PostHog's IP address isn't on its IP "
+ "allow list. Add PostHog's IP addresses to that allow list, then try again."
+ ),
"could not translate host name": _DNS_RESOLUTION_VALIDATION_ERROR,
# libpq prefixes a DNS-resolution failure with "could not translate host name ..." (matched
# above), but the same getaddrinfo failure also surfaces as the raw socket wording with no such
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py
index bcc23d6e5188..67b7f3ad3609 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/postgres/test_postgres.py
@@ -5069,6 +5069,13 @@ class TestValidateCredentialsErrorMapping:
'repeated authentication failures ("too many authentication failures"). This usually '
"means the username or password is wrong. Check your credentials and try again.",
),
+ # Supavisor rejects a client IP outside the project's network restrictions.
+ (
+ 'connection failed: connection to server at "203.0.113.10", port 5432 failed: '
+ "FATAL: (EADDRNOTALLOWED) address not in tenant allow_list: {192, 0, 2, 1}",
+ "Your database provider rejected the connection because PostHog's IP address isn't on its IP "
+ "allow list. Add PostHog's IP addresses to that allow list, then try again.",
+ ),
# A proxy/pooler in front of some providers rejects bad credentials during its own
# database-identification step, wrapping the rejection in its own sentence instead of
# libpq's "password authentication failed for user".