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(outbrain): treat 400 Bad Request as non-retryable (#68489)

Tom Owers37b098a95fd4
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/source.py
index 9ca1063810bf..b3c7b238127c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/source.py
@@ -52,6 +52,10 @@ class OutbrainSource(ResumableSource[OutbrainSourceConfig, OutbrainResumeConfig]
return {
"401 Client Error: Unauthorized for url: https://api.outbrain.com/amplify/v0.1/login": "Outbrain authentication failed. Please check your username and password.",
"403 Client Error: Forbidden for url: https://api.outbrain.com": "Outbrain denied access. Please check that your account has Amplify API access (requested via your account manager).",
+ # A 400 on a well-formed, static request is deterministic, so retrying can never succeed.
+ # It surfaces when one of the marketers returned by /marketers can't be queried through
+ # the Amplify API, so match the stable prefix, not the volatile marketer id and query.
+ "400 Client Error: Bad Request for url: https://api.outbrain.com": "Outbrain rejected the request (400 Bad Request). One of the marketers on your account may not be accessible via the Amplify API. Please confirm your account's Amplify API access with your Outbrain account manager.",
}
@property
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/tests/test_outbrain_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/tests/test_outbrain_source.py
index ca8b898ce8f9..f22b5e513050 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/tests/test_outbrain_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/outbrain/tests/test_outbrain_source.py
@@ -49,6 +49,7 @@ class TestOutbrainSource:
[
"401 Client Error: Unauthorized for url: https://api.outbrain.com/amplify/v0.1/login",
"403 Client Error: Forbidden for url: https://api.outbrain.com/amplify/v0.1/marketers",
+ "400 Client Error: Bad Request for url: https://api.outbrain.com/amplify/v0.1/marketers/marketer/campaigns?limit=100&offset=0",
],
)
def test_non_retryable_errors_match_auth_failures(self, observed_error):