Skip to content
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

base64Decode: clearer error message when an invalid character is detected (backport #8766) #11517

Open
wants to merge 1 commit into
base: 2.20-maintenance
Choose a base branch
from

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Sep 17, 2024

Output the offending string in its entirety to provide context.

Closes #8479

Motivation

I recently had an issue where the public key for a binary cache was pasted incorrectly into the extra substituters section of a flake.nix. All I received as error output when attempting to build was:

invalid character in Base64 str: '

After spending some time trying to bisect the issue I was still unable to determine what change had resulted in the error. That was when @zimbatm and @Mic92 suggested patching nix to better explain what was causing the problem.

@Mic92 put together this small patch and, after applying it, the underlying issue was immediately apparent since the error message contained the malformed public key entry.

Context

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.


This is an automatic backport of pull request #8766 done by [Mergify](https://mergify.com).

…cted

Output the offending string in its entirety to provide context.

Closes #8479

(cherry picked from commit dc3ccf0)
@mergify mergify bot added the merge-queue label Sep 17, 2024
@mergify mergify bot requested a review from edolstra as a code owner September 17, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant