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

Bad use of underscore method causing a crash #247

Open
Fen747 opened this issue Aug 9, 2016 · 4 comments
Open

Bad use of underscore method causing a crash #247

Fen747 opened this issue Aug 9, 2016 · 4 comments

Comments

@Fen747
Copy link

Fen747 commented Aug 9, 2016

Hi,

I'm having this fatal error on my server :

message: Cannot use 'in' operator to search for 'message' in undefined stack: TypeError: Cannot use 'in' operator to search for 'message' in undefined at packages/underscore/underscore.js:860:1 at Array.forEach (native) at _.each._.forEach (packages/underscore/underscore.js:105:1) at Function._.pick (packages/underscore/underscore.js:859:1) at Subscription.subscriptionProto.error (packages/meteorhacks_kadira/lib/hijack/wrap_subscription.js:51:1) at Subscription._runHandler (packages/ddp-server/livedata_server.js:1033:12) at Subscription.MeteorX.Subscription._runHandler (packages/meteorhacks_unblock/packages/meteorhacks_unblock.js:55:1) at Subscription.subscriptionProto._runHandler (packages/meteorhacks_kadira/lib/hijack/wrap_subscription.js:12:1) at Session.MeteorX.Session._startSubscription (packages/meteorhacks_unblock/packages/meteorhacks_unblock.js:43:1) at Session.sub (packages/ddp-server/livedata_server.js:617:12)

It seems that in this file, line 51, a call is made to underscore's _.pick method (line 856), which then use the in operator on the objargument, which is undefined, causing my app to crash.

I haven't changed my code for something like 4 or 5 days, and the error started to happen last night.

I've no idea how to correct that or why it happens now. My app keeps crashing now on a certain user action (it seems), unknown to me, and I'm totally unaware of how to solve that. But it seems that the problem really comes from Kadira, which pass an undefined parameter to _.pick.

@Fen747
Copy link
Author

Fen747 commented Aug 9, 2016

Okay, I have commented the Kadira package until I solve this.

Thanks to MeteorX and a lot of code reading (MeteorX's very smartly built btw), I've been able to see that the err undefined parameter comes from the internal Subscription prototype, which is itself called with an undefined error. But I'm still unable to know why or where (in my app).

It'd be great if the error stack trace was more explicit on server errors, like with a Zones.js for server for example.

@actionnick
Copy link

Also having this issue @Fen747, did you ever end up figuring out how to resolve it?

@btbjosh
Copy link

btbjosh commented Mar 8, 2017

Also having this issue on all deployments with Meteor 1.4.2.1

@haunguyen90
Copy link

@Fen747 Do you have any ideas of how to fix it ?

hwillson added a commit to meteor/meteor-apm-agent that referenced this issue Jul 19, 2018
In some cases the `subscriptionProto.error` function override
defined in `wrapSubscription` can receive a falsey `err`
parameter. When this happens an exception is thrown since
the error function override isn't being very defensive. The
changes in this commit skip error handling if the passed in
error is invalid.

Original issue: meteorhacks#247
hwillson added a commit to meteor/meteor-apm-agent that referenced this issue Jul 19, 2018
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

4 participants