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

Phusion Passenger + Express + POST = RangeError: Maximum call stack size exceeded #99

Closed
randypang opened this issue Dec 30, 2013 · 12 comments

Comments

@randypang
Copy link

I'm running into issues with newrelic.js + Express running under Phusion Passenger.

Basically any POST that contains data will result in:

RangeError: Maximum call stack size exceeded

The issue only exists when run under Phusion Passenger. I've created a simple setup here with instructions and details so you can reproduce the issue:

https://github.com/randypang/newrelic-express-passenger-post-error

There was a similar issue resolved a few months ago, and although it didn't involve passenger, it may be related:

#50

I don't understand the details of how the newrelic agent or passenger hook into node and why they would conflict, but if you have any ideas I'd love to hear them. More details about Passenger + node.js can be found here:

https://github.com/phusion/passenger/wiki/Phusion-Passenger:-Node.js-tutorial

@othiym23
Copy link
Contributor

Hi, Randy!

We haven't done any testing of New Relic with Passenger, and I imagine now is as good a time as any to start. Thanks for the reduced test case – it will be very helpful. While this does superficially resemble #50, I'm going to guess this is an incompatibility between Passenger and New Relic's monkeypatching, and not Express going rogue (the limit middleware does some complicated things under the hood).

@jacobgroundwater or I will take a look at this tomorrow and let you know if we need anything further from you. Again, thanks for the test case, and sorry for the frustration!

@othiym23
Copy link
Contributor

othiym23 commented Jan 2, 2014

To follow up, @jacobgroundwater did a considerable amount of detective work, and it appears that both Passenger and New Relic are trying to monkey patch IncomingMessage's underlying stream. Due to some wackiness in how streams2 code deals with streams in "flowing mode" (i.e. listening data events), there's some careful bookkeeping that needs to be done with the EventEmitter underpinning the stream, and both Phusion Passenger and New Relic are doing this bookkeeping in a way that assumes they're the only one touching that part of the object.

Neither of us is at fault, so fixing this isn't as simple as filing a bug; we'll need to get in touch with the Passenger team and see if we can figure out a solution that keeps both of us from getting in each other's way. Thanks for bringing this to our attention!

@othiym23
Copy link
Contributor

othiym23 commented Jan 3, 2014

For future reference, I filed an issue on Passenger: https://code.google.com/p/phusion-passenger/issues/detail?id=1042 that links back to @randypang's test case and makes clear that until we can come up with a strategy that works for both of us, it's not safe to use Passenger and New Relic at the same time.

@KidkArolis
Copy link

Has any progress been made regarding this issue?

@othiym23
Copy link
Contributor

@KidkArolis if you take a look at the ticket we filed on Passenger, you'll see that nothing seems to have happened on their end. Sorry! This isn't a problem that New Relic can solve on its own. :/

@KidkArolis
Copy link

But have you tried getting in touch with them other than filing the ticket,
e.g. they always hangout on irc.
On Feb 28, 2014 9:36 AM, "Forrest L Norvell" [email protected]
wrote:

@KidkArolis https://github.com/KidkArolis if you take a look at the
ticket we filed on Passenger, you'll see that nothing seems to have
happened on their end. Sorry! This isn't a problem that New Relic can solve
on its own. :/

Reply to this email directly or view it on GitHubhttps://github.com//issues/99#issuecomment-36334663
.

@othiym23
Copy link
Contributor

No, I haven't. We're pretty busy! If you want to help with this issue, seeing where things stand with Phusion would be very useful. Thanks!

@bourgeois
Copy link

I am experiencing the same issue with Passenger 4.0.41, node v0.10.26 and newrelic 1.5,

Let me know if I can provide any further information !

@othiym23
Copy link
Contributor

@bourgeois @KidkArolis I poked at the Passenger team again, as we still haven't heard anything from them about this, and we do need their participation to resolve this issue. I'm leaving New Relic, so @groundwater and @wraithan will be the people to bug about this in the future.

@othiym23
Copy link
Contributor

According to the Phusion Passenger folkks on phusion/passenger#1141, this has now been fixed (and also they moved their issue tracker to GitHub). If one of y'all wants to give it a shot and see if this issue has been fixed, that would be great!

@KidkArolis
Copy link

I'm using [email protected] and [email protected] and it seems to be working fine now!

@txase
Copy link

txase commented Jun 23, 2014

@KidkArolis Thanks for confirming! I'm going to close this issue as resolved.

@txase txase closed this as completed Jun 23, 2014
cmcadams-newrelic pushed a commit to cmcadams-newrelic/node-newrelic that referenced this issue Jan 29, 2024
…error-fingerprinting/tough-cookie-4.1.3

chore(deps): bump tough-cookie from 4.1.2 to 4.1.3 in /error-fingerprinting
jsumners-nr pushed a commit to jsumners-nr/node-newrelic that referenced this issue Apr 11, 2024
…e-lint

NEWRELIC-5683 added lockfile checks/linting to CI workflow
jsumners-nr pushed a commit to jsumners-nr/node-newrelic that referenced this issue Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants