Skip to content

fix(errors): Log 403s as warnings instead of reporting them to Sentry - #173

Merged
armenzg merged 1 commit into
mainfrom
fix/forbidden-is-a-warning
Nov 16, 2026
Merged

armenzg merged 1 commit into
mainfrom
fix/forbidden-is-a-warning

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

A 403 from GitHub or from an org's Sentry ingest endpoint means the other side refused us. Some causes: a suspended installation, a DSN whose project was disabled, a rate limit, or an org that never gave the app access to its .sentry repo. None of them is a bug in the app, but each one became a Sentry error. Four issues account for about 700k events:

  • SENTRY-GITHUB-ACTIONS-APP-V: envelope POST to one org's ingest endpoint (~619k events)
  • SENTRY-GITHUB-ACTIONS-APP-8C: minting an installation token (~44k)
  • SENTRY-GITHUB-ACTIONS-APP-82: reading .sentry/sentry_config.ini (~23k)
  • SENTRY-GITHUB-ACTIONS-APP-8D: fetching the workflow run (~18k)

WebAppHandler._send now handles a 403 the way it already handles BadDsn. It logs a warning, which the logging integration keeps as a breadcrumb rather than an event, counts a forbidden metric tagged with owner and host, and returns 200 with a reason. Any other HTTP error still propagates and gets reported.

It returns 200 on purpose: the app handled the webhook, and the 403 is up to the org or the remote end to fix, so the delivery shouldn't show as failed in GitHub. The forbidden metric and the warning log are where to look for these.

_fetch_config used to call logger.exception before re-raising, so a 403 on the config fetch would still have reached Sentry from there. That call only duplicated the top-level handler, which reports every exception that propagates (the SDK dedupes the second capture), so I removed it.

via @armenzg.

--

View Session [Sentry]

Co-Authored-By: Armen Zambrano Gasparnian <44410+armenzg@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from armenzg November 16, 2026 13:06
@armenzg
armenzg marked this pull request as ready for review November 16, 2026 14:20
@armenzg
armenzg requested a review from a team as a code owner November 16, 2026 14:20
@armenzg
armenzg merged commit 4cb3749 into main Nov 16, 2026
17 checks passed
@armenzg
armenzg deleted the fix/forbidden-is-a-warning branch November 16, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant