Title: Default depth for ExtraErrorData not applied · Issue #4186 · getsentry/sentry-javascript · GitHub
Open Graph Title: Default depth for ExtraErrorData not applied · Issue #4186 · getsentry/sentry-javascript
X Title: Default depth for ExtraErrorData not applied · Issue #4186 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4186
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Default depth for ExtraErrorData not applied","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [ ] `@sentry/browser`\r\n- [x] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [ ] other:\r\n\r\n### Version:\r\n\r\n```\r\n6.14.1\r\n```\r\n\r\n## Description\r\n\r\nI have just finished investigating some nasty issue where triggering an error on the server side resulted in 100% CPU usage and eventually getting OOM.\r\n\r\nThe infinite loop triggered from the `ExtraErrorData` integration, when it tried to normalize an axios error using `normalize` function from https://github.com/getsentry/sentry-javascript/blob/4887f98822e277a6b7f06415be7fba05e585889e/packages/utils/src/object.ts#L342-L342\r\n\r\nTurns out the issue only manifests itself when also having `dd-trace` enabled in the service but that's not necessarily the root issue. The issue for me was that I have passed an empty object to the `ExtraErrorData` constructor:\r\n\r\nhttps://github.com/getsentry/sentry-javascript/blob/4887f98822e277a6b7f06415be7fba05e585889e/packages/integrations/src/extraerrordata.ts#L24-L24\r\n\r\nThat resulted in `depth` being `undefined` rather than defaulting to 3 and this trigged this infinite loop.\r\n\r\nNow, I'm not sure what's the main issue here:\r\n - the fact that `depth` doesn't default to 3 when empty object is provided? This integration only accepts the `depth` option but if it would support more options, would it make sense to use default value for options that are not provided? I think it would, so it probably also makes sense to do that when only one option is supported.\r\n - why does it go into an infinite loop when dd-trace is enabled but not otherwise? Shouldn't it break the cycle in any case? I haven't investigated what **exactly** makes it go into an infinite loop but must be something that dd-trace does with the Request/Response objects that the axios error contains.","author":{"url":"https://github.com/rchl","@type":"Person","name":"rchl"},"datePublished":"2021-11-25T21:55:28Z","url":"https://github.com/getsentry/sentry-javascript/issues/4186"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:775b1b6a-7ac3-bf40-0ed3-e5e847cd7dc9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9726:AF327:48D02C:63CBDD:6B046FAC |
| html-safe-nonce | 1853df96df904d6bc227d52fcad3396e0a65c4b1d11e53b9374223544d301e81 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzI2OkFGMzI3OjQ4RDAyQzo2M0NCREQ6NkIwNDZGQUMiLCJ2aXNpdG9yX2lkIjoiODAxMzg5MTg4NzgzODgxODIyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0eebdcbe48d804d78039cb399cdc736d1cb2dfd36eb1a4b0f1efbf52f82b11d8 |
| hovercard-subject-tag | issue:1063936829 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/4186/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b214d5b0f5a6c635ff46f42d9325955806254acc53c58aa8653e919a1a0aab8c/getsentry/sentry-javascript/issues/4186 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b214d5b0f5a6c635ff46f42d9325955806254acc53c58aa8653e919a1a0aab8c/getsentry/sentry-javascript/issues/4186 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rchl |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width