Description
Clicking "Validate Scopes" on the Sentry provider fails with "Failed to revalidate scopes". All scopes show "Not checked" even though the provider is connected and pulling alerts successfully.
Root Cause
In sentry_provider.py line ~208, the project:write scope validation sends a POST to:
{sentry_api}/projects/{org}/{project}/plugins/webhooks/
Sentry returns 404 with an empty HTML body (Content-Type: text/html, body length: 0). This is likely because the legacy plugins API has been deprecated.
The code then calls response.json() without checking for an empty body:
if not response.ok:
response_json = response.json() # JSONDecodeError: empty body
The exception is unhandled, so it propagates up and kills the entire validation — causing ALL scopes to show "Not checked", not just project:write.
Suggested Fix
if not response.ok:
try:
response_json = response.json()
validated_scopes[scope.name] = response_json.get("detail")
except (requests.exceptions.JSONDecodeError, ValueError):
validated_scopes[scope.name] = f"HTTP {response.status_code}"
continue
This pattern should be applied to all scope checks in validate_scopes (event:read, project:read, project:write).
Additionally, the /plugins/webhooks/ endpoint may need updating since Sentry has been deprecating the legacy plugin system.
Environment
- Keep version: 0.54.3
- Sentry: SaaS (sentry.io)
- Provider mode: Pull (60-min interval)
- Provider status: Connected, pulling alerts successfully
Description
Clicking "Validate Scopes" on the Sentry provider fails with "Failed to revalidate scopes". All scopes show "Not checked" even though the provider is connected and pulling alerts successfully.
Root Cause
In
sentry_provider.pyline ~208, theproject:writescope validation sends a POST to:Sentry returns 404 with an empty HTML body (Content-Type: text/html, body length: 0). This is likely because the legacy plugins API has been deprecated.
The code then calls
response.json()without checking for an empty body:The exception is unhandled, so it propagates up and kills the entire validation — causing ALL scopes to show "Not checked", not just
project:write.Suggested Fix
This pattern should be applied to all scope checks in
validate_scopes(event:read, project:read, project:write).Additionally, the
/plugins/webhooks/endpoint may need updating since Sentry has been deprecating the legacy plugin system.Environment