fix(libstore): improve legacy ssh addToStore diagnostics#15503
Open
znaniye wants to merge 2 commits intoNixOS:masterfrom
Open
fix(libstore): improve legacy ssh addToStore diagnostics#15503znaniye wants to merge 2 commits intoNixOS:masterfrom
znaniye wants to merge 2 commits intoNixOS:masterfrom
Conversation
Capture non-binary replies from remote nix-store --serve so protocol mismatches report actionable context instead of opaque serialisation failures.
41ebf91 to
2db2f06
Compare
7ded4e5 to
d44844e
Compare
Cover legacy ssh addToStore failures that return textual remote rejections, asserting both the remote payload and the actionable error diagnostics exposed to users.
d44844e to
0dddef1
Compare
Member
Author
|
It strips If you guys know a better way to trigger this binary-vs-text reply path in tests, I’m happy to switch. Suggestions welcome, and thanks in advance. |
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.
Motivation
nix copy --to ssh://...can fail with a misleading low-level deserialisation error when the remote side returns a plain-text rejection instead of the expected binary status reply.In this situation, users see a transport/protocol-looking failure even though the real issue is a policy rejection on the remote side.
Context
In a real-world flow, copying an unsigned store path to a remote machine as a non-trusted user produced:
This is hard to act on because it hides the underlying remote reason.
The actual remote-side cause was a trust/signature policy failure (path lacks a signature by a trusted key), but the client attempted to parse that text as a binary integer.
User-Visible Result
With this change, the same class of failure now reports a directly actionable error, for example:
This keeps protocol handling behavior intact while making failures diagnosable at the right abstraction level.