[Nix-dev] How to debug 'error: getting status of ... no such file or directory'?

Jeffrey David Johnson jefdaj at gmail.com
Wed Sep 2 20:16:29 CEST 2015


OK figured it out. I had an obsolete symlink
from /etc/nixos/configuration.nix into /git/hub/dotfiles, and
nixos-rebuild must have been evaluating my current code without
following it. Would be nice to have a more informative error message,
but then again maybe I deserved that for relocating everything! Fixed
by deleting /etc/nixos.
Jeff

On Tue, 1 Sep 2015 12:07:12 -0700
Jeffrey David Johnson <jefdaj at gmail.com> wrote:

> I have what seems like a straightforward issue with paths, but am not
> sure how to debug it. I run my usual "update everything" script, which
> looks like this and is located at /git/hub/nixcfg/install.sh:
> 
> #!/usr/bin/env bash
> # Automates rebuilding nixos from my repos.
> # Takes the same args as nixos-rebuild.
> # TODO also put NIXPKGS_CONFIG in here instead of home dir
> 
> NIXCFG="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
> [[ -z "$@" ]] && NIXARGS="test --fast" || NIXARGS="$@"
> 
> nixos-rebuild \
>   -I mypkgs="${NIXCFG}/mypkgs" \
>   -I nixpkgs="${NIXCFG}/nixpkgs" \
>   -I nixos-config="${NIXCFG}/configs/$(hostname).nix" \
>   ${NIXARGS} \
>   && nix-store --optimize
> 
> It works on my current master nixpkgs branch:
> 
> $ sudo ./install.sh switch
> building Nix...
> building the system configuration...
> warning: dumping very large path (> 256 MiB); this may run out of memory
> ...
> reloading the following units: dbus.service
> starting the following units: cron.service
> 862.90 MiB freed by hard-linking 37947 files
> 
> But when I switch to the new 15.09 branch I get an error:
> 
> $ sudo ./install.sh switch
> building Nix...
> error: getting status of ‘/git/hub/dotfiles’: No such file or directory
> building the system configuration...
> error: getting status of ‘/git/hub/dotfiles’: No such file or directory
> 
> There isn't a directory /git/hub/dotfiles, but I do
> use /git/hub/nixcfg/dotfiles and my code contains some relative
> references `like dotDir = ../dotfiles;`
> inside /git/hub/nixcfg/modules. So I assume that's going wrong. But
> after replacing them all with absolute paths I still get the same thing.
> 
> Now I'm not sure what to do next. `--show-trace` doesn't give any more
> info. How do I debug it? Thanks
> Jeff


More information about the nix-dev mailing list