413 Request Entity Too Large during sentry-cli upload-sourcemaps
Description
When uploading sourcemaps that exceed a certain total size the upload is rejected with a 413 status code (Request Entity Too Large). For me this happens at about 4.1 MB. I believe that the limit is djangos default setting of DATA_UPLOAD_MAX_MEMORY_SIZE
that is 2.5 MB by default. I believe the size difference can be explained with compression.
Another possibility is that the nginx config needs client_max_body_size
adjusted. However it did not have any effect on my installation when I set it to 40MB.
Reproduction steps:
- Generate sourcemaps that total in more than 2.5 MB of size
- Try to upload them via the sentry-cli
- Get a 413 response
Logs
DEBUG 2022-12-08 13:55:12.262279 +01:00 request POST https://glitchtip.********.***/api/0/organizations/******/chunk-upload/ DEBUG 2022-12-08 13:55:12.263083600 +01:00 sending form data DEBUG 2022-12-08 13:55:12.263751200 +01:00 using token authentication DEBUG 2022-12-08 13:55:12.264180200 +01:00 retry number 0, max retries: 5 DEBUG 2022-12-08 13:55:12.265096500 +01:00 > POST /api/0/organizations/ristec/chunk-upload/ HTTP/1.1 DEBUG 2022-12-08 13:55:12.265586800 +01:00 > Host: glitchtip.********.*** DEBUG 2022-12-08 13:55:12.266010500 +01:00 > Accept: */* DEBUG 2022-12-08 13:55:12.266390200 +01:00 > Connection: TE DEBUG 2022-12-08 13:55:12.266804700 +01:00 > TE: gzip DEBUG 2022-12-08 13:55:12.267246200 +01:00 > User-Agent: sentry-cli/2.10.0 DEBUG 2022-12-08 13:55:12.267917 +01:00 > Authorization: Bearer *********** DEBUG 2022-12-08 13:55:12.268291200 +01:00 > Content-Length: 1056538 DEBUG 2022-12-08 13:55:12.268623300 +01:00 > Content-Type: multipart/form-data; boundary=------------------------18a78086be3499be DEBUG 2022-12-08 13:55:12.295840 +01:00 < HTTP/1.1 413 Request Entity Too Large DEBUG 2022-12-08 13:55:12.296380300 +01:00 < Server: nginx/1.14.2 DEBUG 2022-12-08 13:55:12.296722600 +01:00 < Date: Thu, 08 Dec 2022 12:55:12 GMT DEBUG 2022-12-08 13:55:12.297040400 +01:00 < Content-Type: text/html DEBUG 2022-12-08 13:55:12.297565900 +01:00 < Content-Length: 199 DEBUG 2022-12-08 13:55:12.298072700 +01:00 < Connection: close DEBUG 2022-12-08 13:55:12.299387300 +01:00 response status: 413 DEBUG 2022-12-08 13:55:12.299831200 +01:00 body: <html> <head><title>413 Request Entity Too Large</title></head> <body bgcolor="white"> <center><h1>413 Request Entity Too Large</h1></center> <hr><center>nginx/1.14.2</center> </body> </html>error: API request failed caused by: sentry reported an error: unknown error (http status: 413)
Proposed Solution(s)
As Sentry accepts up to 40MB I believe GlitchTip should do the same.