Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-store --verify-path fails with no information, and sometimes spurious results #900

Open
adnelson opened this issue May 10, 2016 · 10 comments
Assignees
Labels

Comments

@adnelson
Copy link

I've been encountering occasional errors when doing nix-copy-closure. The command sometimes fails, complaining that a path is not valid, and I can't seem to find why. The failures do not seem to have anything to do with SSH. For example, putting the path into nix-store --verify-path also fails, in one of two ways. The first is an error which has no explanation:

$ nix-store --verify-path /opt/ns/nix/store/19j1vdjqrb9yv7fwyf9rhwk44v5k1cpk-python3.4-some-package
error: path ‘/opt/ns/nix/store/19j1vdjqrb9yv7fwyf9rhwk44v5k1cpk-python3.4-some-package’ is not valid

This is not helpful at all -- why is it not valid? The store objects haven't been modified in any way.

The other message is slightly more informative, but makes no sense:

$ nix-store --verify-path /opt/ns/nix/store/19g7aaw44gpkb0jswqgj9b06lf0f4x0v-for-own-0.1.3-nodejs-4.2.3
path ‘/opt/ns/nix/store/19g7aaw44gpkb0jswqgj9b06lf0f4x0v-for-own-0.1.3-nodejs-4.2.3’ was modified! expected hash ‘0000000000000000000000000000000000000000000000000000000000000000’, got ‘5d3ead5d0fa9c1ff34c14bec36c5319895d171a5efd96519067c29e663279b99’

This to me indicates that nix is storing hashes incorrectly. It also calls into question whether the other type of error is valid.

Unfortunately, there's no easy way to provide steps to reproduce the error, as it seems to be completely arbitrary which paths break. At the very least, there needs to be more informative error messages here.

@domenkozar
Copy link
Member

Is your hdd drive all good?

@adnelson
Copy link
Author

Yes. Also this happens on multiple machines, including OSX and Centos, and on VMs.

@adnelson
Copy link
Author

A potential issue I see is that I'm using a non-standard nix directory (/opt/ns/nix instead of /nix)

@domenkozar domenkozar added the bug label May 31, 2016
@domenkozar
Copy link
Member

domenkozar commented May 31, 2016

@adnelson this one is really hard to debug, because I can not reproduce. Any steps to get http://sscce.org would help :)

@srid
Copy link

srid commented Jan 6, 2018

I hit this while trying to install NixOS from rescue mode. Instructions here - except I do this on a ovh.com dedicated server (their rescue mode).

$ nixos-install
[...]
importing serialized closure /tmp/tmp.lA5cW2B0Jp/channel.closure to /mnt...
error: path '/nix/store/gy4yv67gv3j6in0lalw37j353zdmfcwm-nix-1.11.16' is not valid
#
# nix-store --verify-path /nix/store/gy4yv67gv3j6in0lalw37j353zdmfcwm-nix-1.11.16
path ‘/nix/store/gy4yv67gv3j6in0lalw37j353zdmfcwm-nix-1.11.16’ was modified! expected hash ‘0000000000000000000000000000000000000000000000000000000000000000’, got ‘6a1d3f98ebed460e04191e3f308105f5e42fa3fc9fa818145c27b0803f56fb61’
#

@canndrew
Copy link

canndrew commented Feb 26, 2018

I'm getting this as well. I can't rebuild my system because of it :(

$ nixos-rebuild build
.
.
.
ln: failed to create symbolic link '/nix/store/hnr5cvavqcd12iiclcpqy2vvwz2pry7d-neovim-ruby-env/bin/bundle': File exists
builder for ‘/nix/store/lv4khjybbjhh4dgzbjg2xk3bgrgiw4za-neovim-ruby-env.drv’ failed with exit code 1
$ nix-store verify-path /nix/store/hnr5cvavqcd12iiclcpqy2vvwz2pry7d-neovim-ruby-env
error: path ‘/nix/store/hnr5cvavqcd12iiclcpqy2vvwz2pry7d-neovim-ruby-env’ is not valid
$ NIX_REMOTE= nix-store --repair-path /nix/store/hnr5cvavqcd12iiclcpqy2vvwz2pry7d-neovim-ruby-env
error: path ‘/nix/store/hnr5cvavqcd12iiclcpqy2vvwz2pry7d-neovim-ruby-env’ is not valid

Any ideas how I can at least fix the "file exists" error?

@chreekat
Copy link
Contributor

I have one near-sscce that has one confounding factor: Vagrant.

https://github.com/chreekat/invalid-path-test

For some reason, glibc is considered an invalid path when using export+import to copy a closure to a VM, but everything is fine if nix-copy-closure is used directly.

I ran into this when working on a system where nix-copy-closure isn't immediately available, possibly for bad reasons. That doesn't seem relevant, though -- export+import should work, I think!

@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@stale
Copy link

stale bot commented May 2, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed May 2, 2022
@thufschmitt thufschmitt reopened this Feb 24, 2023
@a-h
Copy link

a-h commented Jan 19, 2024

I think this issue persists into the very latest versions of Nix, as per #9052 (comment)

@stale stale bot removed the stale label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants