Skip to content

ci(nix): harden Update Nix hashes against cache.nixos.org HTTP/2 flakes#209

Merged
adibhanna merged 1 commit into
mainfrom
ci/nix-update-harden
Jun 19, 2026
Merged

ci(nix): harden Update Nix hashes against cache.nixos.org HTTP/2 flakes#209
adibhanna merged 1 commit into
mainfrom
ci/nix-update-harden

Conversation

@adibhanna

Copy link
Copy Markdown
Contributor

The Update Nix hashes workflow (added in #208) failed twice on the same transient cache error — nix-prefetch-github died when a NAR download from cache.nixos.org corrupted over HTTP/2:

curl error: Stream error in the HTTP/2 framing layer
error: failed to read compressed data (Zstd decompression failed: Data corruption detected)
error: ... no substituter that can build it ... try '--fallback' to build derivation from source

The same path (boost-1.89.0-dev) corrupts on every retry, so re-running doesn't help.

Fix

  • NIX_CONFIG: http2 = false at the job level — avoids the HTTP/2 framing bug that corrupts the stream in the first place.
  • download-attempts = 5 / connect-timeout = 20 — ride out transient drops.
  • --fallback on every nix run / nix build — if a substitute is still unusable, build it from source instead of failing the whole run (exactly what the error message recommends).

No change to the hash logic. Merge this, then re-run Actions → Update Nix hashes → 2.4.0.

The Update Nix hashes run kept dying in nix-prefetch-github when a NAR
download from cache.nixos.org corrupted over HTTP/2 ("Stream error in the
HTTP/2 framing layer" -> zstd corruption), and nix gave up because it
could not fall back to building from source. Disable HTTP/2 via NIX_CONFIG
to avoid the framing bug, bump download retries, and pass --fallback to
every nix run/build so an unusable substitute builds from source instead
of failing the run.
@adibhanna
adibhanna merged commit 08027c3 into main Jun 19, 2026
5 checks passed
@adibhanna
adibhanna deleted the ci/nix-update-harden branch June 19, 2026 23:25
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.

1 participant