Skip to content

fix(cli): log UID resolution failures in sentry cli fix - #1541

Merged
BYK merged 1 commit into
mainfrom
fix/cli-fix-resolve-uid-silent-catch
Sep 8, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/cli-fix-resolve-uid-silent-catch

Conversation

@cursor

@cursor cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix silent catch in resolveUid() in src/commands/cli/fix.ts.

Root cause

The resolveUid function catches execFileSync("id", ["-u", ...]) failures silently, returning null without any diagnostic output. When sudo sentry cli fix cannot determine the real user's UID (e.g., SUDO_USER is set to an unknown username, or the id binary is missing), the command bails early with a generic "Could not determine a non-root UID" message but never logs the underlying system error.

Reproduction

  1. Run sudo sentry cli fix with SUDO_USER set to a username that doesn't exist on the system
  2. The command reports it can't determine the UID but doesn't say why
  3. No debug-level log indicates what went wrong with the id -u call

Fix

  • Add log.debug() to surface the username and the execFileSync error
  • Remove the grandfathered biome-ignore lint/plugin suppression comment
  • The function still returns null as a fallback, but the error is now visible in debug logs (--log-level debug)
Open in Web View Automation 

…lently returning null

The resolveUid function catches execFileSync failures silently, returning
null without any diagnostic output. When `sudo sentry cli fix` cannot
determine the real user's UID, it bails early with a generic message
("Could not determine a non-root UID") but never logs the underlying
system error (e.g., unknown username, missing `id` binary, permission denied).

Add log.debug() to surface the username and error, and remove the
grandfathered biome-ignore suppression.

Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 7, 2026 12:12pm UTC

Request Review

@BYK
BYK marked this pull request as ready for review September 8, 2026 12:03
@BYK
BYK merged commit 72c307f into main Sep 8, 2026
32 checks passed
@BYK
BYK deleted the fix/cli-fix-resolve-uid-silent-catch branch September 8, 2026 12:03

This branch was successfully deployed

1 active deployment
Preview — 6ce18a24 Deployed Sep 7, 2026 by vercel[bot]
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