Skip to content

nix registry pin nixpkgs/release-22.05 gives "NAR hash mismatch in input" #6759

Description

@pwaller

Describe the bug

(Originally posted as NixOS/nixpkgs#180160, redirected here by @veprbl , thanks!)

nix registry pin nixpkgs/release-22.05 gives an error message NAR hash mismatch in input which is not clear how to action. I'm unclear on where the mismatched hashes are coming from. A garbage collect causes things to happen again (things get downloaded) but the error is repeatable.

Steps To Reproduce

Steps to reproduce the behavior:

  1. nix registry pin nixpkgs/release-22.05
  2. Observe output:
error: NAR hash mismatch in input 'github:NixOS/nixpkgs/release-22.05' (/nix/store/kpl6bxwjpirqpvsm98xw5hjfzg33zpcf-source), expected 'sha256-QEWkUBH4gu6ntNkF+9xIqDM22bto4PB+LSHIL6oWFpM=', got 'sha256-1aMu67m+orlGxVwfiX3RxTEVFoq/RmKa/L5u9zU3UNQ='

Expected behavior

I don't know if I'm using this command incorrectly. My intent is to pin references to the nixpkgs/release-22.05 to the current commit, so that I may avoid constantly freshening it, and use nixpkgs/release-22.05. If there is a hash mismatch somewhere, it would be good if it could be clear where the mismatched hashes are coming from. I see that one of them is /nix/store/kpl6bxwjpirqpvsm98xw5hjfzg33zpcf-source, but what's the other reference, and why do they mismatch? Does it mean my local content is bad, or something else?

I was able to delete the 'bad' path using nix-store --query --roots to identify what was keeping it alive. But then the issue is again repeatable. It reproduces on two machines that I've tried and with nixpkgs/release-21.11.

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix-info -m
 - system: `"aarch64-linux"`
 - host os: `Linux 5.15.49, NixOS, 22.05 (Quokka), 22.05.20220702.8b9c011`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions