Skip to content

'nix-channel --update' stopped working on nix-2.2.1: error: while setting up the build environment: getting attributes of path '': No such file or directory #2673

@trofi

Description

@trofi

The install is a nix install on Gentoo (not a NixOS).

$ nix-channel --update --verbose
downloading 'https://nixos.org/channels/nixpkgs-unstable'...
downloading 'https://releases.nixos.org/nixpkgs/nixpkgs-19.03pre168678.54dcb0b1376/binary-cache-url'...
unpacking channels...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
error: while setting up the build environment: getting attributes of path '': No such file or directory
error: program '/usr/bin/nix-env' failed with exit code 1

I tried strace-ing nix-env and running nix-daemon but I did not find where that '' path comes from. Can nix be improved to dump more information on where that path comes from?

Some version info:

$ nix --version
nix (Nix) 2.2.1
$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable

ottidmes on #nixos linked me to a thread about /bin/sh out of nix: https://logs.nix.samueldr.com/nixos/2019-02-06#1938291

Working workaround:

$ nix-build '<nixpkgs>' -A bash
$ sudo systemctl restart nix-daemon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions