Just starting and all I get is warning: substituter

first time user of nix
I dont seem to be able to load anything.

This doesnt seem right:
I tried to load the hello program.
nix-env -i hello

and got

installing ‘hello-2.10’
these paths will be fetched (0.04 MiB download, 0.19 MiB unpacked):
/nix/store/pa71var5s6nyz49br1ld2y1krzkw7gz2-hello-2.10
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/pa71var5s6nyz49br1ld2y1krzkw7gz2-hello-2.10’
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/n2hjbpkf4c0m48945ivxs3lmsczzw2rg-bash-4.4-p23’

These warning go on for all kinds of file, 100’s of them.

warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/7yx0hyrb0xhhcqwqqf4jbg810s2x8mzn-libev-4.24’
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/rakdlbfd6l5syjljirksbjdncwkj7nxl-libtool-2.4.6’
building ‘/nix/store/swya3lba2nxqsclkr3bci8892qqmgrz8-gcc-7.3.0.drv’…
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/h6babx1km8miiz7xf4zpf5yxh7kniggf-help2man-1.47.7’
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/f1vg5m86rlvbk0arv0ij0gr2ivpxr23w-perl5.28.0-gettext-1.07’
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/dvbnr6l7ibnfrbqbca2n1i6alcq6mxpq-perl-5.28.0’
$CPATH is /nix/store/3fgq9njs3g02wv11mjhnivl5mlgimzr4-zlib-1.2.11-dev/include' $LIBRARY_PATH is /nix/store/2dbjpfa4s4c51h70vbzrcbl2krw3c3z4-zlib-1.2.11/lib’
unpacking sources
unpacking source archive /nix/store/m16cs9a00znx11mqfbkmk5f3i7gyn1ca-gcc-7.3.0.tar.xz
source root is gcc-7.3.0
setting SOURCE_DATE_EPOCH to timestamp 1516870173 of file gcc-7.3.0/MD5SUMS
patching sources
applying patch /nix/store/s6lavkpjqzihfs0vjfnnz7lizpsfmgnl-riscv-pthread-reentrant.patch

Then it starts to compile everything in the world.
This doesnt seem right.
I thought the substituters urls in nix.conf
see below:

build-users-group = nixbld

max-jobs = 32
cores = 1
sandbox = false
substituters = https://hydra.iohk.io https://cache.nixos.org
trusted-substituters =
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

was suppose to deliver precompiled binaries.

I must have something FUBARed but i have no idea what.
Can anyone give me a clue. I installed nix for multiuser,
there is a /nix/store.
I’ve rebooted the system so any profile changes should have taken effect.

The only thing I can find that seems wrong is in the /nix/var/nix/profiles/per-user folder
there are folders under the root user but not for me as a regular user.
The regular user is there but no folders under it.

I’ve waited hours but the compiles just keep on coming. Its like its compiling
the whole linux system.
I;m working on a ubuntu 16.4 system

Looks like you’re overriding the trusted-public-keys option ?
There should be cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= also for cache.nixos.org to work.

thanks for getting back to me.
I’m confused, there are 2 substituters and 2 trusted public keys
I copied and pasted this from someplace. is the -1 on the cache.nixos.org the problem.

ah sorry didn’t see the cache.nixos.org public key at first

Could you try adding your user to trusted-users option in the nix.conf file

i’ll try anyhing, Ive been at it all morning and I’m about ready to give up
Do I have to restart anything to get the changes to nix.conf to take effect?

Yes. If you have a nix-daemon it needs a restart.

1 Like

I’ve restarted but no change.

What does this mean
nix-env -i hello
installing ‘hello-2.10’
these paths will be fetched (0.04 MiB download, 0.19 MiB unpacked):
/nix/store/pa71var5s6nyz49br1ld2y1krzkw7gz2-hello-2.10
warning: substituter ‘https://cache.nixos.org’ does not have a valid signature for path ‘/nix/store/pa71var5s6nyz49br1ld2y1krzkw7gz2-hello-2.10’

Its the first warning but it is followed by another 100 more warnings. Seems like something basic is wrong but I have no idea what.

even the manual says that if this does work something is wrong, but the manual gives no clue as to what.

status update:
I let the hello build continue, 4 hrs later, after it seemed like it recompiled half the world, I have a hello program. As it says in the manual, something is wrong.
What would be a good process to use or tools to use or what ever to figure this out. Clearly the online binary repository is a good idea but it didnt work for me.

A quick test with the following shows that at least your nix.conf should be fine:

let
  inherit (import <nixpkgs/nixos/tests/make-test.nix> {
    name = "substituter-problem";

    machine = { lib, pkgs, ... }: {
      environment.etc."nix/nix.conf".source = lib.mkForce (pkgs.writeText "nix.conf" ''
        build-users-group = nixbld

        max-jobs = 32
        cores = 1
        sandbox = false
        substituters = https://hydra.iohk.io https://cache.nixos.org
        trusted-substituters =
        trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
      '');
    };

    testScript = ''
      $machine->waitForUnit('multi-user.target');
      $machine->succeed('nix-build ${<nixpkgs>} -A hello');
    '';
  } {}) test;

in test.overrideAttrs (drv: {
  outputHashMode = "recursive";
  outputHashAlgo = "sha256";
  outputHash = "0000000000000000000000000000000000000000000000000000";
})

Output:

machine: must succeed: nix-build /nix/store/xy18fnqb657phzw80an26f776xwqs56v-nixpkgs -A hello
machine# warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
machine# these paths will be fetched (0.04 MiB download, 0.19 MiB unpacked):
machine#   /nix/store/nkp4ck5scygkjk87nr6w61gb23li829m-hello-2.10
machine# copying path '/nix/store/nkp4ck5scygkjk87nr6w61gb23li829m-hello-2.10' from 'https://cache.nixos.org'...
machine: exit status 0

So can you provide a bit more info on for example where you put the mentioned nix.conf?

In addition an output of the following commands would be helpful as well:

  • nix-env -v --version
  • nix-store -vvvvv -r /nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10

Be sure to strip out any secrets - there shouldn’t be any, but just to be sure :slight_smile:

1 Like

Thanks for your help.

mral@sunburst20171202:~$ nix-env -v --version
evaluating file ‘/nix/store/cdcia67siabmj6li7vyffgv2cry86fq8-nix-2.1.3/share/nix/corepkgs/derivation.nix’
nix-env (Nix) 2.1.3
Features: gc, signed-caches
Configuration file: /etc/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix

nix-store -vvvvv -r /nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10
locking this thread to CPU 1
querying info about missing paths…
starting pool of 3 threads
checking substituter ‘https://cache.nixos.org’ for path ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’
querying info about ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’ on ‘https://cache.nixos.org’…
downloading ‘https://cache.nixos.org/c2wyl8b9p4afivpcz8jplc9kis8rj36d.narinfo’…
download thread waiting for 10000 ms
starting download of https://cache.nixos.org/c2wyl8b9p4afivpcz8jplc9kis8rj36d.narinfo
curl: Couldn’t find host cache.nixos.org in the .netrc file; using defaults
download thread waiting for 10000 ms
download thread waiting for 10000 ms
download thread waiting for 10000 ms
curl: Connection #0 to host cache.nixos.org left intact
finished download of ‘https://cache.nixos.org/nar/18sd9aqbhagxj00zcjy5b0bkbj9ax6hhvxg0qcxg6s2fw2nfdhyl.nar.xz’; curl status = 0, HTTP status = 200, body = 43112 bytes
download thread waiting for 10000 ms
lock released on ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10.lock’
substitution of ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’: got EOF
substitution of ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’: woken up
substitution of ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’: substitute finished
substitution of path ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’ succeeded
substitution of ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’: done
substitution of ‘/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10’: goal destroyed
warning: you did not specify ‘–add-root’; the result might be removed by the garbage collector
/nix/store/c2wyl8b9p4afivpcz8jplc9kis8rj36d-hello-2.10

mral@sunburst20171202:~$ ls /etc/nix
nix.conf
mral@sunburst20171202:~$

Hm, okay the substition here worked well, so let’s try another package:

$ nix-build --no-out-link '<nixpkgs>' -A htop

PS: Btw., can you please put such outputs in code blocks so that they’re rendered with a fixed-width font and are (IMHO) more readable?

mral@sunburst20171202:~$ nix-build --no-out-link '<nixpkgs>' -A htop
these paths will be fetched (0.07 MiB download, 0.20 MiB unpacked):
  /nix/store/q0lb6qnsc4hzma4icqv23001vxjdb29k-htop-2.2.0
copying path '/nix/store/q0lb6qnsc4hzma4icqv23001vxjdb29k-htop-2.2.0' from 'https://cache.nixos.org'...
/nix/store/q0lb6qnsc4hzma4icqv23001vxjdb29k-htop-2.2.0
mral@sunburst20171202:~$ 

I also just tried to install one of the packages I tried early and now it seems to be doing what I would expect so the good news is that the problem may have gone away, the bad news is that I’m not sure what I did.

I’ll update as I get smarter

yep, its gone away.
I just installed gedit using

nix-env -i gedit

It copied a bunch of stuff and then fail with

copying path '/nix/store/wy5zkh90fbm4mil8ck89c0ahj35fwdk0-libsoup-2.62.2' from 'https://cache.nixos.org'...
warning: unable to download 'https://cache.nixos.org/nar/0ypfigvpkn9vpinq3idjx22nd01mb45qw617kjbc112jndvmj3sw.nar.xz': HTTP error 200 (curl error: Stream error in the HTTP/2 framing layer); retrying in 251 ms
error 9 while decompressing xz file
error: build of '/nix/store/1iclmn7dy07sbbvm20g9n2i2vjni65aq-gedit-3.28.1.drv' failed\

but I retried it and it finished.
so as it stands now I do not have a problem that I can recreate and I’m going to bed happy:-)
I’ll retry everything tomorrow and see what I have learned.

Thanks for your help.

My guess is that it was the restart, but anyway, I’d be curious to know if you find out about it one day

https://github.com/NixOS/nix/issues/1254

thanks, I will keep this in mind. I hate problems that go away by themselves,… they always seem to come back by themselves too and a lot closer to “first customer ship” time.