-
-
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
Out of Memory (OOM) since updating CDN to Loader v8 #13939
Comments
Hey, thank you for writing in. Could you also provide the config you had on v7 that was working? Just to see if I can spot something. One thing I noticed when trying this is that there was a CORS error for loading the scripts. Do you have content policies correctly set up to allow loading scripts from browser.sentry-cdn.com? I would guess that what's happening is an infinite loop, so something in your config code is triggering an error which triggers an error etc. 🤔 Looking through your code, can it be that beforeSend: function(event, hint) {
try {
// Assuming latestBuildNumber is set outside somewhere??
if (latestBuildNumber.startsWith("debug")) {
return null;
}
const error = hint.originalException;
const message = hint.syntheticException;
if (error && error.message && (error.message.startsWith("AI: 61 message") || error.message.startsWith("%cOpenTok:") || error.message.includes("OpenTok"))) {
event.fingerprint = ['ignore-event']; // falls Event nicht verworfen wird
return null; // Event verwerfen!
} else if (message && message.message && (message.message.startsWith("AI: 61 message") || message.message.startsWith("%cOpenTok:") || message.message.includes("OpenTok"))) {
event.fingerprint = ['ignore-event']; // falls Event nicht verworfen wird
return null; // Event verwerfen!
}
} finally {
// If an error happens somewhere in this function, handle it gracefully
return event;
}
}, |
Hi, we put a nonce for CSP to the script already but we are currently not preventing script sources by CSP, only frame source:
Never seen a CSP error for sentry so far. sentryDiscardEvent (and latestBuildNumber) is set and only missing in snippet: I cannot see any error that is thrown repeatedly in the console. We did not use loader v7, we used CDN integration. So then |
P.S.: When I remove Sentry.Init from code, there is no "OOM" happening. The "OOM" seems to happen when this URL is called: Maybe that "sentry_version" parameter is wrong? Sentry sets it itself. |
Ahh, I think I know what it may be: Sentry.getCurrentScope().setLevel("warning"); |
This was the solution! I removed it anyway as it is not required anymore. Thanks for your support. |
P.S.: Maybe there should be some migration document ;-) |
Oh no.... Rejoiced too soon... It just takes longer for the OOM to appear, but it's still coming, |
You can find migration docs here: https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/ :)
Hmm, damn... I opened a PR here to prevent the former case for the future: getsentry/sentry#78993 Hm, i am pretty sure the error is then due to the captureConsole integration. probably something logs an error, which is captured to sentry, which somehow leads to an error being logged. Could you try removing this: Sentry.addIntegration(
captureConsole({
levels: ['error'] // ,'warn'
})
); and see if that affects it? And if not, try to remove as much as you can from the |
Okay. After further investigation it now seems to be a newly triggered error by Cloudflare Turnstile (in some rare cases), that will throw an error repeatedly, which is causing the "OOM" now. That did not happen before as the Sentry integration already stopped the page rendering with its "OOM". So, the solution is to remove the deprecated |
OK, great to hear that! |
If a user has an error in their `sentryOnLoad` function for the Loader Script, we do try-catch it today, but we stop any further processing, leading to possible issues down the line (e.g. errors not being sent to Sentry etc). This PR changes this so that we catch errors in this first, and continue if it happens. This means that we'll still do the default `Sentry.init()` and send the error that triggered lazy loading to Sentry - this was previously swallowed by the catch. Closes getsentry/sentry-javascript#13939 Test added here: getsentry/sentry-javascript#13952
If a user has an error in their `sentryOnLoad` function for the Loader Script, we do try-catch it today, but we stop any further processing, leading to possible issues down the line (e.g. errors not being sent to Sentry etc). This PR changes this so that we catch errors in this first, and continue if it happens. This means that we'll still do the default `Sentry.init()` and send the error that triggered lazy loading to Sentry - this was previously swallowed by the catch. Closes getsentry/sentry-javascript#13939 Test added here: getsentry/sentry-javascript#13952
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
Sentry Browser Loader
SDK Version
8.33.1
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
Steps to Reproduce
It also happens for other (non-public URLs). One additional public URL is https://hire.clevermatch.com/de/account/login/. I do not really have reproduction steps for that URL, but it seems only waiting for some time will trigger OOM.
Expected Result
Load sentry without leading to "out of memory" in browser.
Actual Result
Some Sentry requests "outstanding" and "out of memory" in browser.
The text was updated successfully, but these errors were encountered: