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(shopify): classify token-endpoint 5xx as retryable noise (#95739)

Tom Owers0eeb0ea5658e
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py
index 3e0736c71ac6..f08ab141fd46 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/source.py
@@ -122,6 +122,10 @@ class ShopifySource(ResumableSource[ShopifySourceConfig, ShopifyResumeConfig]):
"Shopify: rate limit exceeded",
"Shopify: internal error",
"Shopify: connection broken while reading response",
+ # `_get_shopify_access_token` raises this once its own tenacity retries (same 5-attempt
+ # budget) are exhausted for a 429/5xx from the OAuth token endpoint — the same
+ # self-recovering contract as the GraphQL messages above.
+ "Failed to retrieve Shopify access token:",
}
@property
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_non_retryable_errors.py b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_non_retryable_errors.py
index 764e8e899f8f..dda72fe32204 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_non_retryable_errors.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/shopify/tests/test_non_retryable_errors.py
@@ -70,6 +70,8 @@ def test_transient_http_errors_stay_retryable(status_code, reason):
"Shopify: internal error from request 500 Internal Server Error",
'Shopify: internal errors in payload [{"message": "internal error", "extensions": {"code": "internal_server_error"}}]',
"Shopify: connection broken while reading response: Connection broken: IncompleteRead(0 bytes read)",
+ "Failed to retrieve Shopify access token: 500 Internal Server Error",
+ "Failed to retrieve Shopify access token: 429 Too Many Requests",
],
)
def test_exhausted_internal_retries_are_classified_as_retryable(error_message):