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(mysql): treat Doris FE SSL-disabled handshake rejection as non-retryable (#110393)

Tom Owers68b8645c8594
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/source.py
index 7c57770368c7..d401ba9a7e8c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/source.py
@@ -342,6 +342,14 @@ class MySQLSource(
# is a deterministic config mismatch, not the transient connection-drop that 2013
# usually signals — so match only the stable SSL token, never the generic 2013 text.
"[SSL: WRONG_VERSION_NUMBER]": "We couldn't establish an SSL connection to your MySQL server — it responded as if SSL is not enabled. If your server (or a proxy in front of it) doesn't support SSL, set 'Use SSL?' to No; otherwise check that you're connecting to an SSL-enabled host and port.",
+ # Apache Doris FE (its MySQL-protocol-compatible frontend) rejects the handshake with
+ # its own ER_UNKNOWN_ERROR (1105) wording when the client requests TLS/SSL but the FE
+ # has SSL turned off — the same deterministic config mismatch as the generic
+ # WRONG_VERSION_NUMBER case above, just reported in Doris's own text instead of a raw
+ # OpenSSL error. Every retry requests the same SSL handshake and gets rejected
+ # identically. Match the stable Doris-specific phrase (code 1105 is MySQL's generic
+ # catch-all, shared with unrelated Vitess/TiProxy payloads already handled elsewhere).
+ "Doris FE MySQL SSL is disabled": "Your Apache Doris server has SSL disabled, but this source requested an SSL connection. Set 'Use SSL?' to No in your source settings, then re-enable the sync — or enable SSL on your Doris FE server.",
# MySQL error 3159 (ER_SECURE_TRANSPORT_REQUIRED): the server runs with
# `require_secure_transport=ON` but the source has SSL turned off, so every connect is
# rejected before auth. Match the locale-independent code, as the message is translated
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/tests/test_mysql.py b/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/tests/test_mysql.py
index 07ce510b7047..290deded7954 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/tests/test_mysql.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/mysql/tests/test_mysql.py
@@ -2258,6 +2258,18 @@ class TestMySQLSourceNonRetryableErrors:
is_non_retryable = any(pattern in error_msg for pattern in non_retryable.keys())
assert is_non_retryable, f"SSL version mismatch should be non-retryable: {error_msg}"
+ @pytest.mark.parametrize(
+ "error_msg",
+ [
+ "(1105, 'Client requested TLS/SSL, but Doris FE MySQL SSL is disabled')",
+ "OperationalError: (1105, 'Client requested TLS/SSL, but Doris FE MySQL SSL is disabled')",
+ ],
+ )
+ def test_doris_ssl_disabled_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"Doris FE SSL-disabled error should be non-retryable: {error_msg}"
+
@pytest.mark.parametrize(
"error_msg",
[