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

Wrong request data being sent with error. #2045

Closed
tbell511 opened this issue Apr 30, 2019 · 2 comments
Closed

Wrong request data being sent with error. #2045

tbell511 opened this issue Apr 30, 2019 · 2 comments

Comments

@tbell511
Copy link

I am using Node v10.15.2 + Express v4.16.3 and "@sentry/node" v5.1

Hoping someone can help. Sentry is reporting Errors with incorrect data.

Sentry reported an error today that can only come from 1 specific route in my API. That route is /dashboard/memberships It's a validation error from Mongo (that's besides the point though).

However, Sentry reported the Error originating from an entirely different route /site/settings and includes data that is intended for the '/site/settings' route.

Looking at my raw server logs, the error was logged along side a request to /dashboard/memberships Which confirms to me at least the error actually did come from that route; and like I said, it's a very specific error that can only originate from the /dashboard/memberships

Here is a simplified version of my entry point:

Sentry.init({ environment: "my enviroment", dsn: 'hi github' })

const app = express()

app.use(Sentry.Handlers.requestHandler())

// error actually came from route inside here
app.use('/dashboard', dashboard) // my dashboard routes

// but sentry thinks it came from here
app.use('/site', sites) // my sites routes

app.use(Sentry.Handlers.errorHandler())

app.use(function(err,req,res,next) {
    if (err) {
        console.log(err)
        if (res.headersSent === false) {
            res.sendStatus(400)
        }
    }
    next()
})

I can provide more info if needed. Thanks!

@tbell511
Copy link
Author

Friendly Bump :)

@AbhiPrasad
Copy link
Member

Closing as part of repo cleanup - if you still encounter this issue please re-open.

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