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


(Shimi) #1

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


(Thomas Watson) #2

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


(Thomas Watson) #3

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


(Shimi) #4

Thanks Tomas,

I tried 1.1.1 and it works now
thanks


(system) #5

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