: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(active_campaign): treat rejected API URL as non-retryable (#71718)
Tom Owersbf8e6c79dbec
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/source.pyindex 45b9561e4260..a2ca4077e0d7 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/source.py@@ -89,6 +89,11 @@ You can find both in your ActiveCampaign account under **Settings > Developer**."401 Client Error": "Invalid ActiveCampaign credentials. Please check your API URL and key and reconnect.","403 Client Error": "Access forbidden. Please check that your ActiveCampaign API key is valid and reconnect.","Unauthorized for url": "Invalid ActiveCampaign credentials. Please check your API URL and key and reconnect.",+ # `active_campaign_source` raises this when the configured api_url fails our URL+ # validation — an unresolvable host (wrong account name), a private/internal host,+ # or a bad scheme. All are user-config problems retrying can't fix. Match the stable+ # prefix, not the appended reason (which can embed a resolved IP).+ "ActiveCampaign API URL is not allowed": "PostHog couldn't reach the ActiveCampaign API URL you entered. Check that it's correct — it should look like https://youraccount.api-us1.com — and reconnect.",}def get_schemas(diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/tests/test_active_campaign_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/tests/test_active_campaign_source.pyindex 68aac97bc0ca..4c9b1840268c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/tests/test_active_campaign_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/active_campaign/tests/test_active_campaign_source.py@@ -73,10 +73,27 @@ class TestActiveCampaignSource:assert api_key_field.required is Trueassert api_key_field.secret is True- @pytest.mark.parametrize("expected_key", ["401 Client Error", "403 Client Error", "Unauthorized for url"])+ @pytest.mark.parametrize(+ "expected_key",+ ["401 Client Error", "403 Client Error", "Unauthorized for url", "ActiveCampaign API URL is not allowed"],+ )def test_non_retryable_errors(self, expected_key: str) -> None:assert expected_key in self.source.get_non_retryable_errors()+ @pytest.mark.parametrize(+ "raised_message",+ [+ # `active_campaign_source` raises `ActiveCampaign API URL is not allowed: {reason}` for+ # every URL-validation failure; the sync matcher is a substring check, so the stable+ # prefix must classify each reason as non-retryable regardless of the appended detail.+ "ActiveCampaign API URL is not allowed: Could not resolve host",+ "ActiveCampaign API URL is not allowed: Private IP address not allowed",+ ],+ )+ def test_url_not_allowed_is_non_retryable(self, raised_message: str) -> None:+ keys = self.source.get_non_retryable_errors().keys()+ assert any(key in raised_message for key in keys)+def test_get_schemas_all_full_refresh(self) -> None:schemas = self.source.get_schemas(self.config, self.team_id)