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

Opentelemetry api npm peer dep broken with strict pnpm #13219

Closed
3 tasks done
vchernin opened this issue Aug 3, 2024 · 10 comments · Fixed by #13640
Closed
3 tasks done

Opentelemetry api npm peer dep broken with strict pnpm #13219

vchernin opened this issue Aug 3, 2024 · 10 comments · Fixed by #13640
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug

Comments

@vchernin
Copy link

vchernin commented Aug 3, 2024

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/node

SDK Version

8.22.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

.npmrc (despite this originally being for npm, pnpm stores its own config options in this file):

strict-peer-dependencies=true

package.json:

{
  "name": "my-local-package",
  "dependencies": {
    "@sentry/node": "8.22.0"
  }
}

pnpm install

Tested with pnpm 9.6.0.

Expected Result

Correct peer deps versions and successful installation with the strict-peer-dependencies setting enabled.

Perhaps the @opentelemetry/api version from @sentry/node should be downgraded, or maybe the @opentelemetry/instrumentation-mongodb can be upgraded.

The pnpm setting strict-peer-dependencies is not enabled by default and I could set it to false. But it seems like a bug to have potential version mismatch.

Actual Result

Result:

Scope: all 12 workspace projects
Progress: resolved 1, reused 0, downloaded 0, added 0
Progress: resolved 117, reused 0, downloaded 0, added 0
Progress: resolved 472, reused 0, downloaded 0, added 0
Progress: resolved 869, reused 0, downloaded 0, added 0
Progress: resolved 1104, reused 0, downloaded 0, added 0
Progress: resolved 1124, reused 0, downloaded 0, added 0, done
 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

my-local-package
└─┬ @sentry/node 8.22.0
  └─┬ @opentelemetry/instrumentation-mongodb 0.46.0
    └─┬ @opentelemetry/sdk-metrics 1.24.1
      ├── ✕ unmet peer @opentelemetry/api@">=1.3.0 <1.9.0": found 1.9.0 in @sentry/node
      ├─┬ @opentelemetry/core 1.24.1
      │ └── ✕ unmet peer @opentelemetry/api@">=1.0.0 <1.9.0": found 1.9.0 in @sentry/node
      └─┬ @opentelemetry/resources 1.24.1
        └── ✕ unmet peer @opentelemetry/api@">=1.0.0 <1.9.0": found 1.9.0 in @sentry/node

hint: If you don't want pnpm to fail on peer dependency issues, add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Aug 3, 2024
@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Aug 3, 2024
@mydea
Copy link
Member

mydea commented Aug 5, 2024

Hey, this is weird, because the mongodb instrumentation has this depednency: "@opentelemetry/sdk-metrics" "^1.9.1", which should resolve to the latest current version (1.25.1)of@opentelemetry/sdk-metrics`, which in turn allows 1.9.0 of the API package. Why is it pulling in 1.24.1 of sdk-metrics? Can you try clearing your cache?

@vchernin
Copy link
Author

vchernin commented Aug 6, 2024

I could not consistently reproduce following my instructions as I had expected. The only workaround I could find was to delete the pnpm-lock.yaml file and reinstall all the dependencies. (I also happend to purge the node_modules directories and pnpm store just in case).

In any case this is a bug in pnpm and not sentry.

@lenovouser
Copy link

I am also experiencing this. With version 8.29.0.

@vchernin
Copy link
Author

vchernin commented Sep 9, 2024

I am also seeing this with version 8.29.0. This time deleting pnpm-lock.yaml and purging node_modules and the pnpm store does not workaround this. The dependency chain is also a bit simpler.

my-local-package
└─┬ @sentry/node 8.29.0
  └─┬ @sentry/opentelemetry 8.29.0
    └── ✕ unmet peer @opentelemetry/instrumentation@^0.52.1: found 0.53.0

This seems like a problem here since @sentry/node provides 0.53.0 while @sentry/opentelemetry depends on 0.52.1 of @opentelelemtry/instrumentation.

"@opentelemetry/instrumentation": "^0.53.0",

"@opentelemetry/instrumentation": "^0.52.1",

The peer dep is specified allowing semver minor ranges, except since this is a 0.x.x version any minor change could be a breaking change according to semver, so pnpm is correct to complain here so I am reopening.

@vchernin vchernin reopened this Sep 9, 2024
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Sep 9, 2024
@billyjanitsch
Copy link

Seems like an oversight in #13587.

@andreiborza
Copy link
Member

Sorry about that, we'll get this resolved as quickly as we can. I opened a PR for it #13640

andreiborza added a commit that referenced this issue Sep 10, 2024
…t and opentelemetry (#13640)

Looks like we overlooked two packages when updating deps previously in
#13587.

See:
#13587 (comment)

Closes: #13219
@AbhiPrasad
Copy link
Member

Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/8.30.0 - thanks for your patience

@lenovouser
Copy link

I am also experiencing this. With version 8.29.0.

This has happened again with version 8.37.0 (current release, not fixed). Is there a way where a test or something can be added in order to not create releases with this issue again? We can't even prevent this on our side unless we go for pinning minor versions, which we ideally do not want.

@andreiborza
Copy link
Member

@lenovouser sorry about that. We used Dependabot and bumped deps here #14174 but alas it didn't catch everything.

I pushed a fix for this and we'll release a patch.

We're thinking of a way to catch these in e2e tests.

@andreiborza
Copy link
Member

The fix has been released with 8.37.1, please upgrade. Sorry for the inconvenience again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug
Projects
Archived in project
6 participants