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(bing_ads): keep urllib transport failures retryable and unreported (#98670)

Tom Owersd4fd6b2509cd
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/source.py
index 53191d2bffc7..e0835b668d2b 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/source.py
@@ -163,6 +163,13 @@ class BingAdsSource(ResumableSource[BingAdsSourceConfig, BingAdsResumeConfig], O
# Bing's queue, so the next Temporal attempt submits a fresh request and normally clears it.
# Match the SDK's stable message text, which carries no request or account values.
"Reporting file download tracking status timeout",
+ # A urllib transport failure reaching Bing's SOAP endpoints — connection refused, DNS or
+ # TLS failure, socket timeout — which suds surfaces as `URLError` and our wrapper re-raises
+ # as `ValueError(... URLError: <urlopen error ...>)`. The endpoints are fixed (see
+ # utils.ENVIRONMENT), so nothing at this layer is customer-configured or deterministic: the
+ # next Temporal attempt normally clears it. Match the exception name plus urllib's fixed
+ # message prefix, which together carry no request or account values.
+ "URLError: <urlopen error",
}
@property
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/tests/test_bing_ads_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/tests/test_bing_ads_source.py
index e967dfeaa4b2..fb4c4b99f4cb 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/tests/test_bing_ads_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/bing_ads/tests/test_bing_ads_source.py
@@ -375,6 +375,10 @@ class TestBingAdsSource:
# submits a fresh report request, so this must stay retryable rather than disable the schema.
"Failed to generate ad_group_performance_report report: ReportingDownloadException: "
"Reporting file download tracking status timeout.",
+ # A urllib transport failure against Bing's fixed SOAP endpoint. The endpoint is not
+ # customer-configured, so a refused connection is a network blip the next attempt clears —
+ # it must stay retryable rather than report as a bug or disable the schema.
+ "Failed to fetch customer ID: URLError: <urlopen error [Errno 111] Connection refused>",
],
)
def test_transient_failures_are_retryable_not_disabling(self, error_message):