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 unresolvable host DNS error as non-retryable (#64617)

Tom Owerse840ae3fd1c6
diff --git a/posthog/temporal/data_imports/sources/temporalio/source.py b/posthog/temporal/data_imports/sources/temporalio/source.py
index 6d00ded9bac2..b75c26de368f 100644
--- a/posthog/temporal/data_imports/sources/temporalio/source.py
+++ b/posthog/temporal/data_imports/sources/temporalio/source.py
@@ -38,6 +38,13 @@ class TemporalIOSource(ResumableSource[TemporalIOSourceConfig, TemporalIOResumeC
# 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.",
+ # tonic's DNS resolver surfaces getaddrinfo's EAI_NONAME as this exact phrase when the
+ # configured host does not resolve at all (a wrong/typo'd hostname, a deleted namespace,
+ # or a scheme/port accidentally pasted into the host field). Retrying never recovers a
+ # name that doesn't exist in DNS. Match the EAI_NONAME phrase specifically — the transient
+ # EAI_AGAIN ("Temporary failure in name resolution") is a different message and stays
+ # retryable.
+ "failed to lookup address information: Name or service not known": "Temporal could not connect because the configured host could not be found in DNS. Check the source's host points at your Temporal namespace's gRPC endpoint (for example, your-namespace.account.tmprl.cloud) — without a protocol scheme or port — and that the namespace still exists.",
"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 4a9abdc730d7..feb8c9922afc 100644
--- a/posthog/temporal/data_imports/sources/temporalio/test_temporalio.py
+++ b/posthog/temporal/data_imports/sources/temporalio/test_temporalio.py
@@ -54,6 +54,7 @@ class TestTemporalIONonRetryableErrors:
"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",
+ 'RuntimeError: Failed client connect: Server connection error: tonic::transport::Error(Transport, ConnectError(ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" })))',
],
)
def test_config_failures_are_non_retryable(self, error_message):
@@ -81,6 +82,9 @@ class TestTemporalIONonRetryableErrors:
[
"activity Heartbeat timeout",
'RuntimeError: Failed client connect: `get_system_info` call error after connection: Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Os { code: 60, kind: TimedOut, message: "Operation timed out" }))) }',
+ # EAI_AGAIN is a transient resolver failure, distinct from the EAI_NONAME phrase we treat
+ # as non-retryable — it must keep retrying.
+ 'RuntimeError: Failed client connect: Server connection error: tonic::transport::Error(Transport, ConnectError(ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Temporary failure in name resolution" })))',
],
)
def test_transient_failures_stay_retryable(self, error_message):