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

Jeffrey David Johnson jefdaj at gmail.com
Tue Sep 1 21:07:12 CEST 2015


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