Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

TypeError occurred with Heroku App


#1

Today(10/03), I deployed my application to heroku for tiny update. I got the following error. When I deployed same application at 09/21, there is no errors.

The newrelic code in my application are “newrelic.js”(configuration) and “require(‘newrelic’);” only.

I think that package compatibility is cause of this error, but it can not be resolved.
Any advice would be greatly appreciated.

Error message:

2014-10-03T15:05:22.033348+00:00 app[web.1]: /app/node_modules/newrelic/node_modules/continuation-local-storage/context.js:78
2014-10-03T15:05:22.033357+00:00 app[web.1]:             ^
2014-10-03T15:05:22.033359+00:00 app[web.1]: TypeError: Object.keys called on non-object
2014-10-03T15:05:22.033361+00:00 app[web.1]:   at Function.keys (native)
2014-10-03T15:05:22.033362+00:00 app[web.1]:   at Object.parseParameters (/app/node_modules/newrelic/lib/util/urltils.js:77:14)
2014-10-03T15:05:22.033364+00:00 app[web.1]:   at TraceSegment.markAsWeb (/app/node_modules/newrelic/lib/transaction/trace/segment.js:91:32)
2014-10-03T15:05:22.033366+00:00 app[web.1]:   at ServerResponse.instrumentedFinish (/app/node_modules/newrelic/lib/instrumentation/core/http.js:96:15)
2014-10-03T15:05:22.033367+00:00 app[web.1]:   at ServerResponse.g (events.js:199:16)
2014-10-03T15:05:22.033369+00:00 app[web.1]:   at ServerResponse.<anonymous> (/app/node_modules/newrelic/node_modules/continuation-local-storage/context.js:74:17)
2014-10-03T15:05:22.033370+00:00 app[web.1]:   at ServerResponse.emit (events.js:129:20)
2014-10-03T15:05:22.033372+00:00 app[web.1]:   at ServerResponse.emitted [as emit] (/app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/emitter-listener/listener.js:122:21)
2014-10-03T15:05:22.033374+00:00 app[web.1]:   at finish (_http_outgoing.js:517:10)
2014-10-03T15:05:22.033375+00:00 app[web.1]:   at /app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:188:31
2014-10-03T15:05:22.033377+00:00 app[web.1]:   at process._tickCallback (node.js:372:11)
2014-10-03T15:05:22.033378+00:00 app[web.1]:

npm ls --depth 0 (in the local env):

async@0.9.0
body-parser@1.9.0
config@0.4.37
connect@2.26.4
connect-flash@0.1.1
connect-mongo@0.4.1
cookie@0.1.2
cookie-parser@1.3.3
ect@0.5.9
express@3.17.6
express-validator@2.6.0
i18n@0.5.0
method-override@2.2.0
mocha@1.21.4
moment@2.8.3
mongoose@3.8.17
mongoose-paginate@2.3.0
newrelic@1.11.3
node-twitter-api@1.4.0
passport@0.2.1
passport-twitter@1.0.2
request@2.44.0
should@3.3.2
socket.io@1.0.6
supertest@0.14.0
underscore@1.7.0

#2

Hi @t_yamo, based on this error it looks like we’re having trouble parsing a request URL. Is there a specific request that this is occurring in conjunction with? Are there any request URLs that changed as a result of your recent update? Have you added any new modules in that update that might change your request URL behavior?


#3

Hi @alexis, thank you for answer.

I did not modify URL behavior specifically, but I found the difference between 0.11.13 and 0.11.14 of nodejs.

sample code:

console.dir(require("url").parse("/", true));

nodejs 0.11.13

{ protocol: null,
  slashes: null,
  auth: null,
  host: null,
  port: null,
  hostname: null,
  hash: null,
  search: '',     <-----
  query: {},     <-----
  pathname: '/',
  path: '/',
  href: '/' }

nodejs 0.11.14

{ protocol: null,
  slashes: null,
  auth: null,
  host: null,
  port: null,
  hostname: null,
  hash: null,
  search: null,     <----- if (parsed.search !== '') in urltils.js
  query: null,     <-----
  pathname: '/',
  path: '/',
  href: '/' }

My package.json include the following code.
When I use “0.11.13” instead of “0.11.x”, this problem is resolved.

  "engines": {
    "node": "0.11.x"
  },

Thanks!


#4

Howdy @t_yamo, unfortunately the node agent doesn’t support beta versions of node. We do a best effort to keep up with 0.11.x releases but they are not officially supported. Only versions are are supported officially are 0.8.x and 0.10.x.

I appreciate you bringing this up though, and I’ll open a ticket to investigate what is going on here since afaict there is no way for that error to happen. It will be important for us to fix that before 0.12 is released.