Closed SteffenLanger closed 1 month ago
@onurtemizkan could you have a look at this?
Affected me as well. Node v22.8.0 in ubuntu 24.04. AWS ARM64 machine Interesting fact - inside docker with ubuntu 22.04 and node 22.8.0 it works well (mac m1 as a host)
Thanks for the extra info, we're still looking into this.
Hi all! It looks like the root of this issue is fixed on mongoose v8.6.3
(Fix PR). Please reopen if the issue persists after updating to 8.6.3. Thanks!
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
8.30.0
Framework Version
Node.js v22.1.0 macOS 14.6.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
Reproduction repo at https://github.com/SteffenLanger/reproduce-mongoose-integration-sentry-bug
package.json
instrument.js
index.js
Steps to Reproduce
Start the index.js script:
node --import=./instrument.js index.js
Expected Result
The script should run without errors.
Actual Result
An error is thrown and the script exits.
The issue seems to lie in Sentry's dependency
@opentelemetry/instrumentation-mongoose
atnode_modules/@opentelemetry/instrumentation-mongoose/build/src/mongoose.js:94:44)
. It tries to monkey patchmongoose.Aggregate
butAggregate
does not exist on Mongoose (anymore?).This is the opentelemetry code (see "
<-- ISSUE LIES HERE
"):