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

nixops deploys wrong schema #603

Closed
basvandijk opened this issue Feb 10, 2017 · 13 comments
Closed

nixops deploys wrong schema #603

basvandijk opened this issue Feb 10, 2017 · 13 comments

Comments

@basvandijk
Copy link
Member

I just provisioned a new machine on Hetzner with nixops. After the initial successful deployment I did another deployment during which I got the following error:

$ nixops deploy  -s deployment/state.nixops -d stalling-net --include hermes
building all machine configurations...
hermes..........> copying closure...
hermes..........> error: current Nix store schema is version 10, but I only support 7

Note that I'm using nixos-16.09 and I haven't overridden nix with nixUnstable or anything. On hermes I'm using the following version of the nix tools:

$ nix-store --version
nix-store (Nix) 1.11.6

The Nix schema on hermes is indeed 10 (on my workstation it's 7):

$ cat /nix/var/nix/db/schema
10

After removing /nix/var/nix/db/schema the deployment went successful and the schema was back at 7:

$ cat /nix/var/nix/db/schema
7

Any idea what's going on?

@rbvermaa
Copy link
Member

@basvandijk Is this after the initial reboot (so after the bootstrapping of nixos via the rescue system?)

@rbvermaa
Copy link
Member

@aszlig Have you seen this before?

@basvandijk I will try to reproduce with 16.09 today.

@rbvermaa
Copy link
Member

@basvandijk Is this with nixops 1.4 btw?

@aszlig
Copy link
Member

aszlig commented Feb 10, 2017

I think this should be the issue:

echo "chroot /mnt \"${base}/bin/nix-store\" --load-db <<'REGINFO'"

@rbvermaa
Copy link
Member

@aszlig So this bootstrap gets built with a different nixpkgs, I guess (from NIX_PATH of the nixops process) ?

@aszlig
Copy link
Member

aszlig commented Feb 10, 2017

@rbvermaa: Considering c5c49a1, is this still the case for Nix 1.11? Because if that's not the case we can just get back to not use nixUnstable during bootstrap.

@rbvermaa
Copy link
Member

@aszlig will test that, thanks.

@basvandijk
Copy link
Member Author

Great, I see you guys already spotted the problem.

@rbvermaa let me still answer your initial questions:

  • I believe I noticed it after the initial reboot when I did a second nixops deploy.

  • I'm using the default nixops that comes with nixos-16.09 which is nixops-1.4.

@rbvermaa
Copy link
Member

@basvandijk Although I think the solution that aszlig mentions, will fix the issue for you, I haven't been able to reproduce the issue with nixops 1.4 and nixos-16.09 yet. Could you run one more command and post the output:

 $ nix-instantiate --eval-only '<nixpkgs>' -A lib.nixpkgsVersion

Please run this with the same NIX_PATH env variable as your nixops call (note that if you use -I to pass nixops a different nixpkgs, I do not need this one)

@basvandijk
Copy link
Member Author

@rbvermaa the output is "16.09pre-git". Note I'm using the following revision of nixpkgs:

{
  "url": "https://github.com/NixOS/nixpkgs.git",
  "rev": "cd58b22b178cb01e17aeac548279293a847162f9",
  "date": "2017-02-06T20:06:19+01:00",
  "sha256": "0b5z38jm5b58pijjxyhlzisyna3x362rr7ijklnrnkggipxd32sx"
}

@fuzzy-id
Copy link

I just ran into this issue, too. I deploy to Hetzner. Initial deployment works. I stumbled over the error pasted by the OP after doing nixops modify […] and nixops deploy […].

$ nixops --version
NixOps 1.4
$ nix-instantiate --eval-only '<nixpkgs>' -A lib.nixpkgsVersion 
"16.09.1650.d2cd8a0"

@domenkozar
Copy link
Member

Sounds like this is fixed in 08d5156

@domenkozar
Copy link
Member

This appears to be fixed as said. Please reopen if issue persits.

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

No branches or pull requests

5 participants