Skip to content

fix(sentry-apps): Prevent MissingSchema with empty webhook_url - #121494

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/sentry-apps-empty-webhook-url
Open

fix(sentry-apps): Prevent MissingSchema with empty webhook_url#121494
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/sentry-apps-empty-webhook-url

Conversation

@sentry

@sentry sentry Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
This PR addresses a regression where Sentry Apps with an empty string as their `webhook_url` would cause a `MissingSchema: Invalid URL ''` error.

The root cause was that the send_and_save_webhook_request function in src/sentry/utils/sentry_apps/webhooks.py would assign url = '' if sentry_app.webhook_url was an empty string. The subsequent assert url is not None would pass, leading to _send_webhook_request('') and the MissingSchema exception.

This issue was previously fixed in PR #119122 by adding if not url: return Response() after the URL assignment. However, this guard was inadvertently removed in a later PR (#120280), causing the regression.

This fix re-introduces the if not url: return Response() guard immediately after the URL assignment (line 258) and removes the now-redundant assert url is not None (line 269). This ensures that if a SentryApp does not have a webhook URL configured (i.e., it's an empty string or None), the webhook sending is silently skipped, preventing the MissingSchema error.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes SENTRY-5HAE

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@sentry
sentry Bot marked this pull request as ready for review August 6, 2026 22:45
@sentry
sentry Bot requested a review from cvxluo August 6, 2026 22:45
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants