Important Details
How are you running Sentry?
Description
When using an IPv6 URL (eg. http://[::1]:9000) to connect to Sentry for the first time, any further access to the web interface will crash with "Error: Invalid Dsn"
I believe this is caused by this regexp, which accepts IPv4 addresses in DSNs, but not IPv6 addresses:
|
const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.-]+)(?::(\d+))?\/(.+)/; |
Steps to Reproduce
git clone https://github.com/getsentry/onpremise.git
cd onpremise; ./install.sh
- open
http://[::1]:9000
- login
- accept the configuration form with default values
- wait for a bit
- reload page
Page is stuck on :
Please wait while we load an obnoxious amount of JavaScript.
You may need to disable adblocking extensions to load Sentry
with this stack traces in the web browser console (note: it's with the IP address I actually used in my install instead of ::1):
Error: Invalid Dsn vendor.js:52:2489
t http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:52
_fromString http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:151
e http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:151
e http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:78
e http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:73
t http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:103
_setupTransport http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:78
e http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:103
t http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:78
e http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:103
t http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:78
p http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:78
d http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/vendor.js:45
<anonyme> http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
i http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
i http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
<anonyme> http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
i http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
n http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
<anonyme> http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
<anonyme> http://[fdfe:4927:30e1:5af9:2eb7:f8be:893b:9f0b]:9000/_static/1575887347/sentry/dist/app.js:1
ReferenceError: $ is not defined issues:64:3
What you expected to happen
The Sentry dashboard should load
Possible Solution
Update DSN_REGEX to allow IPv6 addresses: var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.[:\]-]+)(?::(\d+))?\/(.+)/;
Important Details
How are you running Sentry?
Description
When using an IPv6 URL (eg.
http://[::1]:9000) to connect to Sentry for the first time, any further access to the web interface will crash with "Error: Invalid Dsn"I believe this is caused by this regexp, which accepts IPv4 addresses in DSNs, but not IPv6 addresses:
sentry-javascript/packages/utils/src/dsn.ts
Line 6 in 645ff53
Steps to Reproduce
git clone https://github.com/getsentry/onpremise.gitcd onpremise; ./install.shhttp://[::1]:9000Page is stuck on :
with this stack traces in the web browser console (note: it's with the IP address I actually used in my install instead of
::1):What you expected to happen
The Sentry dashboard should load
Possible Solution
Update
DSN_REGEXto allow IPv6 addresses:var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.[:\]-]+)(?::(\d+))?\/(.+)/;