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

Getting "secret key is corrupt" on most commands #45339

Closed
cah6 opened this issue Aug 19, 2018 · 6 comments
Closed

Getting "secret key is corrupt" on most commands #45339

cah6 opened this issue Aug 19, 2018 · 6 comments

Comments

@cah6
Copy link

cah6 commented Aug 19, 2018

Issue description

It seems like any command that tries to fetch a cached binary is failing with:
error: secret key is corrupt

Steps to reproduce

Not sure how I get into this state but current behavior is:

$ nix-env -i zip
warning: name collision in input Nix expressions, skipping '/Users/christian.henry/.nix-defexpr/channels_root/nixpkgs'
installing 'zip-3.0'
these paths will be fetched (0.15 MiB download, 0.54 MiB unpacked):
  /nix/store/cpja0xjyi9nxb715nljbkpii7l6zmhyk-zip-3.0
error: secret key is corrupt

Technical details

nix-shell -p nix-info --run "nix-info -m" actually fails too:

$ nix-shell -p nix-info --run "nix-info -m"
these paths will be fetched (2.01 MiB download, 11.35 MiB unpacked):
  /nix/store/1bzafpp9bhbs70kbg4k3ya1xz9bnd26k-bash-4.4-p19-doc
  /nix/store/1c995fhi4rqn7ss7qv4l5mbcl5ajyspf-adv_cmds-osx-10.5.8-locale
  /nix/store/20n07wawwvn0af8dr7xxl7zpkfyh9324-bash-4.4-p19-man
  /nix/store/2hwayv4fhak2kl7y6hjyi18gxh7ncvx8-readline-7.0p3
  /nix/store/614viw8ffn0qfmfrcidfv487qz8rnjcj-bash-4.4-p19-dev
  /nix/store/72dvq0f1rpmrnk4d0h7by8m6ln70l0b9-bash-4.4-p19-info
  /nix/store/8p3izl58ny7hr52jwh1fpnwgc0zxk8xc-DarwinTools-1
  /nix/store/bj2m0fb1kik3dxn1nx763s3lmmy7jgwv-nix-info
  /nix/store/dr80a9mwy52yqaxc9n9lw35mqm4yc08p-stdenv-darwin
  /nix/store/k5wbwf1nsywpbbrypjd82hcn7pbd69wh-bash-4.4-p19-info
  /nix/store/lvymdjrcixv781ss1byny6zjqmfxq828-bash-4.4-p19-dev
  /nix/store/p17frn8zgghjfpr0j38mfbasvsjcfpbp-bash-4.4-p19
  /nix/store/xsbwr7ns6wxrmhis72q5x9m2vlcw6rgi-bash-4.4-p19-man
  /nix/store/y9s019svvv488abp0sazjm6qa0nwmgc7-bash-4.4-p19-doc
error: secret key is corrupt

but I have:

$ nix --version
nix (Nix) 2.0.2

and

$ nix-channel --list
nixpkgs http://nixos.org/channels/nixpkgs-unstable

and I'm on OSX 10.13.4. Is there any way to regenerate the secret key used by nix or something? I don't even know where stuff like that is stored.

@xeji
Copy link
Contributor

xeji commented Aug 21, 2018

cc @edolstra

@edolstra
Copy link
Member

What does your nix.conf look like?

@cah6
Copy link
Author

cah6 commented Aug 21, 2018

Gahh forgot that some keys were there. Looks like at some point my nix.conf lost a line and so it became

trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=binary-caches = https://cache.nixos.org https://nixcache.reflex-frp.org

instead of

trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=
binary-caches = https://cache.nixos.org https://nixcache.reflex-frp.org

Thanks for the replies! Feel free to resolve this however you want.

@xeji
Copy link
Contributor

xeji commented Aug 21, 2018

Glad you found the cause of your problem. Closing as not-a-bug.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/error-secret-key-is-corrupt-when-building-flake/40440/2

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/error-secret-key-is-corrupt-when-building-flake/40440/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants