You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered 413 responses after enabling the redux integration, as well as separately after manually adding breadcrumbs which may include a large data param.
It seems there is no limit on the field length imposed in the JS library. See here for an example as implemented in the Python library: getsentry/raven-python#1194
An alternative might be to retry with a lower breadcrumb count on 413 failure. The default number of breadcrumbs is 100 (#3038).
The 413 Entity Too Large response is triggered when the decompressed event size is larger than 1MB. This is not just the breadcrumbs, but the entire event payload including the stack trace, tags, extra context...
The 413 Entity Too Large response is triggered when the decompressed event size is larger than 1MB. This is not just the breadcrumbs, but the entire event payload including the stack trace, tags, extra context...
Def, but it is the breadcrumbs that are unexpectedly large in this case, and pushing the aggregate over the expected limit.
Hi there, I've just encountered this problem myself, and I would like to ask what's the recommended way for an application developer to safely avoid this size limit issue.
I want to check/ask two things:
If the overall request size, in any way, exceeds the limit, the error will not be recorded on Sentry and so the application developers have no way of knowing that the error even happened, is this correct?
If so, is there any hook provided by the SDK, that enables checking the payload size before sending and truncating properties in the case of over limit?
The first impression I had to achieve 2) was to use the beforeSend hook with something like
beforeSend(event){constsize=JSON.stringify(event).lengthif(size>PAYLOAD_LIMIT){// do some reduction of the event at the developer's choice}returnevent}
But then, as I've roughly tested on local, although the event argument that beforeSend receives looks identical to the http request payload, the size of the object does not exactly match that of content-length of the request (probably because the actual request contains extra headers), which entails the developer to take the ambiguous (though estimatable) header size into consideration when dealing with the limit.
Am I missing/misunderstanding something here?
Thanks in advance!
Hi, generally I think having a size limit is reasonable.
One thing that comes to mind to resolve your issues would be to either set normalizeDepth, or normalizeMaxBreadth in the init options. Of course, when using either of these options you will lose some event data on the way to sentry - this is simply a tradeoff we have to make to stay below the size limit.
@yuichkun's approach using beforeSend should also work but is more work to configure.
I agree with @dmvvilela, it would be nicer to raise somewhere something to alert us that the error sending will be dropped due to a payload too large to let us reduce the size of this payload.
Activity
rodolfoBee commentedon Nov 6, 2020
The 413 Entity Too Large response is triggered when the decompressed event size is larger than 1MB. This is not just the breadcrumbs, but the entire event payload including the stack trace, tags, extra context...
Sija commentedon Nov 6, 2020
@rbisol This way makes it very hard to avoid hitting the limit.
Empact commentedon Nov 6, 2020
Def, but it is the breadcrumbs that are unexpectedly large in this case, and pushing the aggregate over the expected limit.
yuichkun commentedon Mar 14, 2022
Hi there, I've just encountered this problem myself, and I would like to ask what's the recommended way for an application developer to safely avoid this size limit issue.
I want to check/ask two things:
If the overall request size, in any way, exceeds the limit, the error will not be recorded on Sentry and so the application developers have no way of knowing that the error even happened, is this correct?
If so, is there any hook provided by the SDK, that enables checking the payload size before sending and truncating properties in the case of over limit?
The first impression I had to achieve 2) was to use the
beforeSendhook with something likeBut then, as I've roughly tested on local, although the
eventargument thatbeforeSendreceives looks identical to the http request payload, the size of the object does not exactly match that ofcontent-lengthof the request (probably because the actual request contains extra headers), which entails the developer to take the ambiguous (though estimatable) header size into consideration when dealing with the limit.Am I missing/misunderstanding something here?
Thanks in advance!
dmvvilela commentedon May 11, 2022
This is absurd.. Just trying out Sentry and it didn't even work once because of this...
lforst commentedon May 11, 2022
Hi, generally I think having a size limit is reasonable.
One thing that comes to mind to resolve your issues would be to either set
normalizeDepth, ornormalizeMaxBreadthin the init options. Of course, when using either of these options you will lose some event data on the way to sentry - this is simply a tradeoff we have to make to stay below the size limit.@yuichkun's approach using
beforeSendshould also work but is more work to configure.dmvvilela commentedon May 11, 2022
So dropping errors silently altogether is reasonable huh? Ok then..
I used the other issue (#2798) idea:
Amatewasu commentedon Sep 20, 2022
I agree with @dmvvilela, it would be nicer to raise somewhere something to alert us that the error sending will be dropped due to a payload too large to let us reduce the size of this payload.