Failed to extract archive on channel update

[user@nixos:~]$ sudo nix-channel --update
unpacking 2 channels...
error: failed to extract archive (Truncated tar archive detected while reading data)
error: Cannot build '/nix/store/p5slq6mlcsl3kgr48vilpkvxxh8mbyp3-unstable.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/fi9bhnlnz7i19l9i9lc0ykihapqxgsl1-unstable

error: build of '/nix/store/m9b1m6y4s5gvwah4yqw1vh1mjjpr7mlq-nixos-26.05.drv', '/nix/store/p5slq6mlcsl3kgr48vilpkvxxh8mbyp3-unstable.drv' failed
error: program "/nix/store/28fpvivsgh8g62w72ayxgpc1bmj5wcjv-nix-2.34.7/bin/nix-env" failed with exit code 100

Just now on one of my machines. Any ideas?

Looks like store corruption, have you tried a store repair?

1 Like

More specifically:

sudo nix-store --verify --repair --check-contents
2 Likes
....
error: cannot repair path '/nix/store/jshfabhbpxqfv1h0ihz8y6mbnqvii18w-nixexprs.tar.xz'
path '/nix/store/kbadg0bs1m129vqy9gjrihf30z1zy1rm-Compress-Raw-Bzip2-2.218.tar.gz.drv' was modified! expected hash 'sha256:1xscxaq1g486cy53mqzd6cmzv9lnapd3vj8lzm78zscq40y0hjyn', got 'sha256:0ip26j2h11n1kgkz36rl4akv694yz65hr72q4kv4b3lxcbi65b3p'
copying path '/nix/store/kbadg0bs1m129vqy9gjrihf30z1zy1rm-Compress-Raw-Bzip2-2.218.tar.gz.drv' from 'https://cache.nixos.org'...
path '/nix/store/ng2bmnh2hqxkbm420kfqavx8dj5lp5v1-nixexprs.tar.xz' was modified! expected hash 'sha256:0z2iwvx7wlc374yf1cqh00hjbrvchjjgyifahr6vj8hc0093avax', got 'sha256:1s0xndwl7vspkhi2abqadc5h8gfd8aw89cq6ll1bkzp1j9fps9k2'
error: cannot repair path '/nix/store/ng2bmnh2hqxkbm420kfqavx8dj5lp5v1-nixexprs.tar.xz'
path '/nix/store/ny7fn72pqz8m4hjypqa79cgxfh121fmn-nuke-refs.drv' was modified! expected hash 'sha256:05cjhlgd2a1211nklw186cxp2ans4va1j6hyh8yswrdhwyjhdr6f', got 'sha256:0ip26j2h11n1kgkz36rl4akv694yz65hr72q4kv4b3lxcbi65b3p'
copying path '/nix/store/ny7fn72pqz8m4hjypqa79cgxfh121fmn-nuke-refs.drv' from 'https://cache.nixos.org'...
path '/nix/store/slcx8fdqr59dwcslw1iw9gvm9iswkrmy-Archive-Tar-3.12.tar.gz.drv' was modified! expected hash 'sha256:1dx8chql6yb41g8mhhawqc86plhja1xzxf8nibk10007b95xpncf', got 'sha256:0ip26j2h11n1kgkz36rl4akv694yz65hr72q4kv4b3lxcbi65b3p'
copying path '/nix/store/slcx8fdqr59dwcslw1iw9gvm9iswkrmy-Archive-Tar-3.12.tar.gz.drv' from 'https://cache.nixos.org'...
warning: not all store errors were fixed

I have not touched the system for a while - only repartioned with gparted from external.
On a side note: syntax coloring has gone here.

Right, those paths aren’t part of the hydra cache so they cannot be fixed.

Just delete the two where it errored (using nix-store --delete), nix will redownload them.

2 Likes

executing for a second time did not produce any error message any more.

1 Like

I am productive again. Thanks everyone for the swift help and support