NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.44k stars 1.5k forks source link

File truncation and nix store corruption on power loss during `nix-copy-closure` #11457

Open elikoga opened 1 month ago

elikoga commented 1 month ago

Describe the bug

We are experiencing sporadic file truncation when nix-copy-closure is interrupted on either the --from or --to systems.

The nix-copy-closure is triggered by a nixos-rebuild with --target-host.

We are forced to scan and repair the store using nix store verify --no-trust --all and nix-store --repair-path.

Expected behavior

I would expect the internal functions on the remote to prevent store corruptions.

nix-env --version output

nix-env (Nix) 2.18.5

Additional context

I will add more details when this occurs again.

Priorities

Add :+1: to issues you find important.

sersorrel commented 2 weeks ago

Probably related: https://github.com/NixOS/nix/issues/1218