Replying because I encountered this issue today.
If you see that error, it usually means your disk got corrupted. If that happened, there might be other store paths that are also facing this issue. So the first thing to do is to run nix store verify --all --no-trust
to get a list of all of the broken store paths.
Then for each of the broken store path, run nix store repair <store-path>
. Eg: nix store repair /nix/store/l2vgw2r8wf3xqbjjmrdxl338bbs9y852-dictd-dbs
.
That’s it.
The reason this surfaces during a closure copy is that Nix assembles back the NAR file to send over the wire, and compares its checksum with the one it got from cache.nixos.org (which is recorded in /nix/var/nix/db/db.sqlite
). And because of the disk corruption, the assembled NAR ends up with different content.