Skip to content

internal/nix: fix unredacted error message #1782

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 1 commit into from
Feb 5, 2024
Merged

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Feb 5, 2024

Don't pass a slice of already-redacted arguments to redact.Errorf so that they're preserved in the regular error message.

Tested by forcing an error and seeing the full message:

$ go run ./cmd/devbox shell
Ensuring packages are installed.
✓ Computed the Devbox environment.
Error: nix print-dev-env --json "path:/Users/gcurtis/src/devbox/.devbox/gen/flake": exit status 1

Error: There was an internal error. Run with DEVBOX_DEBUG=1 for a detailed error message, and consider reporting it at https://github.com/jetpack-io/devbox/issues

Gets redacted in Sentry as:

nix print-dev-env --json "path:<redacted string>": <redacted *exec.ExitError>

Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

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

Tested and verified that the error motivated #1778 is properly handled as well. Thanks!

Don't pass a slice of already-redacted arguments to `redact.Errorf` so
that they're preserved in the regular error message.
@savil savil force-pushed the gcurtis/fix-redacted-err branch from 1b6efc1 to c3860d9 Compare February 5, 2024 16:53
@savil
Copy link
Collaborator

savil commented Feb 5, 2024

Rebased to incorporate the CICD fix of #1786

@gcurtis gcurtis merged commit f48959d into main Feb 5, 2024
@gcurtis gcurtis deleted the gcurtis/fix-redacted-err branch February 5, 2024 17:22
Copy link

sentry-io bot commented Feb 5, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ **exec.ExitError: <redacted errors.withStack>: nix print-dev-env --json "path:": <redacted exec.... go.jetpack.io/devbox/internal/nix in (*Nix).Pri... View Issue
  • ‼️ *exec.ExitError: nix print-dev-env --json "path:": <redacted exec.ExitError> go.jetpack.io/devbox/internal/nix in (*Nix).Pri... View Issue
  • ‼️ **exec.ExitError: <redacted usererr.combined>: nix print-dev-env --json "path:": <redacted exec.... go.jetpack.io/devbox/internal/nix in (*Nix).Pri... View Issue
  • ‼️ **exec.ExitError: <redacted errors.withStack>: nix print-dev-env --json "path:": <redacted exec.... go.jetpack.io/devbox/internal/nix in (*Nix).Pri... View Issue

Did you find this useful? React with a 👍 or 👎

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

Successfully merging this pull request may close these issues.

2 participants