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

Cannot create property 'sdk' on boolean 'false' #3518

Closed
3 tasks
edwh opened this issue May 9, 2021 · 4 comments · Fixed by #3713
Closed
3 tasks

Cannot create property 'sdk' on boolean 'false' #3518

edwh opened this issue May 9, 2021 · 4 comments · Fixed by #3713
Labels
Package: core Issues related to the Sentry Core SDK Type: Bug

Comments

@edwh
Copy link

edwh commented May 9, 2021

Package + Version

  • @sentry/browser 6.2.5
  • @sentry/node 6.2.5
  • @nuxtjs/sentry: 5.0.3

(This is not quite the latest version of the Sentry modules, but I think it's the latest nuxt wrapping of them.)

Description

I see many errors like this:

Cannot create property 'sdk' on boolean 'false'

The error is in the sentry code, here:

function enhanceEventWithSdkInfo(event, sdkInfo) {
    if (!sdkInfo) {
        return event;
    }
    event.sdk = event.sdk || {
        name: sdkInfo.name,
        version: sdkInfo.version,
    };

I don't know why event should be false, but it doesn't look robust against that possibility. If it was, then I might find out more about the underlying error.

An example: https://sentry.io/organizations/freegle/issues/2379888684/

I don't have a standalone repro for this, but I see it about ten times a day on a live system, so I can test things fairly easily.

@lobsterkatie
Copy link
Member

Nothing in our SDKs should be setting event to false, and I just had a quick glance at the nuxt plugin code, and it's all about getting Sentry initialized and configured - nothing about event processing that I could see. So this is very mysterious.

I notice there are no breadcrumbs on your event. Do you know why that is? Having them on would tell us what happened immediately before this error, which might provide some helpful context.

@edwh
Copy link
Author

edwh commented May 24, 2021

@lobsterkatie I'd assumed I don't get breadcrumbs because the Sentry exception handling code itself throws an exception here. I normally get breadcrumbs, including for (other) TypeErrors.

How would you feel about making the Sentry code more resilient to this case, so that we can then see what extra info we can get out of it?

@edwh
Copy link
Author

edwh commented Jun 20, 2021

It's looking like this is caused by a beforeSend method that is wrongly returning false rather than null when trying to suppress an exception.

That would be my fault, but you might like to make the code resilient to this, because I won't be the only idiot around.

@kamilogorek
Copy link
Contributor

@edwh totally agree, sent an appropriate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: core Issues related to the Sentry Core SDK Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants