-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Sentry requests are pending indefinitely #6049
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
Comments
Hi, @antoantonydh. Thanks for writing in! The change you linked does sound like a plausible cause. @Lms24, when you get a chance, would you mind giving this a look? |
Thanks @lobsterkatie. We noticed that, requests are in pending state usually have a large payload (38kB - 40kB). But if the size is the problem, it should not work when we sent the same request from the Postman right? |
Hi @antoantonydh. This sounds strange to me and I can't recall that this came up before. I have a couple of questions:
Let's see if we can narrow this down a little. I'm also curious if this only affects Angular users or if it happens in other frameworks as well (if readers of this issue are affected by the problem please feel free to comment. A last idea would be that this has to do something with Angular's |
Reading this post (which I admit has little in common with your problem other than the pending state), can you verify if the requests that are pending actually made it to Sentry? I.e. do the events show up in Sentry (as issues or transactions)? |
@Lms24 Thanks for the reply and looking into this.
I think, our project started using this initially and never changed the package to @sentry/angular. We have some logic, which we are trying to combine/merge the logs, after only we will call the sentry functions.
I tried in Firefox and there are no issues like this. I used the same env and same user for testing. But in chrome, we are getting pending requests and in the Firefox all are done.
No, we are not using anything else. One thing, I noticed for the fetch API. Those are getting the angular polyfills by default.
Yes. only the HttpClient from Angular
Not at all. It is happening in both scenarios.
I think it is mostly happening to events
|
We just checked it, and it never reached to the sentry. Somehow it is still stuck at the chrome |
I'm not sure if this is strictly the same issue, but it seems too similar to be coincidental, so sharing my experience in case it helps. I'm using the but interestingly, a response (of sorts) Following the crumb that Firefox revealed ( @antoantonydh might be worth exploring this route further in case it's the cause? Appreciate it might be unlikely given that you said the equivalent request via Postman worked for you, whereas the equivalent |
@jazlalli Thanks for sharing the details. In my case, it is totally random, and even the payload is only less than 40kB. As mentioned, when I downgrade to the v7.12.1 it is not happening anymore. But I am yet to test it fully. I will confirm with in couple of days |
@Lms24 we have deployed the downgraded version v7.12.1, and now we have logs coming in properly. So, I suspect either the issue was because of that |
Hi everyone @jazlalli thanks for chiming in but I think this is a separate issue. You're on version 6.11.0 of the SDK which for sure didn't contain any Our intention with adding the Thanks for the polyfill information. I'll look a little into the polyfills that Angular uses for fetch. Maybe they are not compatible with Apart from that, I'd like to make sure that this is indeed caused by #5697 and not by something else. We can try narrowing it down to a specific release: #5697 was introduced in 7.13.0. Would you mind trying that version? Oh, one last thing:
Maybe I'm reading too much into this but can you elaborate a bit on your setup? Are you working on a standard Angular SPA or is it a more compolex setup (e.g. SSR/Angular Universal?) On an unrelated note: |
@Lms24 Thanks for the details.
Yes, same ones are now sending to the sentry. But it is totally random. Sometime these events will be sent to sentry and sometimes not. But downgrading to that version solves this problem.
Sure. Let me try that.
I am working on a standard Angular SPA. However, we have some generic logger services in place for better controlling over different env's (staging, prod etc). So, we are calling the sentry SDK from this service.
Yeah, sure. We will use this package in the future. |
@Lms24 v7.13.0 on the left side and v7.12.1 on the right side |
We are seeing a similar infinite pending behavior in our Next.js app (with Sentry). Gonna try downgrading Sentry and see if it keeps happening |
Hi @adarnon I would be very curious about the result of your investigation. If you can confirm that 7.12.1 did still work fine and 7.13.0 started to show this behaviour the problem around #5697 seems to be broader than just Angular. It might be worthwile to investigate for a short time if both Next and Angular use polyfills thta aren't compatible but if this doesn't lead to anything, we should probably revert #5697 or make the |
We ended up staying with 7.18 but adding |
Confirming we haven't had this issue since turning off the |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This is a huge client-side bug, kind of upsetting no one has bothered responding... Please do not close |
Not going to close this, no worries ;) |
Seeing it with 7.26 and React using @senty-browser. |
I can also confirm that issue is not there after turning off the keepalive flag in the client(#6049 (comment)). |
I am wondering if this is just some protection mechanism browsers employ when too many requests with keepalive are sent. I suspect this isn't an immediate problem with the SDK but rather the way keepalive works. Removing keepalive comes with tradeoffs: + Get rid of pending requests Considering that the pending requests are more or less just randomly sampled by the browser and not sending errors during navigation prevents an entire class of errors being sent to Sentry, I am leaning towards keeping the keepalive flag. But no definitive answer here. |
Update: We have finally identified the underlying issue and have a fix pending to resolve this here: #7553 Thanks for the patience on this, it was rather tricky tracking this down, but we finally got to the bottom of it! |
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which package are you using?
@sentry/browser
SDK Version
7.16.0
Framework Version
Angular 14.2.6
Link to Sentry event
No response
Steps to Reproduce
Sentry requests are pending indefinitely. It is not happening to all the requests. But to the few of them randomly. I checked if it is related to the payload issue by copying the requests from the chrome network tab to postman, and it is working fine without any issues. So, it is happening only from the browser.
I tried to revert to the older version of sentry lib v7.12.1 and seems like issue is solved. Is it related to this change #5697?
Expected Result
Sentry requests should either send to server or gives some error instead of pending state
Actual Result
The text was updated successfully, but these errors were encountered: