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(data-imports): stop retrying a suspended Snowflake destination account (#125231)

Tom Owersb7296ffa5d44
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/tests/test_snowflake_writer.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/tests/test_snowflake_writer.py
index edbb0581abf0..6b8c59edabe0 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/tests/test_snowflake_writer.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/tests/test_snowflake_writer.py
@@ -125,6 +125,7 @@ class TestConfigurationErrors:
(SnowflakeIntegrationNotFoundError(42, 1), "connection details"),
(ProgrammingError(msg="fake-secret", errno=3001), "privileges"),
(ProgrammingError(msg="fake-secret", errno=2043), "database or schema"),
+ (ProgrammingError(msg="fake-secret", errno=666), "suspended"),
],
)
async def test_permanent_errors_are_configuration_errors(
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/writers/snowflake.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/writers/snowflake.py
index 64a2fb7f54b9..5c049750ec04 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/writers/snowflake.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/pipeline_v3/destinations_load/writers/snowflake.py
@@ -90,6 +90,10 @@ DATABASE_SCHEMA_DETAIL = (
"The Snowflake database or schema does not exist or the role cannot use it. "
"Check the database and schema and grant the role access, then run the sync again."
)
+ACCOUNT_SUSPENDED_DETAIL = (
+ "The Snowflake account is suspended, usually for a missing payment method. "
+ "Resolve it with Snowflake, then run the sync again."
+)
def _configuration_error_detail(err: Exception) -> str | None:
@@ -108,6 +112,8 @@ def _configuration_error_detail(err: Exception) -> str | None:
return PRIVILEGES_DETAIL
if err.errno == 2043:
return DATABASE_SCHEMA_DETAIL
+ if err.errno == 666:
+ return ACCOUNT_SUSPENDED_DETAIL
return None