Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

[Stack] Errors parsing stack frames when using pretty-error module. #99

Open
bonesoul opened this issue May 10, 2017 · 13 comments
Open
Assignees
Milestone

Comments

@bonesoul
Copy link

node 7.10.0
win10 - x64

my code;
if (process.env.NODE_ENV !== 'production') { require('@glimpse/glimpse').init(); }

getting luts of errors like;

Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - Array.forEach
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - application.js:217 Function.use
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - server.js:110 Promise
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - debuggability.js:300 Promise._execute
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - promise.js:483 Promise._resolveFromExecutor
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - promise.js:79 new Promise
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - server.js:47 run
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - app.js:100 startup
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - next_tick.js:109 process._tickCallback
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - application.js:220 Function.<anonymous>
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - Array.forEach
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - application.js:217 Function.use
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - server.js:129 Promise
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - debuggability.js:300 Promise._execute
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - promise.js:483 Promise._resolveFromExecutor
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - promise.js:79 new Promise
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - server.js:47 run
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - app.js:100 startup
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:    - next_tick.js:109 process._tickCallback
Glimpse (Error StackHelperUnsupportedStackFrameFormat): Unsupported stack frame format found:
@mike-kaufman
Copy link
Contributor

Thanks for reporting this @bonesoul. We'll take a look and hopefully get a fix quickly. Note that while this looks like a lot of errors, Glimpse should still be working, the only thing impacted is our ability to display source code locations where certain events occur (e.g., where middleware is registered, where log statements are made, or where http client calls occur)

@bonesoul
Copy link
Author

i can't get glimpse working as the huge amount of errors slows down my application, i can not even boot it.

@mike-kaufman
Copy link
Contributor

sorry to hear that. :(. Is your application public by chance so that I can take a look?

@bonesoul
Copy link
Author

it's a private repository but i can help you with the information you need.

@mike-kaufman
Copy link
Contributor

mike-kaufman commented May 10, 2017

Thanks @bonesoul. I don't understand why your stack frames are formatted as - next_tick.js:109 process._tickCallback. Are you using some library that changes the format of stacks?

When I run this code in win 10/node 7.10.0:

process.nextTick(() => {
    func = () => {
        const e = new Error();
        console.log(e.stack);
    };
    const a = [func];
    a.forEach((f) => {
        f();
    });
});

I see this output:

Error
    at func (d:\tutorials\nodejs\stack\app.js:5:19)
    at a.forEach (d:\tutorials\nodejs\stack\app.js:10:9)
    at Array.forEach (native)
    at process.nextTick (d:\tutorials\nodejs\stack\app.js:9:7)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:607:11)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

which is very different from the stack frames reported in those error messages.

Can you send me the output on your machine from above code?

@avanderhoorn avanderhoorn changed the title Unsupported stack frame format found [Stack] Unsupported format found May 12, 2017
@mike-kaufman
Copy link
Contributor

Hi @bonesoul -

Could you answer these questions for me?

  1. Are you using any packages that change the format of stack frames?
  2. Can you send me the output from the following code:
process.nextTick(() => {
    func = () => {
        const e = new Error();
        console.log(e.stack);
    };
    const a = [func];
    a.forEach((f) => {
        f();
    });
});

@bonesoul
Copy link
Author

  Error:

  - app.js:107 func
    D:/source/vapingdb/src/app.js:107:19

  - app.js:112 a.forEach
    D:/source/vapingdb/src/app.js:112:9

  - Array.forEach

  - app.js:111 process.nextTick
    D:/source/vapingdb/src/app.js:111:9

  - async-track.js:293 wrappedCallback
    [vapingdb]/[@glimpse]/glimpse-agent-node/release/async-track/async-track.js:293:33

  - next_tick.js:73 _combinedTickCallback
    internal/process/next_tick.js:73:7

  - next_tick.js:104 Immediate._tickCallback
    internal/process/next_tick.js:104:9

  - timers.js:672 runCallback
    timers.js:672:20

  - timers.js:645 tryOnImmediate
    timers.js:645:5

  - timers.js:617 processImmediate [as _immediateCallback]
    timers.js:617:5

@avanderhoorn
Copy link
Member

Just wondering, are you using any packages that change the format of stack frames?

@bonesoul
Copy link
Author

bonesoul commented May 15, 2017

i'm not aware of any that makes changes, but i'm aware of ones that watch it actually, but they are already disabled;

risingstack/trace: "3.10.0",
"opbeat": "4.13.1",

additinoally i've packages that may depend on stack;

"debug": "2.6.6",
"http-errors": "1.6.1",
"pretty-error": "2.1.0",

i'll be disabling them to see the outcome.

@bonesoul
Copy link
Author

found it; https://github.com/AriaMinaei/pretty-error is the offending package.

@mike-kaufman
Copy link
Contributor

Thanks @bonesoul. Given the usage of pretty-error, we'll look into supporting parsing stack frame format produced by pretty-error. Stay tuned. Until we get support in, you could remove pretty-error & you shouldn't see those error messages any longer.

Also, we should have an update out today that will chagne our error reporting logic such that we'll only emit an error message once per unsupported frame, so this should limit the noise here.

@mike-kaufman mike-kaufman changed the title [Stack] Unsupported format found [Stack] Errors parsing stack frames when using pretty-error module. May 15, 2017
@mike-kaufman mike-kaufman self-assigned this May 15, 2017
@mike-kaufman
Copy link
Contributor

OK, v0.20.9 is now available on NPM. This will limit the number of errors we output when we can't parse certain stacks, so your app should be usable even if you include pretty-error.

@bonesoul
Copy link
Author

great i'll give it a try

@mike-kaufman mike-kaufman added this to the Backlog milestone May 31, 2017
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

3 participants