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(monday): stop retrying forbidden monday.com syncs (#119352)

Tom Owersb19f630166e2
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/monday/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/monday/source.py
index 86452f7f6887..be8c228e2aaa 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/monday/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/monday/source.py
@@ -57,6 +57,7 @@ class MondaySource(SimpleSource[MondaySourceConfig]):
# key would also catch transient server-side errors and permanently disable the sync.
return {
"401 Client Error: Unauthorized for url: https://api.monday.com": "monday.com authentication failed. Please check your API token.",
+ "403 Client Error: Forbidden for url: https://api.monday.com": "monday.com rejected the request. Please check that your API token has access to the requested data.",
"monday.com GraphQL error: Not authenticated": "monday.com authentication failed. Please check your API token.",
"monday.com GraphQL error: User unauthorized": "monday.com rejected the request. Please check that your API token has access to the requested data.",
}
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/monday/tests/test_monday_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/monday/tests/test_monday_source.py
index 36a8dd1c2f62..87a71b11271c 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/monday/tests/test_monday_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/monday/tests/test_monday_source.py
@@ -32,6 +32,19 @@ class TestMondaySource:
retryable_errors = self.source.get_retryable_errors()
assert error_message_matches(observed_error, retryable_errors)
+ @pytest.mark.parametrize(
+ "observed_error",
+ [
+ "401 Client Error: Unauthorized for url: https://api.monday.com/v2",
+ "403 Client Error: Forbidden for url: https://api.monday.com/v2",
+ "monday.com GraphQL error: Not authenticated",
+ "monday.com GraphQL error: User unauthorized",
+ ],
+ )
+ def test_non_retryable_errors_match_auth_and_permission_failures(self, observed_error):
+ non_retryable_errors = self.source.get_non_retryable_errors()
+ assert error_message_matches(observed_error, non_retryable_errors)
+
def test_get_schemas_filtered_by_names(self):
schemas = self.source.get_schemas(self.config, self.team_id, names=["items"])
assert len(schemas) == 1