Skip to content

binary-cache: accept full store paths in narinfo StorePath field#1793

Open
Mic92 wants to merge 1 commit into
NixOS:masterfrom
Mic92:narinfo-store-path
Open

binary-cache: accept full store paths in narinfo StorePath field#1793
Mic92 wants to merge 1 commit into
NixOS:masterfrom
Mic92:narinfo-store-path

Conversation

@Mic92

@Mic92 Mic92 commented Jun 11, 2026

Copy link
Copy Markdown
Member

The StorePath field of a narinfo holds the full path (/nix/store/-); cache.nixos.org serves it that way and harmonia_store_nar_info, used for our own uploads, writes it that way. parse_narinfo fed the value into StorePath::from_str, which only accepts the base name, so every spec-conforming narinfo failed to parse.

The queue runner therefore could not read back narinfos from its own binary cache: has_narinfo failed for every path, uploads were repeated endlessly and copy_paths errors failed the affected builds. Observed on a 120-build nixos-small evaluation against an S3 cache populated by the runner itself: 2067 'invalid value for StorePath' errors and all 120 builds failing with status 2.

Parse the field relative to the store directory instead. This also rejects narinfos for a different store; parse_narinfo already assumes the default store directory for the rest of the result.

// only accepts the base name. Parsing via the store
// directory (assumed to be the default one throughout this
// function) also rejects narinfos for a different store.
store_path_opt = Some(StoreDir::default().parse(val).map_err(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Fine for hydra.nixos.org, but the StoreDir here ought to be a parameter that we pass in.

(Also presumably this parsing logic is in Harmonia?)

@Ericson2314 Ericson2314 Jun 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nix-community/harmonia#1080 the logic is in Harmonia now (asked @amaanq to write from scratch)

The StorePath field of a narinfo holds the full path
(/nix/store/<hash>-<name>); cache.nixos.org serves it that way and
harmonia_store_nar_info, used for our own uploads, writes it that way.
parse_narinfo fed the value into StorePath::from_str, which only
accepts the base name, so every spec-conforming narinfo failed to
parse.

The queue runner therefore could not read back narinfos from its own
binary cache: has_narinfo failed for every path, uploads were repeated
endlessly and copy_paths errors failed the affected builds. Observed
on a 120-build nixos-small evaluation against an S3 cache populated by
the runner itself: 2067 'invalid value for StorePath' errors and all
120 builds failing with status 2.

Parse the field relative to the store directory instead. This also
rejects narinfos for a different store; parse_narinfo already assumes
the default store directory for the rest of the result.
@Mic92 Mic92 force-pushed the narinfo-store-path branch from d59671d to 19fc689 Compare June 11, 2026 17:18
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