Skip to content

TypeError: Invalid URL is thrown from the Undici integration #8145

Closed

Description

@sbellone

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.51.2

Framework Version

No response

Link to Sentry event

https://algolia-site-search-crawler.sentry.io/issues/4155211403/?project=1260143

SDK Setup

Sentry.init({
    dsn: process.env.SENTRY_DSN,
    release: `${version}@${commit}`,
    environment: process.env.CLUSTER_NAME || process.env.NODE_ENV,
    serverName: name,
    maxBreadcrumbs: 10,
    beforeSend: (event, hint) => {
      const exception = hint?.originalException;

      if (exception) {
        if (exception instanceof RabbitMQAckMessageOnOldChannelError) {
          // eslint-disable-next-line no-param-reassign
          event.fingerprint = ['RabbitMQAckMessageOnOldChannelError'];
        }
      }

      return event;
    },
  });

Steps to Reproduce

Run our process as before

Expected Result

No unhandled error coming from the Undici integration

Actual Result

Those unhandled errors started to make our processes crash, immediately after we updated to Sentry v7.50, which enables the Undici integration by default (#7967):
image

Activity

  1. AbhiPrasad commented on May 17, 2023

    @AbhiPrasad
    Contributor

    Hey @sbellone thanks for writing in! Crashing is really bad so we're on it to fix asap!

    What Node version are you on? Is there also a way to tell what the request is? Wondering why the URL is invalid here. Thanks!

  2. self-assigned this
    on May 17, 2023
  3. sbellone commented on May 17, 2023

    @sbellone
    Author

    Thanks for your quick answer @AbhiPrasad.
    Node v18.16.0.
    Unfortunately I haven't find any info about what URL it is nor where the initial call is coming from. An Invalid URL error normally has a input field with the invalid URL, but I think it's not reported anywhere:

    new URL('test')
    Uncaught TypeError [ERR_INVALID_URL]: Invalid URL
        at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
        at new NodeError (node:internal/errors:399:5)
        at new URL (node:internal/url:560:13) {
      input: 'test',
      code: 'ERR_INVALID_URL'
    }
    
  4. changed the title [-]TypeError: Invalid URL is coming from the Undici integration[/-] [+]TypeError: Invalid URL is thrown from the Undici integration[/+] on May 17, 2023
  5. AbhiPrasad commented on May 17, 2023

    @AbhiPrasad
    Contributor

    To help us debug, is it possible you can set includeLocalVariables: true in your Sentry.init (see more details here: https://blog.sentry.io/local-variables-for-nodejs-in-sentry/) and provide us the values of what request/request.path/request.message was? This would allow us to debug further into why this case is happening.

    If you cannot turn this on no worries, we will still work toward reproducing/fixing this! Appreciate the patience.

  6. sbellone commented on May 17, 2023

    @sbellone
    Author

    It's on our prod sorry, we'll stick with v7.49 for now. Thanks again for the quick response.

  7. AbhiPrasad commented on May 17, 2023

    @AbhiPrasad
    Contributor

    We'll cut a patch release today that should hopefully fix this. Sorry for the inconvenience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions