Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with CompoundJS + Compound Passport #102

Closed
dpecos opened this issue Jan 10, 2014 · 9 comments
Closed

Error with CompoundJS + Compound Passport #102

dpecos opened this issue Jan 10, 2014 · 9 comments

Comments

@dpecos
Copy link

dpecos commented Jan 10, 2014

Hi!

We are using newrelic module, but when we try to use passport, we are getting this:

Error: passport.initialize() middleware not in use
    at IncomingMessage.req.login.req.logIn (/srv/hiphunters/shop_production/node_modules/passport/lib/passport/http/request.js:30:30)
    at Context.delegate.success (/srv/hiphunters/shop_production/node_modules/passport/lib/passport/middleware/authenticate.js:194:13)
    at Context.actions.success (/srv/hiphunters/shop_production/node_modules/passport/lib/passport/context/http/actions.js:21:25)
    at verified (/srv/hiphunters/shop_production/node_modules/passport-twitter/node_modules/passport-oauth1/lib/strategy.js:169:16)
    at /srv/hiphunters/shop_production/node_modules/compound-passport/lib/strategies/twitter.js:12:16
    at /srv/hiphunters/shop_production/app/models/user.coffee:89:22
    at /srv/hiphunters/shop_production/node_modules/newrelic/lib/instrumentation/mongodb.js:162:41
    at /srv/hiphunters/shop_production/node_modules/newrelic/node_modules/continuation-local-storage/context.js:62:17
    at Collection.update (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/collection/core.js:652:12)
    at Collection.<anonymous> (/srv/hiphunters/shop_production/node_modules/newrelic/lib/instrumentation/mongodb.js:174:24)
    at Collection.<anonymous> (/srv/hiphunters/shop_production/node_modules/newrelic/node_modules/continuation-local-storage/context.js:62:17)
    at Collection.wrapSegmentInvocation [as update] (/srv/hiphunters/shop_production/node_modules/newrelic/lib/transaction/tracer.js:175:63)
    at /srv/hiphunters/shop_production/app/models/user.coffee:82:59
    at /srv/hiphunters/shop_production/node_modules/jugglingdb/lib/model.js:450:13
    at /srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/lib/mongodb.js:269:13
    at /srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/cursor.js:162:16
    at /srv/hiphunters/shop_production/node_modules/newrelic/lib/instrumentation/mongodb.js:57:37
    at /srv/hiphunters/shop_production/node_modules/newrelic/node_modules/continuation-local-storage/context.js:62:17
    at commandHandler (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/cursor.js:706:16)
    at /srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/db.js:1806:9
    at Server.Base._callHandler (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/connection/base.js:442:41)
    at /srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/connection/server.js:485:18
    at MongoReply.parseBody (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
    at null.<anonymous> (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/connection/server.js:443:20)
    at EventEmitter.emit (events.js:95:17)
    at null.<anonymous> (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:191:13)
    at EventEmitter.emit (events.js:98:17)
    at Socket.<anonymous> (/srv/hiphunters/shop_production/node_modules/jugglingdb-mongodb/node_modules/mongodb/lib/mongodb/connection/connection.js:418:22)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:746:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:408:10)
    at emitReadable (_stream_readable.js:404:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Socket.Readable.push (_stream_readable.js:127:10)
    at TCP.onread (net.js:526:21)
    at TCP.onread (/srv/hiphunters/shop_production/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:177:31)connect.multip
art() will be removed in connect 3.0

Here is the package.json file:

{
  "name": "hiphunters.shop",
  "version": "0.0.1",
  "engines": [
    "node >= 0.8.0"
  ],
  "main": "server.coffee",
  "dependencies": {
    "ejs": "*",
    "ejs-ext": "latest",
    "express": "~3.x",
    "compound": ">= 1.1.0",
    "jugglingdb": "=0.2.0-41",
    "coffee-script": ">= 1.1.1",
    "stylus": "latest",
    "seedjs": "latest",
    "co-assets-compiler": "*",
    "jugglingdb-mongodb": "https://github.com/jugglingdb/mongodb-adapter/tarball/master",
    "jade": "0.30.0",
    "jade-ext": "0.0.7-9",
    "passport": "~0.1.17",
    "passport-facebook": "~1.0.1",
    "passport-twitter": "~1.0.2",
    "moment": "1.7.x",
    "compound-passport": "https://github.com/hiphunters/compound-passport/tarball/master",
    "passport-local": "~0.1.6",
    "connect-redis": "~1.4.5",
    "redis": "~0.8.6",
    "kue": "~0.6.2",
    "lodash": "~2.3.0",
    "speakingurl": "~0.7.0",
    "newrelic": "~1.2.0"
  },
  "devDependencies": {
    "nodeunit": "*",
    "sinon": "*",
    "supertest": ">= 0",
    "mocha": ">= 0",
    "should": ">= 0",
    "semicov": "*",
    "co-generators": "*",
    "grunt": "~0.4.1",
    "grunt-contrib-coffee": "~0.7.0",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-simple-mocha": "~0.4.0"
  },
  "scripts": {
    "test": "./node_modules/.bin/mocha --require test/init.js test/*/*.test.coffee"
  }
}

Any idea?

Thanks a lot!

@othiym23
Copy link
Contributor

My first thought is that that's a seriously long stack trace! Not that that's the cause of any problems, just something that struck me.

Is there any chance you could provide us with a reduced version of your application that still has this problem? I haven't encountered CompoundJS before, and while it claims to be Express-compatible, I don't know if that extends to the internals New Relic hooks into to do its magic. Can you help me out?

@1602
Copy link

1602 commented Jan 30, 2014

I can confirm that compoundjs does not extends new relic internals (for now). But i'm thinking about that now, since we're started to use new relic in our projects.

@othiym23
Copy link
Contributor

Thanks for chiming in, @1602!

I think you read me backwards – there's a bunch of stuff that node-newrelic does that monkeypunches the prototypes of Express and Connect to do things like route name introspection and error interception. I haven't had the time to look into CompoundJS and see if they're compatible at that level, but my guess is that things are pretty different.

Ultimately, we'd have to see enough usage of CompoundJS to justify building and maintaining support for it in the agent codebase. That's a product and not a technical decision. Bugs like this and requests for CompoundJS support sent to [email protected] are the best way to increase the priority of roadmap items. Thanks!

@1602
Copy link

1602 commented Jan 31, 2014

Thanks for clarifying @othiym23! I see what you mean. I submitted ticket to support. But while compoundjs app is not supported out of box, can we still use some kind of manual API call on newrelic to get more accurate graphs for database and transaction tracing? I have that information available in jugglingdb/compound and it's easy to make it working from my side. As a result nodejs apps (at least with compound/jugglingdb) will looks as good as ror apps in new relic graphs.

@othiym23
Copy link
Contributor

othiym23 commented Feb 1, 2014

Right now, unless you're doing something very unusual with how you handle requests in CompoundJS, you should still be getting database metrics and (sparser, because of the absence of CompoundJS instrumentation) transaction traces. At some point in the not too distant future, we will also add APIs with support for custom tracing and parameters.

@dpecos's issue is still a valid issue, but it may take us a little while to figure out what's going on with it. We take crashing bugs pretty seriously, and mostly just haven't had the cycles to really dig into what bad interaction between New Relic and Compound is causing the crash yet.

@txase
Copy link

txase commented Jun 26, 2014

Hi @dpecos,

Phusion Passenger has been updated recently, and it should work with the Node.js agent now. Please update to the latest versions of Passenger and the Node.js agent.

I am closing this issue because we believe it is resolved. If you continue to have issues, please feel free to reopen this issue.

Thanks!

@txase txase closed this as completed Jun 26, 2014
@ierceg
Copy link

ierceg commented Jul 16, 2014

I for one am still getting this same issue with newrelic 1.8.0 and CompoundJS 1.1.13.

@txase
Copy link

txase commented Jul 18, 2014

Hi @ierceg,

We are transitioning away from using the GitHub issue tracker for support of the Node.js Agent. Instead, please go to http://support.newrelic.com. You will have a better experience through our support portal than we have been able to provide here on GitHub.

We appreciate your understanding as we undergo this transition.

@ierceg
Copy link

ierceg commented Jul 19, 2014

@txase Will do.

@newrelic newrelic locked and limited conversation to collaborators Jul 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants