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
{{ message }}
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
Recently started getting the follow error, without any explicit change to Raven or Sentry configuration. Google results are unrevealing. Is there something known that can cause this?
Any proper ways of logging more fully the original AttributeError, which caused the Sentry error, besides disabling Sentry?
INFO:werkzeug:172.17.42.1 - - [29/Apr/2015 01:02:51] "POST / HTTP/1.1" 500 -
ERROR:sentry.errors:Unable to reach Sentry log server: HTTP Error 413: Request Entity Too Large (url: https://app.getsentry.com/api/39671/store/, body: b'<html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body bgcolor="white">\r\n<center><h1>413 Request Entity Too Large</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n')
Traceback (most recent call last):
File "/usr/local/lib/python3.4/site-packages/raven/transport/threaded.py", line 159, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/usr/local/lib/python3.4/site-packages/raven/transport/http.py", line 49, in send
ca_certs=self.ca_certs,
File "/usr/local/lib/python3.4/site-packages/raven/utils/http.py", line 62, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.4/urllib/request.py", line 461, in open
response = meth(req, response)
File "/usr/local/lib/python3.4/urllib/request.py", line 571, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.4/urllib/request.py", line 499, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.4/urllib/request.py", line 433, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.4/urllib/request.py", line 579, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 413: Request Entity Too Large
ERROR:sentry.errors:Failed to submit message: "AttributeError: 'dict' object has no attribute 'encode'"
This would mean the packet is very large. I think we should do something on our end around logging, but it's a little complicated. We definitely should log a reasonable version of the message (beyond just what we give you here). Unfortunately without changes to the client I don't have a great answer.
Hm, ok. What composes the packet? I am working with a number large files,
perhaps one is getting itself attached to the error report somehow, and we
definetly wouldn't want or need that.
This would mean the packet is very large. I think we should do
something on our end around logging, but it's a little complicated. We
definitely should log a reasonable version of the message (beyond just what
we give you here). Unfortunately without changes to the client I don't have
a great answer.
—
Reply to this email directly or view it on GitHub #604 (comment)
.
It was? I'm still experiencing 413 responses from getsentry.com when POSTing a 5.3MB payload.
Perhaps you could log something about the 413 in Sentry when this happens so one knows an error occurred. Took some digging in syslogs to find the error.
So this is still an issue, although thanks to your help earlier/elsewhere, it is being logged sufficiently locally.
A believe a couple actions should be taken:
Upon receiving a too large entity, the server should log a proxy exception, alerting the user that an event happened which was un-capturable. This would prevent silent doom.
An API should be devised to all the automatic or selective truncation of large strings when errors are thrown. E.g., if I have an attribute error on a dictionary with a large string key, in many cases I don't have any need to know the contents of that key, beyond perhaps the first 100 chars to indicate its further contents.
Most of the time this is due to the configuration of the server. If this is getsentry.com the request limit is extremely high and there's no way you should be hitting it. If you are, then it likely means that the client side variable trimming isn't working correctly, or has been re-configured to send data that is too large.
Then I hawkishly watch my uwsgi log file and I get this:
EXCEPTION!!!! <urllib.request.Request object at 0x7fd9103efb38> https://sentry.io/api/196160/store/ b'x\x9c\xec\xbdiw\xe2H\xb20\xfcW\xd4\xf5~p\xd5)\x97\xd9\xb7\xea;\xb7\x0f\x8b0xe\xf3\x82\xa7\xe6\xf4MP"\xc9\x08\t$
Sentry responded with an error: HTTP Error 413: Request Entity Too Large (url: https://sentry.io/api/196160/store/)
Traceback (most recent call last):
File "/var/lib/django/songsearch/venv/lib/python3.5/site-packages/raven/transport/threaded.py", line 165, in send_sync
super(ThreadedHTTPTransport, self).send(url, data, headers)
File "/var/lib/django/songsearch/venv/lib/python3.5/site-packages/raven/transport/http.py", line 43, in send
ca_certs=self.ca_certs,
File "/var/lib/django/songsearch/venv/lib/python3.5/site-packages/raven/utils/http.py", line 67, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 472, in open
response = meth(req, response)
File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.5/urllib/request.py", line 510, in error
return self._call_chain(*args)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 413: Request Entity Too Large
['OSError: write error']
@peterbe any chance you could try to capture data to a file and email that to david at sentry.io? This might be something where its genuinely creating a gigantic packet. The SDK is supposed to limit the length of everything, but thats not always been true.
@dcramer I don't think it needs to be signed up I've written a little hack now to generate these data files. I'll email you one if I get another exception. At the time of writing I haven't had one happen in a while.
The problem in this specific example is breadcrumbs are not truncating log messages. In this case theres an elasticsearch logger (not sure if yours or the official library), and an unbelievably large debug message which seems to be the full payload being inserted.
Stock Django 1.11 with no fancy logging specifically for elasticsearch_dsl. I appreciate that sometimes Elasticsearch barfs but there should still be an error sent to Sentry. I do use this little snippet for calling elasticsearch_dsl:
@peterbe sorry I should have been clear that i was intending to fix it, but the behavior (of using debug messages to log e.g. raw packets) is poor in general. ES certainly isnt alone in that.
any chance of deploying a new version of raven which includes the fix? This issue has been a real pain for a long time for us and we really want to try this fix.
Activity
dcramer commentedon Apr 29, 2015
Is this getsentry.com or are you hosting it yourself?
pehrlich commentedon Apr 29, 2015
Getsentry.com
On Tuesday, April 28, 2015, David Cramer notifications@github.com wrote:
dcramer commentedon Apr 29, 2015
This would mean the packet is very large. I think we should do something on our end around logging, but it's a little complicated. We definitely should log a reasonable version of the message (beyond just what we give you here). Unfortunately without changes to the client I don't have a great answer.
pehrlich commentedon Apr 29, 2015
Hm, ok. What composes the packet? I am working with a number large files,
perhaps one is getting itself attached to the error report somehow, and we
definetly wouldn't want or need that.
Happy to test out or make changes as advised.
On Tuesday, April 28, 2015, David Cramer notifications@github.com wrote:
dcramer commentedon Apr 30, 2015
Closing this out as it was (potentially) resolved elsewhere
pehrlich commentedon Apr 30, 2015
nice, thank you
jacobsvante commentedon Aug 27, 2015
It was? I'm still experiencing 413 responses from getsentry.com when POSTing a 5.3MB payload.
Perhaps you could log something about the 413 in Sentry when this happens so one knows an error occurred. Took some digging in syslogs to find the error.
dcramer commentedon Aug 27, 2015
@jmagnusson do you see this in the 5.6 release?
jacobsvante commentedon Aug 28, 2015
Yup, still.
Sentry responded with an error: HTTP Error 413: Request Entity Too Large (url: https://app.getsentry.com/api/.../store/)pehrlich commentedon Sep 23, 2015
So this is still an issue, although thanks to your help earlier/elsewhere, it is being logged sufficiently locally.
A believe a couple actions should be taken:
jhubert commentedon Mar 9, 2016
Seeing this as well from the error dump of a complex elasticsearch query.
jacobsvante commentedon Mar 9, 2016
It still hasn't been resolved?
ruimarinho commentedon Apr 11, 2016
Just got hit by this issue (not related to the python lib though). What's the maximum body size allowed by sentry?
dcramer commentedon Apr 11, 2016
Most of the time this is due to the configuration of the server. If this is getsentry.com the request limit is extremely high and there's no way you should be hitting it. If you are, then it likely means that the client side variable trimming isn't working correctly, or has been re-configured to send data that is too large.
28 remaining items
peterbe commentedon Feb 2, 2018
As of 8 days ago I was. See my previous comment.
I can provide you more details but in private in case I do something silly that reveals too much.
dcramer commentedon Feb 2, 2018
I meant as in right now. We made changes yesterday which should have reduced the impact.
peterbe commentedon Feb 2, 2018
@dcramer Yes, but because I don't know how to corner this, here's what I did:
(Note: I'm doing this on a side-project so attention is restricted)
I injected some print in
site-packages/raven/utils/http.pytowards the end:Then I hawkishly watch my uwsgi log file and I get this:
dcramer commentedon Feb 2, 2018
@peterbe any chance you could try to capture data to a file and email that to david at sentry.io? This might be something where its genuinely creating a gigantic packet. The SDK is supposed to limit the length of everything, but thats not always been true.
dcramer commentedon Feb 2, 2018
Aside, you can sign with PGP key if you're concerned: https://sentry.io/security/
peterbe commentedon Feb 2, 2018
@dcramer I don't think it needs to be signed up I've written a little hack now to generate these data files. I'll email you one if I get another exception. At the time of writing I haven't had one happen in a while.
dcramer commentedon Feb 2, 2018
The problem in this specific example is breadcrumbs are not truncating log messages. In this case theres an elasticsearch logger (not sure if yours or the official library), and an unbelievably large debug message which seems to be the full payload being inserted.
peterbe commentedon Feb 2, 2018
Stock Django 1.11 with no fancy logging specifically for elasticsearch_dsl. I appreciate that sometimes Elasticsearch barfs but there should still be an error sent to Sentry. I do use this little snippet for calling elasticsearch_dsl:
I don't see those
ES Retryingprints in the uwsgi logs.dcramer commentedon Feb 2, 2018
@peterbe sorry I should have been clear that i was intending to fix it, but the behavior (of using debug messages to log e.g. raw packets) is poor in general. ES certainly isnt alone in that.
danieledapo commentedon Feb 9, 2018
any chance of deploying a new version of
ravenwhich includes the fix? This issue has been a real pain for a long time for us and we really want to try this fix.ashwoods commentedon Feb 9, 2018
@d-dorazio will be out by tomorrow.
ryechus commentedon May 5, 2020
I am still experiencing this issue even after updating to version 6.10.0.
davidpaley commentedon Aug 4, 2020
I am having this error working with next.js and "@sentry/react": version 5.20.1 with the default configuration of React
Empact commentedon Nov 6, 2020
For reference, @davidpaley apparently solved his problem here: getsentry/sentry-javascript#2798