getsentry / self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
https://develop.sentry.dev/self-hosted/
Other
7.87k stars 1.77k forks source link

Wrong webhook url validation #2307

Open DoubleBoba opened 1 year ago

DoubleBoba commented 1 year ago

Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce

  1. Create a custom internal integration
  2. As as webhook URL specify URL with a first level domain like in my case: http://mm-redirector/redirect-to-mattermost
  3. Save changes

Expected Result

Custom integration is created successfully

Actual Result

Validation failed with "Enter a valid URL" message. This URL is totally valid. I have another container running alongside Sentry's cluster with my custom Mattermost integration. So I can and want to access it using the docker domain which is just "mm-redirector". But validation doesn't allow it.

Product Area

Settings - Integrations

Link

No response

DSN

No response

Version

No response

getsantry[bot] commented 1 year ago

Assigning to @getsentry/support for routing ⏲️

hubertdeng123 commented 1 year ago

Are there logs that can tell us more information about what error the validator is throwing? Seems weird that this is happening but that would help us out a lot in determining the root cause

DoubleBoba commented 1 year ago

@hubertdeng123 Where can I see validator logs?

hubertdeng123 commented 1 year ago

Just tested, I can reproduce this myself. I think it's the way how self-hosted is set up, this is not an issue on SaaS. Probably some issue with using django URLField

hubertdeng123 commented 1 year ago

Code for URLValidator here: https://github.com/django/django/blob/main/django/core/validators.py#L69

So, for this to work would need a custom implementation of URLField for self-hosted. Otherwise, as a temporary workaround I think you can edit the postgres database to change the webhook url.