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(rokt-ads): classify HTTP 400 from the report endpoint as non-retryable (#91915)

Tom Owers182da009a944
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py
index a8cf4b48ed0b..993786f250a1 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py
@@ -62,6 +62,15 @@ class RoktAdsSource(ResumableSource[RoktAdsSourceConfig, RoktAdsResumeConfig]):
return {
"401 Client Error: Unauthorized for url": "Rokt rejected these credentials. Please regenerate the app ID and app secret in One Platform and reconnect.",
"403 Client Error: Forbidden for url": "These Rokt credentials cannot read this account. Please check the account ID and the app's permissions.",
+ # The same request body is sent on every retry, so a 400 from the report endpoint will
+ # never become data. Likely causes: the account type does not support advertiser
+ # campaigns, a time zone or currency code setting is unrecognised, or the account is
+ # not fully configured in One Platform.
+ "400 Client Error: Bad Request for url": (
+ "Rokt rejected the report request as invalid. This can happen if the account type does not support "
+ "advertiser campaigns, if the time zone or currency code setting is unrecognised, or if the account "
+ "is not fully configured in One Platform. Check your account settings, or contact Rokt support."
+ ),
}
def get_canonical_descriptions(self) -> CanonicalDescriptions:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py
index 7b00657fd632..9cbd0dce6e8b 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py
@@ -197,6 +197,7 @@ class TestNonRetryableErrors:
errors = RoktAdsSource().get_non_retryable_errors()
assert any("401" in key for key in errors)
assert any("403" in key for key in errors)
+ assert any("400" in key for key in errors)
class TestCanonicalDescriptions: