newrelic / node-newrelic

New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
Apache License 2.0
970 stars 399 forks source link

Error in transaction tracer #55

Closed giano closed 11 years ago

giano commented 11 years ago

New release has this issue that crashes app on heroku. Reverted to 11.2 that did not presented it:

   /app/node_modules/newrelic/lib/dominion.js:43 
Oct 09 03:22:09 air-alvieromartini app/web.1:        if (!process.emit('uncaughtException', error)) throw error; 
Oct 09 03:22:09 air-alvieromartini app/web.1:                                                             ^ 
Oct 09 03:22:09 air-alvieromartini app/web.1:  Error: Port Must be Defined 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at instrumentOutbound (/app/node_modules/newrelic/lib/transaction/tracer/instrumentation/outbound.js:16:32) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object.wrappedRequest (/app/node_modules/newrelic/lib/instrumentation/core/http.js:81:7) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object.b (domain.js:183:18) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object.<anonymous> (/app/node_modules/newrelic/node_modules/continuation-local-storage/context.js:50:17) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/node_modules/newrelic/lib/transaction/tracer.js:239:22 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at ErrorTracer.monitor (/app/node_modules/newrelic/lib/error.js:189:12) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Tracer.monitor (/app/node_modules/newrelic/lib/transaction/tracer.js:237:28) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object.wrapSegmentInvocation [as request] (/app/node_modules/newrelic/lib/transaction/tracer.js:146:17) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at call_api (/app/node_modules/cloudinary/lib/api.coffee:266:21) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object.exports.resource (/app/node_modules/cloudinary/lib/api.coffee:68:12) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/api/services/cloudinary_back.js:109:41 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at sails.parse.Cloud.run.success (/app/api/services/cloudinary_back.js:118:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/lib/parse.js:3683:27 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at wrappedResolvedCallback (/app/lib/parse.js:3609:38) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/lib/parse.js:3560:26 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Array.forEach (native) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object._.each._.forEach [as _arrayEach] (/app/lib/parse.js:95:11) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at _.extend.resolve (/app/lib/parse.js:3559:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at wrappedResolvedCallback (/app/lib/parse.js:3618:27) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/lib/parse.js:3560:26 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Array.forEach (native) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object._.each._.forEach [as _arrayEach] (/app/lib/parse.js:95:11) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at _.extend.resolve (/app/lib/parse.js:3559:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at wrappedResolvedCallback (/app/lib/parse.js:3618:27) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/lib/parse.js:3560:26 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Array.forEach (native) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object._.each._.forEach [as _arrayEach] (/app/lib/parse.js:95:11) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at _.extend.resolve (/app/lib/parse.js:3559:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at null.<anonymous> (/app/lib/parse.js:3613:29) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at wrappedResolvedCallback (/app/lib/parse.js:3609:38) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at _.extend.then (/app/lib/parse.js:3643:33) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at wrappedResolvedCallback (/app/lib/parse.js:3612:21) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/lib/parse.js:3560:26 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Array.forEach (native) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at Object._.each._.forEach [as _arrayEach] (/app/lib/parse.js:95:11) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at _.extend.resolve (/app/lib/parse.js:3559:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at xhr.onreadystatechange (/app/lib/parse.js:1517:21) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at dispatchEvent (/app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:570:25) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at setState (/app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:589:14) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at IncomingMessage.<anonymous> (/app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:427:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at IncomingMessage.EventEmitter.emit (events.js:117:20) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at _stream_readable.js:920:16 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at /app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:61:27 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at process._tickDomainCallback (node.js:459:13) 
Oct 09 03:22:09 air-alvieromartini app/web.1:      at process.<anonymous> (/app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/index.js:18:15)
giano commented 11 years ago

A little more infos: it happens during a redirection to external resource (cloudinary managed image) using a simple res.redirect.

othiym23 commented 11 years ago

Hey, Stefano! Thanks for the report! It looks like we introduced a logic error in a change we made in 0.11.6 that we need to fix! You're probably better off reverting to 0.11.5 than 0.11.2 because there's another subtle bug in older versions that can cause crashes before 0.11.5. We should have a fixed version ready for you tomorrow!, and sorry about that!

giano commented 11 years ago

Thanks!

On Wed, Oct 9, 2013 at 4:58 PM, Forrest L Norvell notifications@github.comwrote:

Hey, Stefano! Thanks for the report! It looks like we introduced a logic error in a change we made in 0.11.6 that we need to fix! You're probably better off reverting to 0.11.5 than 0.11.2 because there's another subtle bug in older versions that can cause crashes before 0.11.5. We should have a fixed version ready for you tomorrow!, and sorry about that!

— Reply to this email directly or view it on GitHubhttps://github.com/newrelic/node-newrelic/issues/55#issuecomment-25978087 .

Stefano Valicchia

Computers are like air conditioners, they stop working properly if you open Windows.

giano commented 11 years ago

Just another thing: it seems to "ignore" the rules ignore config, the one with "^/socket.io/*/xhr-polling"

btw, there is a typo:

should be

rules : { ignore : [ "^/socket.io/*/xhr-polling" ] }

instead of

rules : { ignore : [ "^/socket.io/*/xhr-polling" } }

On Wed, Oct 9, 2013 at 4:59 PM, Stefano Valicchia < stefano.valicchia@gmail.com> wrote:

Thanks!

On Wed, Oct 9, 2013 at 4:58 PM, Forrest L Norvell < notifications@github.com> wrote:

Hey, Stefano! Thanks for the report! It looks like we introduced a logic error in a change we made in 0.11.6 that we need to fix! You're probably better off reverting to 0.11.5 than 0.11.2 because there's another subtle bug in older versions that can cause crashes before 0.11.5. We should have a fixed version ready for you tomorrow!, and sorry about that!

— Reply to this email directly or view it on GitHubhttps://github.com/newrelic/node-newrelic/issues/55#issuecomment-25978087 .

Stefano Valicchia

Computers are like air conditioners, they stop working properly if you open Windows.

Stefano Valicchia

Computers are like air conditioners, they stop working properly if you open Windows.

othiym23 commented 11 years ago

If you change that ignore rule to "^/socket.io/.*/xhr-polling" (replace the \ with a .), it should start working. Fixed in the README (not yet pushed yet). I also have a fix for the other issue you were seeing. I'll comment here when we push the new build with the fix.

othiym23 commented 11 years ago

The default port issue is fixed in 5a3e93b27966a951812c9988ebfc7371c6255c05.

The fix for the socket.io ignoring rule documentation landed in de84b8b48ad43bcdeb8e57dbf54b8c17c5f55c39.

Thanks for the reports!