Title: ANR events get invalid dist when release has no `+` · Issue #6449 · getsentry/sentry-java · GitHub
Open Graph Title: ANR events get invalid dist when release has no `+` · Issue #6449 · getsentry/sentry-java
X Title: ANR events get invalid dist when release has no `+` · Issue #6449 · getsentry/sentry-java
Description: When options.dist is not set, ApplicationExitInfoEventProcessor falls back to deriving dist from the release using release.substring(release.indexOf('+') + 1). If the release has no + (e.g. myapp@2026.41), indexOf returns -1 and the enti...
Open Graph Description: When options.dist is not set, ApplicationExitInfoEventProcessor falls back to deriving dist from the release using release.substring(release.indexOf('+') + 1). If the release has no + (e.g. myapp@2...
X Description: When options.dist is not set, ApplicationExitInfoEventProcessor falls back to deriving dist from the release using release.substring(release.indexOf('+') + 1). If the release has no + (e.g....
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6449
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ANR events get invalid dist when release has no `+`","articleBody":"When `options.dist` is not set, `ApplicationExitInfoEventProcessor` falls back to deriving `dist` from the release using `release.substring(release.indexOf('+') + 1)`. If the release has no `+` (e.g. `myapp@2026.41`), `indexOf` returns `-1` and the entire release string becomes `dist`. Relay then discards it because `dist` only allows `a-zA-Z0-9_.-`, so ANR events show \"Invalid `dist` value discarded — invalid character '@'\".\n\nRegular in-process events are not affected: `MainEventProcessor` takes `dist` directly from `options.dist` and has no release-based fallback.\n\n## Root cause\n\n- Fallback in `setDist`: [ApplicationExitInfoEventProcessor.java#L529-L547](https://github.com/getsentry/sentry-java/blob/5f109a6d770d2c3b71f53ba432c45f452fbd09f7/sentry-android-core/src/main/java/io/sentry/android/core/ApplicationExitInfoEventProcessor.java#L529-L547)\n- Relay `dist` schema: `allow_chars = \"a-zA-Z0-9_.-\"` ([event.rs#L310-L323](https://github.com/getsentry/relay/blob/a68f1dbec05258cfa27b01059e1c1816d10c7257/relay-event-schema/src/protocol/event.rs#L310-L323))\n- Not a recent change: the same fallback exists in `AnrV2EventProcessor` in 7.0.0 and 8.0.0.\n- Related: `setAppVersionAndBuild` ([L457-L477](https://github.com/getsentry/sentry-java/blob/5f109a6d770d2c3b71f53ba432c45f452fbd09f7/sentry-android-core/src/main/java/io/sentry/android/core/ApplicationExitInfoEventProcessor.java#L457-L477)) calls `release.substring(release.indexOf('@') + 1, release.indexOf('+'))`. That throws when there is no `+`, and the exception is caught and logged, so `app.app_version` / `app.app_build` are not populated from the release on these events.\n\n## Reproduction\n\n1. Configure `options.release = \"myapp@2026.41\"` and leave `options.dist` unset.\n2. Trigger an ANR on Android 11+ and relaunch the app so the ApplicationExitInfo ANR is reported.\n3. The event arrives with `dist: \"myapp@2026.41\"`, which Relay discards with `invalid character '@'`.\n\n## Workaround\n\nSet `options.dist` explicitly (e.g. to the version code) so the fallback is skipped.\n\n\u003c!-- junior-request-attribution:start -->\nvia **gene.wright**.\n\u003c!-- junior-request-attribution:end -->\n\n\u003c!-- junior-session-footer:start -->\n\u003c!-- junior-conversation-id:slack%3AD0B92UEM19Q%3A1793642793.293809 -->\n\n--\n\n[View Session](https://junior-prod.sentry.dev/conversations/slack%3AD0B92UEM19Q%3A1793642793.293809) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0B92UEM19Q%3A1793642793.293809/?project=4510944073809921)\n\n\u003c!-- junior-session-footer:end -->","author":{"url":"https://github.com/apps/sentry-junior","@type":"Person","name":"sentry-junior"},"datePublished":"2026-11-02T18:17:10Z","url":"https://github.com/getsentry/sentry-java/issues/6449"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ec9c42ac-c739-322c-3afc-5fa6c4d0d40f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A700:14AF70:272E3:3573A:6B046153 |
| html-safe-nonce | 840e3c26152a68670dd4d5fafbee19b07ab31b725ef1f5c0e6f84ef7d84c54a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzAwOjE0QUY3MDoyNzJFMzozNTczQTo2QjA0NjE1MyIsInZpc2l0b3JfaWQiOiI4OTUxNDc3Nzk4MjQyMTE1OTIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 65f7acea278f20cd8a20e241e39e57bfd2c7204b796de54a0071087ff362d432 |
| hovercard-subject-tag | issue:6168366917 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6449/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1b9aaab880d6c0043f2deeca2c363e55fb7acb6e63fa5bbbce96a9c13ccc16be/getsentry/sentry-java/issues/6449 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1b9aaab880d6c0043f2deeca2c363e55fb7acb6e63fa5bbbce96a9c13ccc16be/getsentry/sentry-java/issues/6449 |
| og:image:alt | When options.dist is not set, ApplicationExitInfoEventProcessor falls back to deriving dist from the release using release.substring(release.indexOf('+') + 1). If the release has no + (e.g. myapp@2... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sentry-junior[bot] |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width