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

Add original stack trace to render error #198

Merged
merged 1 commit into from
Sep 26, 2022

Conversation

jmwiese
Copy link
Contributor

@jmwiese jmwiese commented Sep 21, 2022

What? Why?

We're seeing a lot of errors about 'hash' undefined in renderer that spike occasionally and result in 500s https://kibana.bigcommerce.net/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-2d,to:now))&_a=(columns:!(template_path,template_engine,message,store_id),filters:!(),index:production_containers_storefront-renderer,interval:auto,query:(language:kuery,query:'%22Cannot%20read%20property%20!'hash!'%20of%20null%22'),sort:!(!('@timestamp',desc)))

We're attempting to diagnose what exactly is failing within handlebars when we have a RenderError, so add the original stack trace to the error message

How was it tested?


cc @bigcommerce/storefront-team

rafa-avila-bc
rafa-avila-bc previously approved these changes Sep 21, 2022
@jmwiese jmwiese requested a review from jairo-bc September 21, 2022 22:22
@jairo-bc
Copy link
Contributor

Where you able to get it locally ? @jmwiese
I think AppError should be doing it, but for some reason it doesn't work.
Maybe you can remove the this.construtor over there?

@jmwiese
Copy link
Contributor Author

jmwiese commented Sep 22, 2022

@jairo-bc For the stack trace in kibana we're only seeing the stack trace for throwing of AppError

RenderError: Cannot read property 'hash' of null     
  at /opt/app/node_modules/@bigcommerce/stencil-paper-handlebars/index.js:280:31     
  at new Promise (<anonymous>)     
  at HandlebarsRenderer.render (/opt/app/node_modules/@bigcommerce/stencil-paper-handlebars/index.js:260:16)     
  at Paper.render (/opt/app/node_modules/@bigcommerce/stencil-paper/index.js:226:30)     
  at /opt/app/server/services/multiPhaseRenderer.js:94:28     
  at runMicrotasks (<anonymous>)     
  at processTicksAndRejections (internal/process/task_queues.js:95:5)

it doesnt seem to include the parent trace of the exception from template(context) handlebars call. We basically want to find out what specifically is causing this exception to be thrown from within the handlebars code

jairo-bc
jairo-bc previously approved these changes Sep 23, 2022
@jmwiese jmwiese dismissed stale reviews from jairo-bc and rafa-avila-bc via d5f3a2c September 26, 2022 14:42
@jmwiese jmwiese force-pushed the add-stacktrace-to-render-error branch from eba2dd1 to d5f3a2c Compare September 26, 2022 14:42
@jmwiese jmwiese merged commit 0a0d714 into bigcommerce:master Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants