: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(mssql): treat SSH gateway connection failure as non-retryable (#63735)
Tom Owers092e2827b8bd
diff --git a/posthog/temporal/data_imports/sources/mssql/source.py b/posthog/temporal/data_imports/sources/mssql/source.pyindex 8c84a150eebe..237127164f0f 100644--- a/posthog/temporal/data_imports/sources/mssql/source.py+++ b/posthog/temporal/data_imports/sources/mssql/source.py@@ -50,6 +50,14 @@ class MSSQLSource(SQLSource[MSSQLSourceConfig], SSHTunnelMixin, ValidateDatabase"Adaptive Server is unavailable or does not exist": "Could not reach your SQL Server. Check that the server is running and reachable, and that PostHog's IP addresses are allowed through its firewall / security group.","Login failed for user": None,"Cannot find the CREDENTIAL": "Cannot find the credential - check that it exists and you have permission to access it",+ # Raised by the `sshtunnel` library (via the shared `open_ssh_tunnel` helper) when the+ # SSH tunnel can't be brought up — the bastion host is unreachable, the host/port is+ # wrong, the SSH key/credentials are rejected, or a firewall blocks PostHog's IPs. This+ # is the customer's gateway configuration, not a momentary blip; the import retried it+ # across attempts and never recovered. `handle_non_retryable_error` still re-tries a few+ # times across runs before giving up, so a genuinely transient gateway reboot is+ # absorbed. Postgres already treats this identical error as non-retryable.+ "Could not establish session to SSH gateway": "Could not connect to your SSH tunnel. Check that the SSH host, port, and credentials are correct, the bastion host is running and reachable, and that PostHog's IP addresses are allowed through its firewall.",# Raised from the shared `_decimal_array_from_values` fallback in# `pipelines/pipeline/utils.py` when a numeric/decimal/money value exceeds Delta# Lake's decimal budget (precision > 76 or scale > 32). Fixed source-data shape —diff --git a/posthog/temporal/data_imports/sources/mssql/tests/test_mssql.py b/posthog/temporal/data_imports/sources/mssql/tests/test_mssql.pyindex d3caf630acc6..efd730de8251 100644--- a/posthog/temporal/data_imports/sources/mssql/tests/test_mssql.py+++ b/posthog/temporal/data_imports/sources/mssql/tests/test_mssql.py@@ -448,6 +448,9 @@ class TestMSSQLSourceNonRetryableErrors:"DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is ""unavailable or does not exist (cplapps.example.us-east-2.rds.amazonaws.com)","Login failed for user 'reporting'.",+ # Raised by the sshtunnel library when the customer's SSH bastion can't be reached+ # (wrong host/port, rejected key, firewall) — the import goes through `open_ssh_tunnel`.+ "BaseSSHTunnelForwarderError: Could not establish session to SSH gateway",],)def test_connection_errors_are_non_retryable(self, error_msg):