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(data-imports): stop retrying Framer's broken-code-component error (#84010)

Tom Owersf31d33be39fe
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/framer/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/framer/source.py
index ee75f6995e17..242f102b920d 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/framer/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/framer/source.py
@@ -50,6 +50,11 @@ class FramerSource(SimpleSource[FramerSourceConfig]):
"Framer API error UNAUTHORIZED": "Framer rejected the API key for this project. Generate a new API key in the project's Site Settings → General and reconnect.",
"Framer API error INVALID_REQUEST": "The Framer project URL or ID is invalid. Update the source with your project URL (https://framer.com/projects/...) or project ID.",
"Invalid Framer project URL or ID": "The Framer project URL or ID is invalid. Update the source with your project URL (https://framer.com/projects/...) or project ID.",
+ # Framer's headless loader raises this when a code component the project uses
+ # references a module the headless runtime can't resolve — a defect in the
+ # project's own code components, not a transient server condition, so it fails
+ # identically on every retry until the project is fixed.
+ "ensureComponentsInLoader": "A code component in this Framer project references a module Framer's API can't load. Check the project's code components for missing or broken dependencies, then resync.",
}
def get_retryable_errors(self) -> set[str]:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/framer/tests/test_framer_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/framer/tests/test_framer_source.py
index 77ac0a322d1f..a5524cadd54c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/framer/tests/test_framer_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/framer/tests/test_framer_source.py
@@ -87,3 +87,17 @@ class TestFramerSource:
tables = FramerSource().get_documented_tables()
assert [table["name"] for table in tables] == list(ENDPOINTS)
assert all(table["sync_methods"] == ["Full refresh"] for table in tables)
+
+ def test_broken_code_component_is_non_retryable(self) -> None:
+ # Framer's headless loader raises this identically on every retry when a project's
+ # code component references a module the headless runtime can't resolve — a project
+ # config defect, not a transient server condition.
+ observed_error = (
+ "Framer API error METHOD_ERROR: getCollectionItems2: ensureComponentsInLoader: Some modules are missing."
+ )
+ assert any(key in observed_error for key in FramerSource().get_non_retryable_errors())
+
+ def test_pool_exhausted_stays_retryable(self) -> None:
+ observed_error = "Framer API error POOL_EXHAUSTED: busy"
+ assert not any(key in observed_error for key in FramerSource().get_non_retryable_errors())
+ assert any(key in observed_error for key in FramerSource().get_retryable_errors())