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(databricks): stop retrying a workspace-entitlement rejection (#95392)

Tom Owersf45c08a35521
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/source.py
index 334247e81d6a..ab7e04d2cd7c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/source.py
@@ -48,6 +48,9 @@ DatabricksErrors = {
"Name or service not known": "Can't resolve the server hostname. Check the server hostname and try again.",
"Failed to resolve": "Can't resolve the server hostname. Check the server hostname and try again.",
"is blocked by Databricks IP ACL for workspace": "PostHog's IP address is blocked by your Databricks workspace's IP access control list. Add PostHog's IP addresses to the workspace's IP ACL, then try again.",
+ # Workspace-level entitlement, not a Unity Catalog grant — a separate admin setting from
+ # PERMISSION_DENIED/INSUFFICIENT_PERMISSIONS above.
+ "databricks-sql-access or workspace-consume entitlements": "Your Databricks credentials don't have the databricks-sql-access or workspace-consume entitlement. Grant one of those entitlements to the connecting user or service principal in your Databricks workspace admin settings, then try again.",
}
@@ -186,6 +189,9 @@ class DatabricksSource(SQLSource[DatabricksSourceConfig], ValidateDatabaseHostMi
# Workspace-level IP ACL rejection — a customer-side network config that retrying can
# never satisfy. Match the stable phrase, ignoring the appended IP and workspace id.
"is blocked by Databricks IP ACL for workspace": "PostHog's IP address is blocked by your Databricks workspace's IP access control list. Add PostHog's IP addresses to the workspace's IP ACL, then resync.",
+ # Workspace-level entitlement, not a Unity Catalog grant — a separate admin setting from
+ # PERMISSION_DENIED/INSUFFICIENT_PERMISSIONS above.
+ "databricks-sql-access or workspace-consume entitlements": "Your Databricks credentials don't have the databricks-sql-access or workspace-consume entitlement. Grant one of those entitlements to the connecting user or service principal in your Databricks workspace admin settings, then resync.",
}
def validate_credentials(
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/tests/test_databricks.py b/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/tests/test_databricks.py
index df9d86064738..ac5378ab9a82 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/tests/test_databricks.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/databricks/tests/test_databricks.py
@@ -512,6 +512,8 @@ class TestDatabricksSource:
# Workspace IP ACL rejection — matched on the stable phrase, ignoring the appended IP
# address and workspace id.
"Error during request to server: : Source IP address: 44.208.188.173 is blocked by Databricks IP ACL for workspace: 1557520918149316. ",
+ # Workspace-level entitlement missing on the connecting user/service principal.
+ "Error during request to server: : This API is disabled for users without the databricks-sql-access or workspace-consume entitlements. Contact your administrator for more information.. ",
],
)
def test_permanent_failures_are_non_retryable(self, source, error_msg):
@@ -554,6 +556,12 @@ class TestDatabricksSource:
"IP access control list",
),
("[RESOURCE_DOES_NOT_EXIST] Warehouse abc123 does not exist.", "SQL warehouse"),
+ (
+ "Error during request to server: : This API is disabled for users without the"
+ " databricks-sql-access or workspace-consume entitlements. Contact your administrator"
+ " for more information.. ",
+ "entitlement",
+ ),
("something totally unexpected", "Could not connect to Databricks"),
],
)