Cannot read property 'start' of null with Mongodb instrumentation crashes the app

Exception message
Cannot read property 'start' of null
Culprit
wrappedFunction (node_modules/elastic-apm-node/lib/instrumentation/modules/mongodb-core.js)

node_modules/elastic-apm-node/lib/instrumentation/modules/mongodb-core.js in wrappedFunction at line 107

105.          span = agent.buildSpan()
106.          arguments[0] = wrappedCallback
107.         span.start(this.ns + '.' + (this.cmd.find ? 'find' : name), 'db.mongodb.query')
108.        }
109.      }

versions:
mongodb node client 2.2.21
mongoose 4.13.3
node.js v8.5.0

Hi Shimi

Thanks for letting us know about this bug. I'm terribly sorry this snug into a release. I've opened a PR that fixes this, and will let you know once it's released.

Best,
Thomas

This have now been fixed and released in v1.1.1 of the Node.js agent

Thanks Tomas,

I tried 1.1.1 and it works now
thanks

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.