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(custom): treat missing manifest resource as non-retryable (#65371)

Tom Owers5b9981dc1a4a
diff --git a/posthog/temporal/data_imports/sources/custom/source.py b/posthog/temporal/data_imports/sources/custom/source.py
index 779e8b4e73b5..cd592e48d4b8 100644
--- a/posthog/temporal/data_imports/sources/custom/source.py
+++ b/posthog/temporal/data_imports/sources/custom/source.py
@@ -563,6 +563,10 @@ class CustomSource(SimpleSource[CustomSourceConfig]):
return {
"401 Client Error": "The upstream API rejected the request with HTTP 401. Check that the configured auth credentials are correct.",
"403 Client Error": "The upstream API rejected the request with HTTP 403. The configured credentials may lack the required permissions.",
+ # A schema points to a resource the manifest no longer defines (renamed or removed
+ # in an edit while the table's sync stayed scheduled). Permanent until the config is
+ # fixed — match the stable suffix, not the variable resource name in the message.
+ "not found in config": "A table in this sync points to a resource that no longer exists in the source's manifest. Re-add the resource to the manifest, or remove the table from the sync, then try again.",
}
def _assemble_manifest(self, config: CustomSourceConfig) -> dict[str, Any]:
diff --git a/posthog/temporal/data_imports/sources/custom/test_custom_source.py b/posthog/temporal/data_imports/sources/custom/test_custom_source.py
index 7e8fc664aeb7..3e623c2bc358 100644
--- a/posthog/temporal/data_imports/sources/custom/test_custom_source.py
+++ b/posthog/temporal/data_imports/sources/custom/test_custom_source.py
@@ -843,6 +843,20 @@ class TestCustomSourceSourceForPipeline(SimpleTestCase):
assert threaded_incremental == {"cursor_path": "updated_at", "start_param": "since"}
+class TestCustomSourceNonRetryableErrors(SimpleTestCase):
+ def test_missing_resource_message_is_classified_non_retryable(self):
+ # The message `source_for_pipeline` raises when a schema points to a resource
+ # the manifest no longer defines must be recognized by the source's classifier,
+ # so `_handle_import_error` stops the job instead of capturing + retrying it.
+ # Pin the specific substring on both ends — the raised message and the dict key —
+ # so the guard breaks if either the wording or the key drifts.
+ with self.assertRaises(ValueError) as ctx:
+ _fanout_chain(_minimal_manifest(), "nonexistent")
+
+ assert "not found in config" in str(ctx.exception)
+ assert "not found in config" in CustomSource().get_non_retryable_errors()
+
+
def _fanout_manifest() -> dict:
"""A parent (`forms`) + fan-out child (`responses`) that binds the parent's
`id` into its path via a `type: "resolve"` param."""