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(snowflake): treat expired password as non-retryable (#63681)

Tom Owers0b6bb2a1e458
diff --git a/posthog/temporal/data_imports/sources/snowflake/source.py b/posthog/temporal/data_imports/sources/snowflake/source.py
index a4d27adab185..08e86e848b6b 100644
--- a/posthog/temporal/data_imports/sources/snowflake/source.py
+++ b/posthog/temporal/data_imports/sources/snowflake/source.py
@@ -186,6 +186,9 @@ class SnowflakeSource(SQLSource[SnowflakeSourceConfig]):
# Snowflake error 250001: the user account was disabled by the customer's Snowflake admin
# (e.g. `ALTER USER ... SET DISABLED = TRUE`). Retrying can never succeed until they re-enable it.
"User access disabled. Contact your local system administrator": "Your Snowflake user account has been disabled. Please contact your Snowflake administrator to re-enable it, then resync.",
+ # Snowflake error 250001 (08001): the user's password has expired. Snowflake requires it
+ # to be changed via the web console before any login can succeed, so retrying never works.
+ "Specified password has expired": "Your Snowflake password has expired. Please change it in the Snowflake web console (or switch to key-pair authentication), then resync.",
"MFA authentication is required": None,
# The account enforces Duo Security multi-factor auth for this user, so the
# connector's login is rejected (250001 / 08001). An unattended sync can't answer a
diff --git a/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py b/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
index 91c49bb28d6e..b69d11c2bdff 100644
--- a/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
+++ b/posthog/temporal/data_imports/sources/snowflake/tests/test_snowflake.py
@@ -606,6 +606,20 @@ class TestSnowflakeSourceNonRetryableErrors:
is_non_retryable = any(pattern in error_msg for pattern in non_retryable.keys())
assert is_non_retryable, f"Invalid-identifier error should be non-retryable: {error_msg}"
+ @pytest.mark.parametrize(
+ "error_msg",
+ [
+ "Specified password has expired",
+ # The real shape from production: codes + host vary, but the substring is stable.
+ "250001 (08001): None: Failed to connect to DB: gbnacyk-mlb13594.snowflakecomputing.com:443. "
+ "Specified password has expired. Password must be changed using the Snowflake web console.",
+ ],
+ )
+ def test_expired_password_is_non_retryable(self, source, error_msg):
+ non_retryable = source.get_non_retryable_errors()
+ is_non_retryable = any(pattern in error_msg for pattern in non_retryable.keys())
+ assert is_non_retryable, f"Expired-password error should be non-retryable: {error_msg}"
+
@pytest.mark.parametrize(
"error_msg",
[