Tracking in a meteor / node fiber

Now I see this glitch, and I'm not familiar enough with the node fiber infrastructure to know where to start interpreting the error or measuring the code ...

Meteor server running on: http://localhost:3000/ W202407-10:06:05.740(-8)? (STDERR) /Users/dauser/.meteor/tools/0b2f28e18b/lib/node_modules/fibers/future.js:173 W202407-10:06:07.363(-8)? (STDERR) throw(ex); W202407-10:06:07.363(-8)? (STDERR) ^ W202407-10:06:07.363(-8)? (STDERR) RangeError: Maximum call stack size exceeded => Exited with code: 8 => Meteor server restarted 

As I understand it, something repeats a little with enthusiasm, the server stack explodes, and it crashes. Unfortunately, I have no real idea where this abusive function is - I was looking at my call to Deps.autorun (only one at the moment), and this does not seem to be a problem. None of my codes are implemented with explicit recursion, and I have no reason to suspect that large objects are being transferred. Obviously, I'm not sure, of course.

I'm just looking for advice on how to measure code to show me where everything is getting out of hand. As the Meteor does a lot behind the curtains, it would be very helpful if someone could give me some directions as to where to look.

Just going back to that, and I'm still pretty lost as to where to look. this one offered to upgrade to node 0.11.x to give me more information, but it does not add more details in case of crashes.

A failure occurs after the interaction of any page, that is, the server starts and works fine, but if I restart in the browser or interact with the page itself, BOOM!

By popular request, here is the server code:

 isAuthorized = () -> console.log "checking authorization" this.userId == Assets.getText('authorizedUsers') Meteor.methods( isAuthorized : isAuthorized filePickerKey : () -> # TODO: properly abstract this, rather than copy/paste... if this.userId == Assets.getText('authorizedUsers') Assets.getText('fpKey') else Meteor.Error 403, 'Error 403: Forbidden') 

uncommenting line 172 future.js did not provide more details:

 I2041-15:52:07.363(-8)? Resolve cb threw Maximum call stack size exceeded 

And here is the problem that I encounter when trying to use a node inspector. I have been playing with this for the last half hour, so I probably just make some fundamental mistakes, but: I installed the node inspector via npm (npm install -g node-inspector).

then i try

 $ node-inspector & [1] 3408 $ Node Inspector v0.6.2 info - socket.io started Visit http://127.0.0.1:8080/debug?port=5858 to start debugging. $ meteor & [2] 3413 $ [[[[[ ~/Projects/indefinite-ways ]]]]] => Meteor server running on: http://localhost:3000/ $ kill -s USR1 3413 Hit SIGUSR1 - starting debugger agent. debugger listening on port 5858 

still so good. At the moment, the client side is not open in my browser (i.e. there is no tab pointing to localhost: 3000). I open the Chrome tab pointing to localhost: 5858 and see the source for meteor.js. I set a breakpoint on line 6 of meteor.js

 var Fiber = require('fibers'); 

and then open the meteor client tab (localhost: 3000), and the above stack overflow will reappear. The debugger does not stop at line 6 or in any other way indicates what it noticed. The same is true if I set a breakpoint on line 3.

+6
source share
3 answers

A slightly more useful answer comes from Meteor 's unofficial unofficial FAQ :

 $ node-inspector & $ NODE_OPTIONS='--debug-brk' mrt run & 

This will start the node-inspector process in the background, and then start the meteor node container, listening to the debugging flags you need. By opening the Chrome tab at http://127.0.0.1:8080/debug?port=5858 , let me pass.

Also, not strictly answering the question, but the line of violation in the code above seems to raise Meteor.Error in the server code. I still gladly accept the answer to this question, which would define it. I assume that Meteor.Error is not EJSONable at all, and trying to parse it, the stack explodes.

+2
source

Try node-inspector , it allows you to check stop call. This video presentation on how to use it, visually looks like a chrome debugger (this is the same basic source).

+4
source

Line 173 of the future .js directs the exception to the next listener. In your case, the next listener appears - this is the instance itself, resulting in a stack failure cycle.

Edit the future.js file (the path specified in the OP) and uncomment the console.log line just above it ... then you should see a more detailed explanation of what is happening. If console.log didn’t solve the problem, send additional diagnostics here.

I assume this is due to a missing package, for this thread .

+1
source

Source: https://habr.com/ru/post/957612/


All Articles