fix(proguard): restore leading slash in DIF assemble name - #1372
Open
gabriellanata wants to merge 1 commit into
Open
fix(proguard): restore leading slash in DIF assemble name#1372gabriellanata wants to merge 1 commit into
gabriellanata wants to merge 1 commit into
Conversation
`proguard upload` names each chunked mapping `proguard/<uuid>.txt` when building the `files/difs/assemble/` request body, but legacy sentry-cli (Rust) names it `/proguard/<uuid>.txt` -- with a leading slash. The server appears to key DIF-type detection off that `/proguard/` prefix; without it, assembly fails with "Invalid debug information file: unsupported object file format" even though the request itself succeeds (200) and every prior HTTP call in the flow succeeds too. Add a leading slash to match the legacy protocol, and a regression test asserting the assembled DIF name for `uploadProguardMappings`.
gabriellanata
force-pushed
the
fix/proguard-dif-name-leading-slash
branch
from
August 6, 2026 18:44
0757878 to
2b3dd4e
Compare
|
@gabriellanata is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
gabriellanata
marked this pull request as ready for review
August 18, 2026 06:50
Author
|
ptal @BYK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
proguard uploadfails server-side assembly for every upload, on every version since thecommand was added in #1074 — including
mainand the latest release (0.42.2). The mapping ischunked and uploaded fine, but the DIF is never created, so nothing ever symbolicates.
Every HTTP call up to that point returns
200— the failure only appears inside theper-checksum
detailfield of the assemble response body, which makes it easy to misdiagnoseas an auth, org/project, or mapping-file problem.
Root cause
In
packages/cli/src/lib/api/proguard.ts:165,uploadProguardMappingsbuilds thefiles/difs/assemble/request body with:Legacy
sentry-cli(Rust) names the same DIF entry with a leading slash:The leading slash is load-bearing. ProGuard/R8 mappings are plain text with no magic bytes, so
the server identifies them purely by the
/proguard/prefix in the requestname(
sentry/src/sentry/models/debugfile.py):The full failure path:
tasks/assemble.py→detect_single_dif_from_path(temp_file.name, name=name, debug_id=debug_id)models/debugfile.py→proguard_id = _analyze_progard_filename(path) or _analyze_progard_filename(name)nameisproguard/<uuid>.txt, which_proguard_file_re.search()does not match — no leading slash.pathis the server's own temp file, so it cannot match either.proguard_idisNone, and ProGuard detection is skipped entirely.Archive.open(path)on a textfile raises
SymbolicError, which becomesraise BadDif("Invalid debug information file: %s" % e).tasks/assemble.pycatchesBadDifand recordsset_assemble_status(..., ChunkFileState.ERROR, detail=e.args[0]).checkAssembleResponsesurfaces thatdetailas the error above.The expected shape is documented in the server source, in the docstring of
get_debug_id_from_dif_requestright next to the regex:Since the
mapping-prefix is optional in the regex,/proguard/<uuid>.txt— exactly what thelegacy CLI sends — is the correct minimal form.
Fix
Add the leading slash back, matching the legacy protocol byte-for-byte as originally intended
by #1074. No other divergence: the UUID itself is already correct
(
uuidv5(uuidv5(NAMESPACE_DNS, "guardsquare.com"), <raw bytes>), verified against the legacyfixtures).
Test plan
test/lib/api/proguard.test.ts(uploadProguardMappings > assemble request names each mapping with a leading-slash /proguard/ path) that mocks thechunk-upload and assemble endpoints and asserts the exact DIF name sent.
proguard/<uuid>.txt) and passes with it(
/proguard/<uuid>.txt).pnpm vitest run test/lib/api/proguard.test.ts test/commands/proguard— 18/18 passing.sentry proguard uploadon0.40.0and
0.41.0. The same mappings, from the same CI pipeline, assembled successfully throughlegacy
sentry-cli3.6.2 before it was swapped for this CLI — the assemblenameis the onlyrelevant difference between the two.