: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(snowflake): stop login internal-error retries reporting as noise (#78642)
Tom Owersbd90243f5841
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/source.pyindex 9455b15e1247..c8f959648c1e 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/source.py@@ -314,6 +314,15 @@ class SnowflakeSource(SQLSource[SnowflakeSourceConfig]):# previous attempt doesn't carry over. Self-recovering, so keep retrying instead of# stopping the sync. The errno prefix is volatile, so we match the stable status text."HTTP 400: Bad Request",+ # Snowflake error 250001 (08001): the login-request endpoint itself responded with a+ # generic "Internal error" (`auth/_auth.py` formats this as "Failed to connect to DB:+ # {host}:{port}. {message}", where `message` is Snowflake's own internal-error text) —+ # a transient blip on Snowflake's authentication service, not a credential or config+ # problem. It isn't retried inside the connector's own auth flow, so without this marker+ # every Temporal-level retry logs it as unclassified error-tracking noise instead of the+ # self-recovering failure it is. The request id in brackets is volatile, so we match the+ # stable phrase.+ "Internal error:",}def reconcile_schema_metadata(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.pyindex e5e682cbf0ff..ea9a76458f47 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/snowflake/tests/test_snowflake.py@@ -930,6 +930,17 @@ class TestSnowflakeSourceRetryableErrors:is_retryable = any(pattern in error_msg for pattern in retryable)assert is_retryable, f"Chunk-download bad-request error should be classified retryable: {error_msg}"+ def test_login_internal_error_is_retryable(self, source):+ # The real shape from production: the login-request endpoint responded with a generic+ # internal-error message instead of a credential/config-specific one.+ error_msg = (+ "250001 (08001): None: Failed to connect to DB: acme-xy123.snowflakecomputing.com:443. "+ "Internal error: [f189e7a4-177b-4b96-a5cf-50a7193e2fff]"+ )+ retryable = source.get_retryable_errors()+ is_retryable = any(pattern in error_msg for pattern in retryable)+ assert is_retryable, f"Snowflake login internal-error should be classified retryable: {error_msg}"+class TestSnowflakeValidateCredentials:@pytest.fixture