Skip to content

ANR events get invalid dist when release has no + #6449

Closed

Description

@sentry-junior

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 '@'".

Regular in-process events are not affected: MainEventProcessor takes dist directly from options.dist and has no release-based fallback.

Root cause

  • Fallback in setDist: ApplicationExitInfoEventProcessor.java#L529-L547
  • Relay dist schema: allow_chars = "a-zA-Z0-9_.-" (event.rs#L310-L323)
  • Not a recent change: the same fallback exists in AnrV2EventProcessor in 7.0.0 and 8.0.0.
  • Related: setAppVersionAndBuild (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.

Reproduction

  1. Configure options.release = "myapp@2026.41" and leave options.dist unset.
  2. Trigger an ANR on Android 11+ and relaunch the app so the ApplicationExitInfo ANR is reported.
  3. The event arrives with dist: "myapp@2026.41", which Relay discards with invalid character '@'.

Workaround

Set options.dist explicitly (e.g. to the version code) so the fallback is skipped.

via gene.wright.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 2, 2026

    @linear-code
  2. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6450, which was included in the 8.63.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions