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 2: builder for ‘user-environment.drv’ failed with exit code 1 #1934

Closed
nyarly opened this issue Mar 1, 2018 · 15 comments
Closed

Nix 2: builder for ‘user-environment.drv’ failed with exit code 1 #1934

nyarly opened this issue Mar 1, 2018 · 15 comments
Assignees

Comments

@nyarly
Copy link

nyarly commented Mar 1, 2018

⮀ nix-env --uninstall nixos.nixStable2
warning: unknown setting 'signed-binary-caches'
building path(s) ‘/nix/store/06rgwisf4cdlqa6l7xxyxiaadi4cgi88-user-environment’
error: opening directory '/nix/store/xlwnarkhayb5flnp19407vw5jawgz6vr-linux-config-4.4.14': Not a directory
builder for ‘/nix/store/7ryifd34y3sd9j3hw08d2ry22wphl9cp-user-environment.drv’ failed with exit code 1
error: build of ‘/nix/store/7ryifd34y3sd9j3hw08d2ry22wphl9cp-user-environment.drv’ failed

I was trying to uninstall, because this is what happened for all nix-env operations (apart from -q)

@mtnygard
Copy link

mtnygard commented Mar 1, 2018

Happening to me on install.

mtnygard@spark:~$ curl https://nixos.org/nix/install | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2455 100 2455 0 0 2468 0 --:--:-- --:--:-- --:--:-- 2467
downloading Nix 2.0 binary tarball for x86_64-linux from 'https://nixos.org/releases/nix/nix-2.0/nix-2.0-x86_64-linux.tar.bz2' to '/tmp/nix-binary-tarball-unpack.LNMpYUzPSi'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 21.0M 100 21.0M 0 0 2531k 0 0:00:08 0:00:08 --:--:-- 3333k
performing a single-user installation of Nix...
copying Nix to /nix/store...............................
initialising Nix database...
installing 'nix-2.0'
building '/nix/store/ni5hj5bcgqlfpvlyl283jj0x9jmiy5kk-user-environment.drv'...
killing process 555: No such process
builder for '/nix/store/ni5hj5bcgqlfpvlyl283jj0x9jmiy5kk-user-environment.drv' failed to produce output path '/nix/
store/dpb950wkkkf125azmbv7cnxl82yi8kw1-user-environment'
error: build of '/nix/store/ni5hj5bcgqlfpvlyl283jj0x9jmiy5kk-user-environment.drv' failed
/tmp/nix-binary-tarball-unpack.LNMpYUzPSi/unpack/nix-2.0-x86_64-linux/install: unable to install Nix into your default profile

@nyarly
Copy link
Author

nyarly commented Mar 8, 2018

FWIW I think this is a different issue.

@garry-cairns
Copy link

I'm seeing something similar on NixOS 18.03. Any installation fails with a similar error message:

~$ nix-env -iA nixos.python36Packages.pip
warning: name collision in input Nix expressions, skipping '/home/garry/.nix-defexpr/channels_root/nixos'
installing 'python3.6-pip-9.0.1'
building '/nix/store/fgv5jdd64qy4nlk8wfcp3lw0mkk5kmyg-user-environment.drv'...
error: getting status of '/nix/store/1cmq5nwr6gp51jp1bsq647sqcb3dc3zy-python3-3.5.3/bin/pip': No such file or directory
builder for '/nix/store/fgv5jdd64qy4nlk8wfcp3lw0mkk5kmyg-user-environment.drv' failed with exit code 1
error: build of '/nix/store/fgv5jdd64qy4nlk8wfcp3lw0mkk5kmyg-user-environment.drv' failed

@nyarly
Copy link
Author

nyarly commented Mar 21, 2018

@garry-cairns That looks like the problem I have.

@edolstra I hate to pester, but this seems like a serious problem. I'm willing to try to debug it in my env, but I have no idea how to proceed.

@garry-cairns
Copy link

@nyarly so I've rolled back to 17.09 and now everything works as expected, so this looks like and 18.03 regression at my end. I'm also happy to help debug but will need pointed in the right direction.

@nyarly
Copy link
Author

nyarly commented Mar 21, 2018

I'm on 17.09, and when I tried to install Nix 2 on it, I had this problem. I wound up having to call Nix 1.12 by absolute path to uninstall 2.

I don't know why the builder would fail, or how to get more output.

@edolstra
Copy link
Member

I can't reproduce this.

@nyarly
Copy link
Author

nyarly commented Mar 21, 2018

Can you help us figure out what the cause is and produce a reproduction case?

@nyarly
Copy link
Author

nyarly commented Mar 26, 2018

After conversation with ottdimes on IRC, it became clear what the problem was: because I'm on NixOS and had done a regular user install of Nix 2, I had a 1.11 nix daemon and a 2.0 client and the two aren't compatible.

I'm happy to consider this closed, unless "Nix 2 should error when contacting a 1.11 daemon" is a desired feature.

@danbst
Copy link
Contributor

danbst commented Mar 30, 2018

I have similar issue

$ nix-env -iA nixpkgs.firefox-esr
installing 'firefox-52.7.2esr'
building '/nix/store/07x61xwd8sfrwnmp31kx1mvpg4hclv30-user-environment.drv'...
error: getting status of '/nix/store/fcb728520x2y7h8312wzgpy4dpil75f2-firefox-52.7.2esr/share/icons/hicolor/128x128/apps/firefox.png': No such file or directory
builder for '/nix/store/07x61xwd8sfrwnmp31kx1mvpg4hclv30-user-environment.drv' failed with exit code 1
error: build of '/nix/store/07x61xwd8sfrwnmp31kx1mvpg4hclv30-user-environment.drv' failed

The file /nix/store/fcb728520x2y7h8312wzgpy4dpil75f2-firefox-52.7.2esr/share/icons/hicolor/128x128/apps/firefox.png does indeed exist, but is a symlink

$ ls -l /nix/store/fcb728520x2y7h8312wzgpy4dpil75f2-firefox-52.7.2esr/share/icons/hicolor/128x128/apps/firefox.png
lrwxrwxrwx 1 root root 131 Jan  1  1970 /nix/store/fcb728520x2y7h8312wzgpy4dpil75f2-firefox-52.7.2esr/share/icons/hicolor/128x128/apps/firefox.png -> /nix/store/0s130yfbavgvwi7xic1w47zsyxm0qq2y-firefox-esr-unwrapped-52.7.2esr/lib/firefox/browser/chrome/icons/default/default128.png

I have nix-daemon ExecStart=@/nix/store/wk8dbysmpr835a4fqiqidxgsgbfscbvl-nix-2.0pre5889_c287d731/bin/nix-daemon
and nix

$ readlink $(which nix-env)
/nix/store/wk8dbysmpr835a4fqiqidxgsgbfscbvl-nix-2.0pre5889_c287d731/bin/nix-env

So, both are same, but issue still there.


I was able to install package into new profile:

$ nix-env -iA nixpkgs.firefox-esr -p firefox
installing 'firefox-52.7.2esr'
building '/nix/store/w1m020gg9y74abmqvx5v459n5m946i3c-user-environment.drv'...
created 8 symlinks in user environment

So this should be some kind of corruption of my current profile. @edolstra How can I debug, what's wrong with my profile?

@edolstra
Copy link
Member

No idea. Maybe there is some kind of sandbox issue that prevents paths from showing up in the userenv build environment?

@danbst
Copy link
Contributor

danbst commented Mar 30, 2018

I found this have to do something with my manifest.nix. When I create a directory and copy manifest there, then that dummy profile shows same error when installing firefox-esr.

I found, that not all files in ~/.nix-profile/share/icons/hicolor/*/*/* are symlinks, which is strange!

$ ls -ld ~/.nix-profile/share/icons/*/*/*/* | grep -v -- '->'
-r--r--r-- 2 root root 3074 Jan  1  1970 /home/danbst/.nix-profile/share/icons/hicolor/symbolic/apps/mpv-symbolic.svg

And, most /strange/, removing that package (MPV) makes new regular files out of symlinks!

$ nix-env -e mpv
uninstalling 'mpv-0.26.0'
building '/nix/store/64mgpkbfdg10y9hx08szs6qkhiyvbkzl-user-environment.drv'...
created 3136 symlinks in user environment

$ ls -ld ~/.nix-profile/share/icons/*/*/*/* | grep -v -- '->'
-r--r--r-- 2 root root  3653 Jan  1  1970 /home/danbst/.nix-profile/share/icons/hicolor/64x64/apps/google-chrome.png
-r--r--r-- 1 root root 22410 Jan  1  1970 /home/danbst/.nix-profile/share/icons/hicolor/scalable/apps/tigervnc.svg

So, I've tried to remove packages that create such non-symlinks. I found a subset of packages, which I have to remove for Firefox install to work. All of these did create non-symlinks (but not only those):

$ nix-env --set /nix/var/nix/profiles/per-user/danbst/profile-122-link

$ nix-env -iA nixpkgs.firefox-esr
installing 'firefox-52.7.2esr'
building '/nix/store/8klhvd9b3rr9ijw2pas3yvhdknjbi01i-user-environment.drv'...
error: getting status of '/nix/store/j8p0vv89k1pf0cn7kmfsdcs7bshwga1i-firefox-52.7.2esr/share/icons/hicolor/48x48/apps/firefox.png': No such file or directory
builder for '/nix/store/8klhvd9b3rr9ijw2pas3yvhdknjbi01i-user-environment.drv' failed with exit code 1
error: build of '/nix/store/8klhvd9b3rr9ijw2pas3yvhdknjbi01i-user-environment.drv' failed

$ nix-env -e tigervnc zoom-us gimp google-chrome vlc mpv supertuxkart
uninstalling 'tigervnc-1.8.0pre20170419'
uninstalling 'zoom-us-2.0.106600.0904'
uninstalling 'gimp-2.8.22'
uninstalling 'google-chrome-62.0.3202.94'
uninstalling 'vlc-2.2.6'
uninstalling 'mpv-0.26.0'
uninstalling 'supertuxkart-0.9.2'

$ nix-env -iA nixpkgs.firefox-esr
installing 'firefox-52.7.2esr'

$

It isn't a problem with one of these packages, but a combination. @edolstra Can this be used for further debugging?

@shlevy shlevy added the backlog label Apr 1, 2018
@shlevy shlevy self-assigned this Apr 1, 2018
@garry-cairns
Copy link

@danbst thanks — your commentary got me the workaround I needed. After I uninstalled python3-3.5.3, which was the only thing I had installed that was referenced in the error message I saw, my problem went away.

@edolstra
Copy link
Member

edolstra commented Apr 5, 2018

And, most /strange/, removing that package (MPV) makes new regular files out of symlinks!

That's probably just because one of the parent directories is symlinked. If only one installed package provides a directory (e.g. share/icons), then the user environment builder will create a single symlink to that directory, rather than to all files in that directory.

edolstra added a commit that referenced this issue Apr 5, 2018
Fixes

  error: getting status of '/nix/store/j8p0vv89k1pf0cn7kmfsdcs7bshwga1i-firefox-52.7.2esr/share/icons/hicolor/48x48/apps/firefox.png': No such file or directory

#1934

Also improve error message on directory/non-directory collisions.
@danbst
Copy link
Contributor

danbst commented Apr 6, 2018

❤️

mightybyte pushed a commit to mightybyte/nix that referenced this issue Apr 8, 2018
Fixes NixOS#1934 (at least the "error:
opening directory '/nix/store/...-linux-config-4.4.14': Not a
directory" issue).
mightybyte pushed a commit to mightybyte/nix that referenced this issue Apr 8, 2018
Fixes

  error: getting status of '/nix/store/j8p0vv89k1pf0cn7kmfsdcs7bshwga1i-firefox-52.7.2esr/share/icons/hicolor/48x48/apps/firefox.png': No such file or directory

NixOS#1934

Also improve error message on directory/non-directory collisions.
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

6 participants