nix-env unable to build environments

Created on 11 Nov 2017  Â·  10Comments  Â·  Source: NixOS/nix

This also breaks nixos-rebuild. I have this on 17.09, @srhb was able to reproduce it with nixos-unstable. Nix 1.11.x works fine, and using nix-shell -p nix works as a workaround.

$ nix-env -f '<nixpkgs>' -iA hello
installing 'hello-2.10'
these paths will be fetched (0.04 MiB download, 0.20 MiB unpacked):
  /nix/store/1y6ckg6khrdsvll54s5spcmf3w6ka9k4-hello-2.10
copying path '/nix/store/1y6ckg6khrdsvll54s5spcmf3w6ka9k4-hello-2.10' from 'https://cache.nixos.org'...
building '/nix/store/2gaklfaf6959qpgqd2s61bj6rc4gvjx1-user-environment.drv'...
error: getting status of '/nix/store/159js8x2v9qvdlpkhjww69wlbglvykq5-mumble-1.2.19/share/icons/hicolor/scalable/apps/mumble.svg': No such file or directory
builder for '/nix/store/2gaklfaf6959qpgqd2s61bj6rc4gvjx1-user-environment.drv' failed with exit code 1
error: build of '/nix/store/2gaklfaf6959qpgqd2s61bj6rc4gvjx1-user-environment.drv' failed

$ nix-env -e mumble
uninstalling 'mumble-1.2.19'
building '/nix/store/ia6karvq412gjc71bm8bqgm6ry1b83kv-user-environment.drv'...
error: unexpected EOF reading a line
builder for '/nix/store/ia6karvq412gjc71bm8bqgm6ry1b83kv-user-environment.drv' failed with exit code 1
error: build of '/nix/store/ia6karvq412gjc71bm8bqgm6ry1b83kv-user-environment.drv' failed

Most helpful comment

That's the PR in!

@vcunat I can't find anything relevant with git log -i --grep propagate --grep env --all-match 1.11-maintenance.

@knedlsepp in this case, since it was IO-related, I used NIX_REMOTE= strace -o /tmp/strace.log -f nix-env -iA hello — unsetting NIX_REMOTE so I didn't have to track it down into the daemon (and running as root so this wouldn't be an issue), and then I searched the log for the error in question, and so I found the propagated-user-env-packages file leading up to that. If that hadn't got me anywhere, I would have tried gdb.

All 10 comments

I'm seeing this too. I've seen this when using Nix 1.12 client and a 1.11 server, haven't tried using nixUnstable as the system Nix recently. Has everyone experiencing this issue been using Nix 1.11 as system nix?

FWIW things like /run/booted-system/sw/bin/nix-env can be helpful for providing a working Nix if you haven't restarted yet :).

@dtzWill I'm using nixUnstable both for the daemon and for the client.

This is odd. For some packages nix-env -iA works just fine, for others I also get this failure. Is this dependent on which version of nix-daemon was running at build-time?

It doesn't seem to, since it occurs both for @dtzWill who's using 1.11 daemon and for me, and I'm using 1.12pre on both, so I'm guessing it's an issue in the client. Although I don't think anyone's tested 1.11 client and 1.12pre daemon yet.

This is getting annoying, any idea how to debug the issue? I am only seeing the issue on the client side when using nix-env v1.12.

I've found the issue (it's with propagated-user-env-packages not being terminated with a newline) and will be submitting a PR shortly :)

IIRC we were dealing with something very similar on 1.11 at some point, and it was patched quickly.

@lheckemann That's great to hear. Out of curiosity: What is your setup/toolset for debugging such issues?

That's the PR in!

@vcunat I can't find anything relevant with git log -i --grep propagate --grep env --all-match 1.11-maintenance.

@knedlsepp in this case, since it was IO-related, I used NIX_REMOTE= strace -o /tmp/strace.log -f nix-env -iA hello — unsetting NIX_REMOTE so I didn't have to track it down into the daemon (and running as root so this wouldn't be an issue), and then I searched the log for the error in question, and so I found the propagated-user-env-packages file leading up to that. If that hadn't got me anywhere, I would have tried gdb.

Was this page helpful?
0 / 5 - 0 ratings