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

Invalid DSN #1266

Closed
THPubs opened this issue Mar 20, 2018 · 3 comments
Closed

Invalid DSN #1266

THPubs opened this issue Mar 20, 2018 · 3 comments

Comments

@THPubs
Copy link

THPubs commented Mar 20, 2018

I was trying to connect sentry to my express app using raven and it says my DSN is invalid. I tried both the regular one and the public DSN. But none worked. any idea why?

@kamilogorek
Copy link
Contributor

kamilogorek commented Mar 20, 2018

It's hard to help without any code/config/version info that I could use to debug the issue :)

You may mask part of your DSN with ********* if you need to.

@THPubs
Copy link
Author

THPubs commented Mar 20, 2018

Really sorry about that. Here's how I configured the app:

// Configure error reporting
if (process.env.RAVEN_DSN) {
  Raven.config(process.env.RAVEN_DSN).install();
  app.use(Raven.requestHandler());
}

And at the end I placed

app.use(Raven.errorHandler());

In the .env file:

RAVEN_DSN="https://********************:********************@sentry.io/******"

I did a console log of process.env.RAVEN_DSN and it's being loaded correctly and the error message reads like this:

Error: Invalid Sentry DSN: "https://********************:********************@sentry.io/******"
    at Object.parseDSN (/usr/src/app/node_modules/raven/lib/utils.js:193:11)
    at Raven.config (/usr/src/app/node_modules/raven/lib/client.js:52:22)
    at Object.<anonymous> (/usr/src/app/dist/app.js:65:19)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

@THPubs
Copy link
Author

THPubs commented Mar 20, 2018

Just found the issue! In the .env file we can't add double quotes! So the following...

RAVEN_DSN="https://********************:********************@sentry.io/******"

should be written as:

RAVEN_DSN=https://********************:********************@sentry.io/******

@THPubs THPubs closed this as completed Mar 20, 2018
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

No branches or pull requests

2 participants