Repository navigation
Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
10.10.0
Framework Version
NextJs 13.5.8
Link to Sentry event
https://assisted.sentry.io/issues/6866842066
Reproduction Example/SDK Setup
After upgrading Sentry from version 7.77 to 10.10, I'm encountering a sporadic error. It doesn't appear immediately, but it consumes all the CPU resources after 10-15 hours of usage.
RangeError: Maximum call stack size exceeded
at SyncPromise._executeHandlers (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:126:20)
at setResult (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:166:12)
at reject (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:174:7)
at SyncPromise._runExecutor (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:180:7)
at new SyncPromise (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:46:10)
at notifyEventProcessors (/app/node_modules/@sentry/core/build/cjs/eventProcessors.js:17:10)
at ? (/app/node_modules/@sentry/core/build/cjs/eventProcessors.js:31:14)
at SyncPromise._runExecutor (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:178:7)
at new SyncPromise (/app/node_modules/@sentry/core/build/cjs/utils/syncpromise.js:46:10)
at notifyEventProcessors (/app/node_modules/@sentry/core/build/cjs/eventProcessors.js:17:10)
Everything happens inside the Sentry SDK source code.
Steps to Reproduce
It's challenging to reproduce because it only occurs on the production server and takes time to appear.
Expected Result
Normal behaviour
Actual Result
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsNo status
Activity
linear commentedon Sep 11, 2025
JS-924 Error Maximum call stack size exceeded
mydea commentedon Sep 11, 2025
Hey, can you share your
Sentry.init()code (the server side one at least), and possibly any other places where you used the Sentry API manually?What seems to be happening is that there is an error thrown in some event processor or similar, which leads to an infinite recursion 🤔
AmirL commentedon Sep 11, 2025
Hy @mydea
Sure:
The strange thing to me, that I expect to see some of my functions at the bottom of the stack, and I see just Sentry code there. Why would Sentry initiate something, if I don't call it?
s1gr1d commentedon Sep 12, 2025
Hey, this is the client-side instrumentation (at least the comment says so). Can you share your server init as well? :)
31 remaining items
AmirL commentedon Oct 28, 2025
I haven't set it, still looking for a correct way to do so.
maxQueueSizeis available only for Client Side, but I have a socket problem on the server side explicitly.It is only for the frontend, the backend on NestJs and works without problems.
AmirL commentedon Oct 28, 2025
Not on the server. The problem happens only on the server side, but for the frontend framework :).
Great suggestion! I'll try
bufferSize: 15, and also will trykeepAlive: true. I think it might help. I'll report later, because it doesn't fail fast anyway.AmirL commentedon Oct 29, 2025
I believe this change fixed the problem. Previously, there were about 70–90 active HTTPS sockets connected to Sentry (compared to only 1–10 for all other frontend traffic). Now that number is down to around 20–30.
Since we run two frontend instances on the same server, and the default maximum number of sockets per host is 511, Sentry’s tunnel was consuming roughly half of all available sockets system-wide.
When the situation escalated, the socket pool became saturated — which likely triggered additional attempts to send reports, further increasing the number of connections and effectively creating a feedback loop that kept the sockets busy.
Originally, this issue included a stack trace from Sentry. I believe it was triggered by the built-in tunnel. Now, when I use a custom route for tunneling events, the error has changed.
chargome commentedon Oct 29, 2025
Sounds good, I'll lower the default a bit then.
feat(browser): Limit transport buffer size (#18046)
github-actions commentedon Nov 5, 2025
A PR closing this issue has just been released 🚀
This issue was referenced by PR #18046, which was included in the 10.23.0 release.