Skip to content

Local variables issue: The inspector session is already connected #10278

Closed

Description

@alfaproject

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

7.94.1

Framework Version

node 20.10

Link to Sentry event

https://the-mill-adventure.sentry.io/issues/4896658537/events/e2ccbd047eb44463ba3af8035a1ccd95/

SDK Setup

  init({
    dsn: getEnvString('SENTRY_DSN'),
    environment: appStage(),
    includeLocalVariables: appEnv() === 'dev',
    integrations: [new AWSServices(), new ExtraErrorData(), new Mongo()],
    normalizeDepth: 5,
    beforeSend(event, { originalException: error }) {
      if ((error as { skipReport?: boolean }).skipReport) {
        return null;
      }

      if (appEnv() === 'dev' && appStage() !== 'ci-master') {
        return limitRepetitiveSentryAlerts()(event);
      }

      return event;
    },
  });

Steps to Reproduce

Set includeLocalVariables to true in Sentry init as per blog post

Expected Result

Local variables work

Actual Result

Keep getting the error in the title and linked Sentry event

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Jan 20, 2024
  2. Lms24 commented on Jan 23, 2024

    @Lms24
    Member

    Hi @alfaproject thanks for writing in!

    @timfish would you mind taking a look at this when you have time? Thank you!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Jan 23, 2024
  4. cbeardsmore commented on Jan 23, 2024

    @cbeardsmore

    Seeing the same error after upgrading to 7.95.0 today 😭

  5. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Jan 23, 2024
  6. timfish commented on Jan 23, 2024

    @timfish
    Collaborator

    Seeing the same error after upgrading to 7.94.1 today 😭

    I'll be looking into this first thing tomorrow. What version did you update from?

  7. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Jan 23, 2024
  8. cbeardsmore commented on Jan 24, 2024

    @cbeardsmore

    Our prod is running the following without seeing this issue:

        "@sentry/integrations": "7.92.0",
        "@sentry/node": "7.92.0",
    

    And saw the first error log today in staging with (not 7.94.1 like I reported earlier sorry):

        "@sentry/integrations": "7.95.0",
        "@sentry/node": "7.95.0",
    

    Sample stack trace if its useful:

    ["Error [ERR_INSPECTOR_ALREADY_CONNECTED]: The inspector session is already connected","    at Session.connect (node:inspector:67:13)","    
    at cge.configureAndConnect (/node_modules/@sentry/src/integrations/local-variables/local-variables-sync.ts:97:19)","    
    at Object.setup (/node_modules/@sentry/src/integrations/local-variables/local-variables-sync.ts:344:81)","    
    at setupIntegration (/node_modules/@sentry/src/integration.ts:119:105)","    
    at integration (/node_modules/@sentry/src/integration.ts:95:7)","    
    at Array.forEach (<anonymous>)","    
    at setupIntegrations (/node_modules/@sentry/src/integration.ts:92:16)","    
    at _he.setupIntegrations (/node_modules/@sentry/src/baseclient.ts:321:28)","    
    at oO.bindClient (/node_modules/@sentry/src/hub.ts:171:14)","    
    at Object.wLt (/node_modules/@sentry/src/sdk.ts:37:7)"]
    
  9. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Jan 24, 2024
  10. alfaproject commented on Jan 24, 2024

    @alfaproject
    Author

    LocalVariables never really worked for us, or at least I never saw any variables in Sentry interface ever since it was introduced. This session error in particular happened a few versions ago so we disabled it because there were more changes coming and we thought it was a know issue. Then when those changes were released we enabled it again but once again no variables in the interface, so we just ignored waiting for better days. Then updated again and once again the session error at which point we thought it's probably not a known error and that's when we reported.

    tl;dr never worked in any version

  11. added a commit that references this issue on Jan 24, 2024
    d471dcf
  12. ghost added on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions