Skip to content

fix(v9/remix): Ensure source maps upload fails silently if Sentry CLI fails #17095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 21, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jul 21, 2025

Backport of #17082

Lms24 added 2 commits July 21, 2025 09:03
…ils (#17082)

Sentry CLI's `cli.releases.uploadSourceMaps` method previously never
rejected when the actual CLI binary execution exited with an error code.
In CLI 2.49.0 (and 2.50.0) I added a new live mode `rejectOnError` which
continues to pipe stdio to the process (the remix SDKs' upload script)
but now also rejects on error.

This PR 1. bumps Sentry CLI, 2. configures the CLI to actually reject
now but 3. also catches the rejection and logs a message. I decided to
still continue with the script because we should still delete source
maps. Otherwise, we risk deploying them when users expect them to be
deleted. (i.e. fail silently but correctly :D)
@Lms24 Lms24 changed the base branch from develop to v9 July 21, 2025 07:04
@Lms24 Lms24 self-assigned this Jul 21, 2025
@Lms24 Lms24 requested review from a team, AbhiPrasad and andreiborza and removed request for a team July 21, 2025 07:05
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Sentry Source Maps Upload Failures and Data Loss

The createRelease.js script now silently fails to upload source maps and prematurely deletes local files.

  1. An invalid live: 'rejectOnError' option passed to sentry.releases.uploadSourceMaps causes the Sentry CLI to error, preventing uploads. This error is silently swallowed by a new try...catch block.
  2. Due to errors from uploadSourceMaps and finalize being swallowed, deleteSourcemaps now executes unconditionally when --deleteAfterUpload is used. This deletes local source maps even if they were never successfully uploaded or finalized, leading to data loss and preventing debugging or re-uploads.

packages/remix/scripts/createRelease.js#L29-L54

try {
await sentry.releases.uploadSourceMaps(release, {
urlPrefix: URL_PREFIX,
include: [BUILD_PATH],
useArtifactBundle: !argv.disableDebugIds,
live: 'rejectOnError',
});
} catch {
console.warn('[sentry] Failed to upload sourcemaps.');
}
try {
await sentry.releases.finalize(release);
} catch {
console.warn('[sentry] Failed to finalize release.');
}
if (argv.deleteAfterUpload) {
try {
deleteSourcemaps(BUILD_PATH);
} catch (error) {
console.warn(`[sentry] Failed to delete sourcemaps in build directory: ${BUILD_PATH}`);
console.error(error);
}
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Lms24 added a commit that referenced this pull request Jul 21, 2025
Small cleanup forward-port to `develop` (see
#17095 (comment).)

Co-authored-by: Andrei <[email protected]>
@Lms24 Lms24 merged commit 0329555 into v9 Jul 21, 2025
326 of 330 checks passed
@Lms24 Lms24 deleted the lms/v9-fix-remix-rejectOnError branch July 21, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants