Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSN is empty #12813

Closed
webofrxy opened this issue Apr 17, 2019 · 26 comments

Comments

@webofrxy
Copy link

commented Apr 17, 2019

Important Details

How are you running Sentry?

  • On-Premise docker
  • sentry version 9.1.0 - onbuild
  • docker-compose

Description

image

@markstory

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

How can someone reproduce this issue?

@untitaker

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

I encountered this as well. It happens when you do not specify a URL prefix during setup. Go to sentry shell and run this:

>>> from sentry import options
>>> options.set("system.url-prefix", "http://localhost:8000")
@kolesoffac

This comment has been minimized.

Copy link

commented Apr 19, 2019

I had this issue, when use db of postgres from old version of sentry.
Fix: renew(remove/create) project

@thinkocapo

This comment has been minimized.

Copy link

commented Apr 23, 2019

these commands from sentry shell fixed it for me. The DSN key field in a project's settings was blank. Ran this command and now its there. I was running off the docker instructions on getsentry/onpremise

@navono

This comment has been minimized.

Copy link

commented Apr 29, 2019

@untitaker How to run this scripts when I use Docker with onpremise?

@navono

This comment has been minimized.

Copy link

commented Apr 30, 2019

It's the root URL in first login settings. I use the domain name, DSN is empty(don't know why), after I change it to IP, it worked.

@kitho-pwc

This comment has been minimized.

Copy link

commented May 2, 2019

I meet the same problem, can you show me how to fix it too? How can i run the sentry shell , or change the IP?

@navono

This comment has been minimized.

Copy link

commented May 4, 2019

@kitho-pwc As I said, you can set the root URL in first login settings.

@dmugtasimov

This comment has been minimized.

Copy link

commented May 4, 2019

I encountered this as well. It happens when you do not specify a URL prefix during setup. Go to sentry shell and run this:

>>> from sentry import options
>>> options.set("system.url-prefix", "http://localhost:8000")

if you are using https://github.com/getsentry/onpremise you may just include following to config.yml:

system.url-prefix: https://your.url.prefix.com
@dmugtasimov

This comment has been minimized.

Copy link

commented May 5, 2019

Does it happen if you do not choose any of option of sending usage statistics?

@coderhs

This comment has been minimized.

Copy link

commented May 16, 2019

It has happened for me as well both in docker and self-install, is this a bug or something we missed during install?

@xhywxtt

This comment has been minimized.

Copy link

commented May 29, 2019

Thanks to @navono , changing to IP fixed the problem

@kuailezhish

This comment has been minimized.

Copy link

commented May 31, 2019

I builded Sentry with docker-sentry, I also encountered DSN is empty problem.
Here is the issue I posted, I really wanted to know how we can solve this problem elegantly.

@bwesen

This comment has been minimized.

Copy link

commented Jun 3, 2019

Same problem here, setup Sentry 9.1.1 using the official Docker container. Everything seems to work but the DSN fields are empty in my project and if I click on "Generate DSN keys" and then reload the page, I get back to the setup wizard's first screen - clicking on Continue there gets me back to the Project page, and the DSN is still empty. Superbuggy...

Update: I tried the suggestion further above, to replace the Root URL with some bogus IP number instead, and then the DSNs are shown.. I guess there is some bug in whatever code parses the Root URL and splits it and splices in the DSN stuff to show as an URL, that doesn't work with a hostname but works with a simple IP like http://127.0.0.1:9000.

It would be helpful to know if that "Root URL" field is actually used for anything in Sentry apart from as a help when showing DSN URLs?

@bwesen

This comment has been minimized.

Copy link

commented Jun 5, 2019

Update 2: it didn't seem to be an issue with host vs IP in the Root URL, it also worked when I swapped out https to a more standard http + port 9000 combo. Maybe the parser assumes a port specification, which I didn't have (or need) for the https case as I then had Sentry behind an SSL nginx front listening to the standard https port.

Then when I switched back the Root URL to https and no port spec, the already generated DSNs are shown correctly in the Project DSN fields, so it also seems it involves the generation of them and not the displaying.

@navono

This comment has been minimized.

Copy link

commented Jun 5, 2019

@bwesen hostname has also been used successfully in my private project, and the generated DSN also contains the hostname not IP. After I reinstall Sentry with Docker again. The hostname solution not work anymore.

I didn't spend much time on it, so don't know why.

@Jaspaul

This comment has been minimized.

Copy link

commented Jun 6, 2019

I've been trying to setup sentry onpremise (9.1.1) locally and ran into this issue as well.

After a bit of experimentation I noticed that the initial setup screen only sends through text fields that you intentionally modify. As a result on the installation screen by default the following is sent as a PUT request from this page:

Screen Shot 2019-06-06 at 4 11 46 PM

https://some.cool.url/api/0/internal/options/?query=is:required
PUT
{"mail.use-tls":false,"auth.allow-registration":false}

When this occurs the DSN is empty for me, however the /manage/settings/ page shows the correct url, in this case https://some.cool.url. If you modify and save the url on the /manage/settings/ page it persists as you'd expect and everything begins to work.

If, on the other hand, you modify the root url during the initial setup it sends through the following (note this happens even if you re-type the same url into the text field that's already there, in this case https://some.cool.url):

https://some.cool.url/api/0/internal/options/?query=is:required
PUT
{"mail.use-tls":false,"auth.allow-registration":false,"system.url-prefix":"https://some.cool.url","system.admin-email":"admin@some.cool.url"}

After manually configuring this url on the setup screen the DSN values appear.

Special notes that may be relevant:

  • I configured my sentry installation using the sentry upgrade with the --noinput flag enabled.
  • I added my first user using sentry createuser --email=someemail --password=somepassword --superuser
@crystianwendel

This comment has been minimized.

Copy link

commented Jun 11, 2019

When this occurs the DSN is empty for me, however the /manage/settings/ page shows the correct url, in this case https://some.cool.url. If you modify and save the url on the /manage/settings/ page it persists as you'd expect and everything begins to work.

This part saved me. Thank you!

@BYK BYK self-assigned this Jun 13, 2019

@BYK

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

I'll take a look at this. @Jaspaul - huge thanks for that last comment explaining many things!

BYK added a commit that referenced this issue Jun 18, 2019

@BYK BYK closed this in #13726 Jun 18, 2019

BYK added a commit that referenced this issue Jun 18, 2019

fix(installWizard): Fix client default values not set (#13726)
* fix(installWizard): Fix client default values not set

Fixes #12813.
@railsfactory-robin

This comment has been minimized.

Copy link

commented Jun 24, 2019

Sentry.init({
dsn: 'http://public key@localhost:9000/projectid',
maxBreadcrumbs: 50,
debug: true,
})
// project id can be find in settings-> projects-> client keys->configure keys

@j-gooding

This comment has been minimized.

Copy link

commented Jun 27, 2019

The DSN is blank if the root URL is set to:
http://localhost:9000

However works fine if set to:
http://127.0.0.1:9000

@BYK

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2019

@j-gooding the fix is not released yet. You can still use http://localhost:9000, you just need to change the input value a bit first due to a bug. See attached PR which resolved this or the comment above that explains why this happens: #12813 (comment)

@sarathn2013

This comment has been minimized.

Copy link

commented Jul 5, 2019

Continuing on @DMug's comment.
If you are running sentry on docker containers.
You can add the following to ENV_CONFIG_MAPPING section of sentry.conf.py and build the image.
'SENTRY_URL_PREFIX': 'system.url-prefix'
By doing the above you should be able to pass SENTRY_URL_PREFIX as an environment variable during docker run that will fix the DSN value.

BYK added a commit that referenced this issue Jul 5, 2019

fix(installWizard): Fix client default values not set (#13726)
* fix(installWizard): Fix client default values not set

Fixes #12813.

BYK added a commit that referenced this issue Jul 5, 2019

fix(installWizard): Fix client default values not set (#13726)
* fix(installWizard): Fix client default values not set

Fixes #12813.
@BYK BYK referenced this issue Jul 8, 2019
1 of 3 tasks complete
@okainov

This comment has been minimized.

Copy link

commented Jul 16, 2019

The issue is still present, why is this closed?

@BYK

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

@fabriziosalmi

This comment has been minimized.

Copy link

commented Jul 18, 2019

Fix this please. Users are not all aware about default web location. (onpremise)

BYK added a commit that referenced this issue Jul 22, 2019

fix(installWizard): Fix client default values not set (#13726)
* fix(installWizard): Fix client default values not set

Fixes #12813.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.