-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remix - No URL included with issues #6139
Comments
All the request headers are missing too, and the user is not identified at all (whereas in Node the user is identified by IP address) |
Hey thanks for writing in @alexblack! Could you share your Sentry server initialization code? @onurtemizkan mind taking a look at this when you get the chance? |
@AbhiPrasad thanks, sure on the server we do:
|
Hi @alexblack! Thanks for reporting. I was not able to reproduce the issue with a generic Remix/Express project. Could you provide a minimal reproduction so we can debug it? |
Thanks for looking into this. Ok that's good to hear. Can you confirm -
that it is expected then that the url, request headers etc, should show up
in the server side issues?
Do you know which part of the sentry remix config code enables this? Eg is
there some chance I missed part of the integration?
…On Tue, Nov 8, 2022, 4:17 AM Onur Temizkan ***@***.***> wrote:
Hi @alexblack <https://github.com/alexblack>! Thanks for reporting.
I was not able to reproduce the issue with a generic Remix/Express
project. Could you provide a minimal reproduction so we can debug it?
—
Reply to this email directly, view it on GitHub
<#6139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABELQUURINJMWMA6SV6HUDWHJAE3ANCNFSM6AAAAAARYESTDY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@alexblack -- Yes, the URL is expected to show up in the server-side issues since version It should work out of the box for document requests, actions and loaders. Only configuration I can think of that may cause this is the But also, there may be a case in your project that we are missing to enrich captured events with |
Hi. I'm experiencing the same in my NestJS/Express application. No url, no headers, no user identified. Maybe this be related to this release, specifically to this PR? |
@onurtemizkan great, how about request headers? should I expect the user to be identified by IP address? Both of these work in node. Here is a repo that I just created, using |
@leandro-gomez - You're right about the likely culprit. EDIT: Realized belatedly that we're talking about nest, not next. |
@onurtemizkan here are two issues and how to reproduce:
Second issue (calling
|
Here the repository: https://github.com/leandro-gomez/sentry-nestjs-6139
I've found the problem may be related to If you use The Documentation says:
|
Thanks, @leandro-gomez.
Interesting. We must not be retrieving the correct scope when we go to clone it. EDIT: Oh, jeez. I just realized when I looked at your repro that this is a neSt app, not a neXt app. We don't have official nest support (and I'm not super familiar with nest), but my guess would be that the |
NestJS uses Express internally. We were using Sentry with NestJS just fine until recently. |
Right, I understand. The thing is, the event processor which used to add the data also lived on the scope, so I'd think that if Perhaps we can back up a step, though: Is the fact that you're manually capturing the error (with or without |
Yes, We were using withScope the whole time, from months now.
This is how it's configured in production, the errorHandler doesn't work with NestJS |
hi @onurtemizkan did those steps and github repo give you what you need to look into this? thanks |
hi @onurtemizkan just following up, thanks! |
Hi @alexblack, thanks for reproductions! I have been debugging them, and there seem to be a few things here we need to figure out. cc: @lobsterkatie
Also, as a side note, there is some missing configuration on your side about connecting FE and BE services. So your |
Thanks for looking into all this. And thanks for the tip, I'll look into the config to connect front end and backend. |
@leandro-gomez Got it, thanks. UPDATE: I'd written a whole long thing here, and in the process of writing the last sentence, it all of a sudden dawned on me what the problem was. Should be fixed in #6218. Yay for rubber ducks. |
@onurtemizkan - So I think that of your three points listed above, only the second is outstanding, yeah? |
Hi @AbhiPrasad I re-ran the repro steps with sentry 7.20.1, and in both cases I get 0 users, when I expected 1. Am I missing something? See: https://develop.sentry.dev/sdk/data-handling/
I think its expected that there is a user identified in each of these errors, since these errors happen on the server. Regardless, I tried setting (Everything else looks much improved, URLs show up now, headers show up now, etc, thanks!) |
Also, it seems like transactions are not parameterized as expected For the URL http://localhost:3000/tutorial/foo I expected the transaction to be something like |
You have to explicitly enable this by setting
We should be parameterizing, @onurtemizkan could you confirm that this works? |
Thanks I'll try the IP setting.
Regarding parametrization, you can see with the GitHub repo and
reproduction steps that I provided (above) that it's not working in this
case.
…On Tue, Nov 22, 2022, 4:25 AM Abhijeet Prasad ***@***.***> wrote:
I think its expected that there is a user identified in each of these
errors, since these errors happen on the server. Regardless, I tried
setting sendDefaultPii: true in the initialization on both server and
client in the repo, and that didn't change anything, I still got 0 users
for each error, when I expected 1
You have to explicitly enable this by setting include.ip: true. See:
https://docs.sentry.io/platforms/node/configuration/integrations/default-integrations/#requestdata
I expected the transaction to be something like GET
https://localhost:3000/tutorial/$slug instead of GET
https://localhost:3000/tutorial/foo, is this something that sentry is
meant to do? I think you do something like this for node/express (without
remix)
We should be parameterizing, @onurtemizkan
<https://github.com/onurtemizkan> could you confirm that this works?
—
Reply to this email directly, view it on GitHub
<#6139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABELQQ6HT3XCBOYUW2RMX3WJS3SFANCNFSM6AAAAAARYESTDY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ok I tried using
I then followed the reproduction steps I provided above, and same issue, Users is still 0, when I expected it to be 1. |
Hi, I ran the repro steps again today with that github repo, using 7.22.0 (released today), and I still see the same issue. Sentry reports 0 users for each error, when I expected it to report 1 user, given that the repo initializes sentry on the server like this:
Is there something else I need to do to get Sentry to identify the user by IP address here? |
Hi, any update? I am still not seeing users identified by Sentry here. I reported this in detail in the repro steps on Nov 10th: #6139 (comment) and mentioned it earlier on Nov 5th: #6139 (comment) It seems like Sentry's documentation says you support this, I've mentioned it many times in this thread, it seems like its not working. Are you seeing something different when you test it? |
@alexblack Hi, we tried to resolve this in https://github.com/getsentry/sentry-javascript/pull/6263/files. As you can see, remix doesn't provide a way to read an IP off a request. Our attempted fix is using a best-effort heuristic to determine the IP based on incoming headers that might contain the user ip. If none of these headers are on the request, there's no way to determine the IP. The express integration can read the IP off the request object because express puts it there. However, that way of reading the IP has its own set of problems, since it can't always be trusted or it might even be wrong depending on the networking setup. Of course, we could set the user to a random ID just so that "users: 0" disappears, but that would be about as useful as having "users: 0". One thing I could think of would be to provide a hook in the SDK options that would allow you to set the user yourself depending on what's on the request object remix provides. There you could use a (hashed) session cookie or really anything that's on there to determine a user value. Would something like that help in your case? The remix SDK is still quite young and there are things to improve so thank you for your feedback! |
Hi @lforst I get that finding the IP address might be challenging, but, we see the IP address on every server side sentry event in the headers, using a header name that remix-utils/getClientIpAddress checks for. You guys closed this issue several times. Each time you closed the issue, was the problem fixed? eg in your test was Sentry/remix now able to identify users by IP address? Remix has a function See this issue in production using latest: https://sentry.io/organizations/syncwith/issues/3780781591/?project=5880196&query=is%3Aunresolved&referrer=issue-stream |
We added this utility function for the functionality that initially closed this issue:
For some reason though, it doesn't seem to be getting detected, so we'll keep investigating here. |
Here's another example: https://sentry.io/organizations/syncwith/issues/3782138918/?project=5880196&query=is%3Aunresolved&referrer=issue-stream In this example, I'm using the remix-utils function But, sentry still says 0 users, despite the fact that the IP address is available easily. Before send:
Helper function:
|
Hi @alexblack, just tried to reproduce with the project you provided. It's working fine on local (with manually added headers). The implementation of |
Hi @onurtemizkan sure thing I'll try deploying the reproduction repo and get back to you. If the net core module was missing, wouldn't I expect to see error(s) related to that if you're using that? It looks to me like this module is part of node, so I'm not sure how we could be missing it. We're using node and express. |
Hi @onurtemizkan I deployed the repo here: https://sentry-remix-test1.onrender.com/ And I still have the same issue, users is at 0, despite the IP address being in the headers. |
Ah my mistake, it looks like the github repo is not yet using the latest sentry... I am going to update it, redeploy and try again. |
Ok my apologies, its working now in this test repo. Great! Its still not working for me in our production app, but I realized I am not yet using the RequestData integration there, I'll add that and hopefully that does it. Thanks for your help. |
This is working now, thanks! |
One question - it seems like what was missing was using the RequestData integration to specify to include the ip. This integration is in sentry/node, which seems to imply its just on the server. Do I need to do anything to get this functionality on the client? eg if an error happens on the client, and is tracked to sentry, will the user be identified by IP address? |
For the client our ingest servers will pick up the IP address the event got sent from. So it should just work there. |
Going to close since this seems fine, but please reach out if there are any other problems. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/remix
SDK Version
7.17.4
Framework Version
7.17.4
Link to Sentry event
https://sentry.io/organizations/syncwith/issues/3721867878/?project=5880196&referrer=issue-stream
Steps to Reproduce
We've integrated Sentry into our remix application, on the server and the client, and with express, as indicated in your instructions (hopefully we didn't make any mistakes)
When errors are reported in Sentry, I expected to be able to see the URL that the user was on when the error occured, and the user agent, and other information about the request, like we can with our node Sentry integrations.
See attached screenshot of a remix sentry error with no URL mentioned, and one from our node integration where we get the URL.
I believe we've integrated the express request handler as specified:
Expected Result
I expected that sentry would grab the URL and other relevant info from the current request and include it in the error. Note this error occured on the server (node) not client (react).
Actual Result
The text was updated successfully, but these errors were encountered: