You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sentry keeps saying that the SDK must be updated #6201
Hi @gabrielsch thanks for writing in! This seems a little strange but let's try to find what might be causing this!
First, let's do a sanity check: You said that you can't recall ever having used the 5.12.1 version. Would you nevertheless mind checking your package-lock.json/yarn.lock or deleting and re-installing your node_modules? I'm not sure if there's some sort of version mismatch but weird behaviour like this happens quite often because of some weird dependency issues.
One thing I find interesting is that when looking at your event, I find an error message on the top:
We don't store SDK info in this variable but it might be worth investigating this a little more. Hence a few questions: Are you making modifications to the events (e.g. in beforeSend, beforeSendTransaction or custom event processors)? Do you set special init options (e.g. custom integrations, or perhaps you're setting _metadata?).
Are you perhaps initializing Sentry manually (i.e. create a hub and client yourself instead via Sentry.init)?
@Lms24 just checked the lockfile and we are definitely installing the latest one (7.19)
We do customize the event fingerprint and tags eventually, let me share the code with you:
exportfunctioninitializeSentryClient(config: SentryClientOptions): void{Sentry.init({dsn: config.dsn,tracesSampleRate: 0.25,environment: config.environment,debug: config.debug??IS_DEVELOPMENT,enabled: config.enabled??!IS_DEVELOPMENT,integrations: [newReplay()],ignoreErrors: [/Networkerror/,/ResizeObserverlooplimitexceeded/,/networkerror\(Error\)/,/ResizeObserverloopcompletedwithundeliverednotifications/,/Illegalinvocation/,],// we should mutate the error on `beforeSend` because not all errors in the client side are// captured throug `captureClientException` (in case of uncaught exceptions)// using beforeSend is more reliable since it's the global handlebeforeSend: (event,hint)=>{constmaybeFetcherError=get(hint.originalException,'originalError.responseBody.error.json.fetcherError');if(isFetcherErrorLike(maybeFetcherError)){constddTraceId=maybeFetcherError.fetcherResponse.headers[TRACE_ID_HEADER];constresponseJson=get(hint.originalException,'originalError.responseBody.error.json');event.fingerprint=[responseJson.path,responseJson.type].filter(Boolean);event.tags={
...event.tags,'dd.trace_id': ddTraceId,'dd.search': getDatadogSearchUrl(ddTraceId),};}returnevent;},});}
We have a package wrapping some sentry config defaults, which uses @sentry/nextjs under the hoods.
The next.js app itself uses this wrapper package to initialize sentry on sentry.client.config.ts and sentry.server.config.ts
Interesting. On first glance I can't find anything that would mutate the SDK's metadata object. For a little more context, our SDK holds its info in the client options (which are based on the options passed to Sentry.init).
The warning in the event suggests to me that something in the SDK's event processing pipeline might not work as intended.
Let's check which version the SDK sets locally to its events. I'd suggest using this code:
Insert it once after the Sentry.init call and in beforeSend. It'd be interesting to find out if the SDK has the wrong data from the beginning onwards or if there's anything happening to the client options which causes this.
Is it possible there's a link to our CDN version of the browser SDK somewhere in your header? Something is making it think that not only is it version 5, it's the browser SDK, not the nextjs SDK. (The nextjs SDK didn't even exist until some time early in the 6.x era.)
It's also strange that sdkProcessingMetadata is making its way to Sentry, as we make a point to delete it before events go out the door. I suspect the version mismatch is to blame here, too, though. If a newer version of one package is adding it, but the code which is doing the sending is from an older version, then it wouldn't get deleted.
Side note: This is a place where this would come in really handy.
Hi folks, after spending some more time into this, I realized that the sentry.client wasn't enabled in our app due to a missing env var / config.
After fixing it, issues started being reported in the expected version, however something weird was going on since we were receiving issues from the wrong version even with the client being disabled.
Thank you and sorry for making you spending time on this 😄
Activity
Lms24 commentedon Nov 15, 2022
Hi @gabrielsch thanks for writing in! This seems a little strange but let's try to find what might be causing this!
First, let's do a sanity check: You said that you can't recall ever having used the 5.12.1 version. Would you nevertheless mind checking your
package-lock.json/yarn.lockor deleting and re-installing yournode_modules? I'm not sure if there's some sort of version mismatch but weird behaviour like this happens quite often because of some weird dependency issues.One thing I find interesting is that when looking at your event, I find an error message on the top:
We don't store SDK info in this variable but it might be worth investigating this a little more. Hence a few questions: Are you making modifications to the events (e.g. in
beforeSend,beforeSendTransactionor custom event processors)? Do you set special init options (e.g. custom integrations, or perhaps you're setting_metadata?).Are you perhaps initializing Sentry manually (i.e. create a hub and client yourself instead via Sentry.init)?
gabrielsch commentedon Nov 15, 2022
@Lms24 just checked the lockfile and we are definitely installing the latest one (7.19)
We do customize the event fingerprint and tags eventually, let me share the code with you:
We have a package wrapping some sentry config defaults, which uses @sentry/nextjs under the hoods.
The next.js app itself uses this wrapper package to initialize sentry on
sentry.client.config.tsandsentry.server.config.tsLms24 commentedon Nov 16, 2022
Interesting. On first glance I can't find anything that would mutate the SDK's metadata object. For a little more context, our SDK holds its info in the client options (which are based on the options passed to
Sentry.init).The warning in the event suggests to me that something in the SDK's event processing pipeline might not work as intended.
Let's check which version the SDK sets locally to its events. I'd suggest using this code:
Insert it once after the
Sentry.initcall and inbeforeSend. It'd be interesting to find out if the SDK has the wrong data from the beginning onwards or if there's anything happening to the client options which causes this.lobsterkatie commentedon Nov 17, 2022
A few thoughts here:
sdkProcessingMetadatais making its way to Sentry, as we make a point to delete it before events go out the door. I suspect the version mismatch is to blame here, too, though. If a newer version of one package is adding it, but the code which is doing the sending is from an older version, then it wouldn't get deleted.Side note: This is a place where this would come in really handy.
gabrielsch commentedon Nov 17, 2022
@lobsterkatie @Lms24
Hi folks, after spending some more time into this, I realized that the sentry.client wasn't enabled in our app due to a missing env var / config.
After fixing it, issues started being reported in the expected version, however something weird was going on since we were receiving issues from the wrong version even with the client being disabled.
Thank you and sorry for making you spending time on this 😄
Lms24 commentedon Nov 17, 2022
Great to hear that this is resolved 😄
I'm gonna close this issue but feel free to tag us in case more needs to be done here.