OS:
_Platform:_
Output of node -v && npm -v && npm ls --prod --depth=0
```v9.3.0
5.6.0
[email protected] /home/sander/Projecten/react/LDBeheer
├── [email protected]
├── [email protected]
├── [email protected]
├── fuse.[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] invalid
├── [email protected]
├── [email protected] invalid
├── [email protected] invalid
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] invalid
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: [email protected], required by [email protected]
npm ERR! peer dep missing: react-native@^0.50.4, required by [email protected]
npm ERR! invalid: [email protected] /home/sander/Projecten/react/LDBeheer/node_modules/react-native-image-to-base64
npm ERR! invalid: [email protected] /home/sander/Projecten/react/LDBeheer/node_modules/react-native-material-ui
npm ERR! extraneous: [email protected] /home/sander/Projecten/react/LDBeheer/node_modules/color
npm ERR! extraneous: lodash.[email protected] /home/sander/Projecten/react/LDBeheer/node_modules/lodash.merge
npm ERR! extraneous: [email protected] /home/sander/Projecten/react/LDBeheer/node_modules/react-native-material-design-styles
npm ERR! invalid: [email protected] /home/sander/Projecten/react/LDBeheer/node_modules/react-native-md-textinput
npm ERR! invalid: [email protected] /home/sander/Projecten/react/LDBeheer/node_modules/react-native-temperature-sensors
Config:
Sentry.config('https://[email protected]/...').install()
I have following issue:
The build fails for production when uploading the sourcemaps:
bundle: Writing bundle output to: /home/sander/Projecten/react/LDBeheer/android/app/build/intermediates/assets/release/index.android.bundle
bundle: Writing sourcemap output to: /home/sander/Projecten/react/LDBeheer/android/app/build/intermediates/assets/release/index.android.bundle.map
bundle: Done writing bundle output
bundle: Done writing sourcemap output
bundle: Copying 82 asset files
bundle: Done copying assets
Processing react-native sourcemaps for Sentry upload.
Analyzing 2 sources
Rewriting sources
Adding source map references
Uploading sourcemaps for release com.LDBeheer-1.0.0 distribution 198
Uploading source maps for release com.LDBeheer-1.0.0
error: http error: generic error (413)
:app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
Where:
Script '/home/sander/Projecten/react/LDBeheer/node_modules/react-native-sentry/sentry.gradle' line: 154
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssetsreleaseSentryUpload'.
Process 'command 'node_modules/@sentry/cli/bin/sentry-cli'' finished with non-zero exit value 1
Output of `ls -lah android/app/build/intermediates/assets/release`:
totaal 49M
drwxr-xr-x 3 sander sander 4,0K 10 jan 16:05 .
drwxr-xr-x 4 sander sander 4,0K 5 dec 20:46 ..
-rw-r--r-- 1 sander sander 336 10 jan 16:28 crashlytics-build.properties
drwxr-xr-x 2 sander sander 4,0K 10 jan 16:03 fonts
-rw-r--r-- 1 sander sander 1,6M 10 jan 16:30 index.android.bundle
-rw-r--r-- 1 sander sander 47M 10 jan 16:30 index.android.bundle.map
-rw-r--r-- 1 sander sander 21 10 jan 16:30 index.android.bundle.meta
```
Steps to reproduce:
./gradlew assembleReleaseActual result:
Expected result:
What is the maximal filesize of the sourcemaps?
Hey, sorry for the late reply.
Currently, there is a limit in Sentry when uploading large artifacts.
We are working to fix this since it is not 100% deterministic when a request is too large.
https://github.com/getsentry/sentry/pull/7095
Please be patient and bare with us 🍪
@HazAT Did I get it right, now we have to uninstall rn-sentry to be able to build an android app?
@dmitrika as far as I could tell removing the upload gradle task from the android/app/build.gradle should do the trick. You just don't have the codemaps on sentry.
@HazAT Hello! I see several PRs merged in context of this one. Is there any roadmap for everything related? It will be handy to be able to keep track of this. Thank you!
So I tried to understand the work done on chunk uploading. Maybe even fix this. These are my notes in that process.
sentry-cli has code for uploading chunks and assembling them:
upload chunks
assemble chunks
However, the SourceMapProcessor used in the react-native x (x in [gradle, xcode, appcenter, codepush]) doesn't use the chunk upload (yet?). It's only used in the upload_dif command.
I don't think I completely grasp everything, but what I suspect that the current chunk upload was especially made for dsyms (and related difs) and not for the JS sourcemaps since those use the release file upload.
@se-bastiaan You are right! We still want to support chunk upload for source maps though. I can't give you an exact timeframe when this will happen but I have something other in mind.
We will soon ship (1-2 weeks) gzip compression for uploads with Sentry CLI, this should at least buy us some time until we hit the cap again.
Will comment here again when everything is in production.
@SanderVerkuil sorry for the noob question: what exactly do you mean by
removing the upload gradle task from the build.properties
There is no build.properties file as far as I can tell. The build.gradle file applies a script from react-native-sentry:
apply from: "../../node_modules/react-native-sentry/sentry.gradle"
And to my understanding it is that script that is in charge of uploading the source map. Did you mean we should remove the apply from... line in build.gradle?
Yes, the workaround of removing apply from: "../../node_modules/react-native-sentry/sentry.gradle" works fine. I think build.properties in that comment should've been build.gradle.
Did you mean we should remove the apply from... line in build.gradle
Yes, I made a mistake, it should've been android/app/build.gradle. I modified my original comment, fixing the mistake. :smiley:
Still no news about this issue ? In what way is the upload process different from the old way doing it all manually (when it was only raven-js) ? Is there any java code being sent too ?
Still no news about that?
I found a solution but it is only possible if you host your own sentry server. I had to allow a bigger max request body size in my nginx proxy settings
Any updates? My sourcemap file was just 1.1M and this error happened too.
@badaz
I changed client_max_body_size 20m and it worked.
The newest version of sentry-cli should fix this issue.
@HazAT Hm...
request GET https://sentry.***.ninja/api/0/organizations/***/chunk-upload/
result
body: {"maxFileSize": 2147483648, "hashAlgorithm": "sha1", "concurrency": 4, "chunkSize": 8388608, "maxRequestSize": 33554432, "url": "https://sentry.***.ninja/api/0/organizations/***/chunk-upload/", "chunksPerRequest": 64, "compression": ["gzip"]}
...
request POST https://sentry.enapter.ninja/api/0/projects/enapter/react-native/files/difs/assemble/
request body: {"*****":{"name":"***","chunks":["dd7589643d767735ac7fd332b4d8b1f442056f96","8d64dc5c61acc32a4218975ce9e85670c9826a12","5faecb8cb41c0df1d11f3669ccac042e0186c991","481b8fbbb1f49dd844336b7eda611366bfef866b","87d967ef7dcd9d7e79a8a4ca63400aff0e43bf7a","c169a756a75fe9457c5dd1c85025b331419498a6"]}}
response
body: {"***": {"state": "not_found", "missingChunks": ["87d967ef7dcd9d7e79a8a4ca63400aff0e43bf7a", "dd7589643d767735ac7fd332b4d8b1f442056f96", "5faecb8cb41c0df1d11f3669ccac042e0186c991", "481b8fbbb1f49dd844336b7eda611366bfef866b", "8d64dc5c61acc32a4218975ce9e85670c9826a12", "c169a756a75fe9457c5dd1c85025b331419498a6"]}}
error: API request failed
caused by: sentry reported an error: unknown error (http status: 413)
iOS 12.2
"@sentry/react-native": "1.0.9",
"react": "16.8.6",
"react-native": "0.60.4",
sentry-cli 1.48.0
@HazAT
@HazAT Hm...
request GET https://sentry.***.ninja/api/0/organizations/***/chunk-upload/ result body: {"maxFileSize": 2147483648, "hashAlgorithm": "sha1", "concurrency": 4, "chunkSize": 8388608, "maxRequestSize": 33554432, "url": "https://sentry.***.ninja/api/0/organizations/***/chunk-upload/", "chunksPerRequest": 64, "compression": ["gzip"]} ... request POST https://sentry.enapter.ninja/api/0/projects/enapter/react-native/files/difs/assemble/ request body: {"*****":{"name":"***","chunks":["dd7589643d767735ac7fd332b4d8b1f442056f96","8d64dc5c61acc32a4218975ce9e85670c9826a12","5faecb8cb41c0df1d11f3669ccac042e0186c991","481b8fbbb1f49dd844336b7eda611366bfef866b","87d967ef7dcd9d7e79a8a4ca63400aff0e43bf7a","c169a756a75fe9457c5dd1c85025b331419498a6"]}} response body: {"***": {"state": "not_found", "missingChunks": ["87d967ef7dcd9d7e79a8a4ca63400aff0e43bf7a", "dd7589643d767735ac7fd332b4d8b1f442056f96", "5faecb8cb41c0df1d11f3669ccac042e0186c991", "481b8fbbb1f49dd844336b7eda611366bfef866b", "8d64dc5c61acc32a4218975ce9e85670c9826a12", "c169a756a75fe9457c5dd1c85025b331419498a6"]}} error: API request failed caused by: sentry reported an error: unknown error (http status: 413)iOS 12.2 "@sentry/react-native": "1.0.9", "react": "16.8.6", "react-native": "0.60.4",sentry-cli 1.48.0
same here,
we are running self hosted sentry server, and we've overridden sentry.conf.py by adding 'limit-post' property in SENTRY_WEB_OPTIONS; It looks like this:
SENTRY_WEB_OPTIONS = {
'limit-post': 20000000
}
Also there is full debug log below.
sentry_request.txt
still having this issue using @sentry/react (version 5.20.1)
I was hosting on prem on kubernetes with nginx ignress and had to set the following ingress annotations:
nginx.ingress.kubernetes.io/client_max_body_size: 30m
nginx.ingress.kubernetes.io/proxy-body-size: 30m
I solved this problem with the beforeBreadcrumb attribute
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
enabled: true,
integrations: [
new RewriteFrames({
iteratee: frame => {
frame.filename = frame.filename.replace(distDir, 'app:///_next')
return frame
},
}),
],
release: COMMIT_ID,
environment: DEPLOYMENT_TYPE,
beforeBreadcrumb(breadcrumb) {
if (breadcrumb.category === 'console') {
return null
}
return breadcrumb
},
})
}
Most helpful comment
@badaz
I changed
client_max_body_size 20mand it worked.