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(google_play_console): treat play reporting 502s as a retryable outage (#130720)

Tom Owersf3544d0bf3b4
diff --git a/products/warehouse_sources/sources/google_play_console/source.py b/products/warehouse_sources/sources/google_play_console/source.py
index d14b17396b85..d8b400152033 100644
--- a/products/warehouse_sources/sources/google_play_console/source.py
+++ b/products/warehouse_sources/sources/google_play_console/source.py
@@ -108,11 +108,16 @@ class GooglePlayConsoleSource(ResumableSource[GooglePlayConsoleSourceConfig, Goo
# no response body to match on, so it needs its own entry alongside the 500 case. Without it,
# the activity's classifier (import_data_sync.py) treats the 503 as an unclassified failure
# and reports it to error tracking on every attempt instead of retrying quietly.
+ # A 502 "Bad Gateway" is the same gateway-level outage, raised from the same place.
return {
"500 Server Error": (
"Google Play's reporting API had an internal error, so this sync couldn't finish. "
"This is on Google's side, and the next sync runs on schedule."
),
+ "502 Server Error": (
+ "Google Play's reporting API was unavailable, so this sync couldn't finish. "
+ "This is on Google's side, and the next sync runs on schedule."
+ ),
"503 Server Error": (
"Google Play's reporting API was unavailable, so this sync couldn't finish. "
"This is on Google's side, and the next sync runs on schedule."
diff --git a/products/warehouse_sources/sources/google_play_console/tests/test_google_play_console.py b/products/warehouse_sources/sources/google_play_console/tests/test_google_play_console.py
index b47312bfa85e..46344d1a5896 100644
--- a/products/warehouse_sources/sources/google_play_console/tests/test_google_play_console.py
+++ b/products/warehouse_sources/sources/google_play_console/tests/test_google_play_console.py
@@ -473,7 +473,7 @@ def test_metric_set_reraises_a_403_that_is_not_the_games_restriction() -> None:
assert isinstance(result.raised, requests.HTTPError)
[email protected]("status", [500, 503])
[email protected]("status", [500, 502, 503])
def test_metric_set_server_error_stays_retryable_with_vendor_outage_copy(status: int) -> None:
with mock.patch(f"{MODULE}._today", return_value=TODAY):
result = _run(