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(temporalio): treat empty/invalid host as non-retryable (#63702)

Tom Owersdb3d3f8b6bea
diff --git a/posthog/temporal/data_imports/sources/temporalio/source.py b/posthog/temporal/data_imports/sources/temporalio/source.py
index 7b8209687549..377b96b01611 100644
--- a/posthog/temporal/data_imports/sources/temporalio/source.py
+++ b/posthog/temporal/data_imports/sources/temporalio/source.py
@@ -35,6 +35,9 @@ class TemporalIOSource(ResumableSource[TemporalIOSourceConfig, TemporalIOResumeC
# rustls surfaces mTLS rejections as TLS alert names inside the tonic transport
# error. These are credential problems — retrying can never recover.
return {
+ # The Temporal core builds the connection target from the configured host:port. An empty
+ # or scheme-only host yields no parseable host — a config problem retrying never fixes.
+ "invalid target URL: empty host": "Temporal could not connect because the configured host is empty or invalid. Update the source with the hostname of your Temporal namespace's gRPC endpoint (for example, your-namespace.account.tmprl.cloud) — without a protocol scheme or port.",
"received fatal alert: UnknownCA": "Temporal rejected this source's client certificate because it is not signed by a certificate authority the namespace trusts. This usually means the namespace's CA certificates were rotated — update the source with a client certificate and key signed by the current CA.",
"received fatal alert: CertificateExpired": "This source's client certificate has expired. Update the source with a renewed client certificate and key.",
"received fatal alert: CertificateRevoked": "This source's client certificate has been revoked. Update the source with a new client certificate and key.",
diff --git a/posthog/temporal/data_imports/sources/temporalio/test_temporalio.py b/posthog/temporal/data_imports/sources/temporalio/test_temporalio.py
index aefeef4df6b9..4a9abdc730d7 100644
--- a/posthog/temporal/data_imports/sources/temporalio/test_temporalio.py
+++ b/posthog/temporal/data_imports/sources/temporalio/test_temporalio.py
@@ -52,9 +52,11 @@ class TestTemporalIONonRetryableErrors:
"received fatal alert: CertificateUnknown",
"invalid peer certificate: UnknownIssuer",
"Failed client connect: Server connection error: tonic::transport::Error(Transport, CertificateParseError)",
+ 'RuntimeError: Failed client connect: invalid target URL: empty host: ":7233"',
+ "tonic::transport::Error(Transport, InvalidUri(InvalidUri(InvalidFormat))): invalid target URL: empty host",
],
)
- def test_tls_certificate_failures_are_non_retryable(self, error_message):
+ def test_config_failures_are_non_retryable(self, error_message):
non_retryable_errors = self.source.get_non_retryable_errors()
assert any(pattern in error_message for pattern in non_retryable_errors), (