Skip to content
This repository was archived by the owner on Aug 27, 2018. It is now read-only.
This repository was archived by the owner on Aug 27, 2018. It is now read-only.

"nix-collect-garbage -d" makes "nixos-rebuild switch" unusable when nixos.org is down #176

Open
@wizeman

Description

@wizeman

When nixos.org is down and "nix-collect-garbage -d" is used, "nixos-rebuild switch" will fail to work even when doing minor configuration changes such as removing a package from environment.systemPackages.

It seems that some packages/derivations are always needed even for minor configuration changes, however "nix-collect-garbage -d" will delete them, as they seem to not be registered as GC roots.

Even building from source will not work as some of the required sources live in nixos.org.
Specifically, in my case I wasn't being able to download the following source file:

"downloading /nix/store/a0agd0bl2f0wsdz9dgbnr00h1sqwq8fb-bootstrap-tools.cpio.bz2 from http://nixos.org/tarballs/stdenv-linux/x86_64/r23302/bootstrap-tools.cpio.bz2"

curl: (7) Failed to connect to 2001:610:685:1::1: Network is unreachable
builder for `/nix/store/ky1w7k0v62vp2yax30zwrci2ac34cfiy-bootstrap-tools.cpio.bz2.drv' failed with exit code 7
cannot build derivation `/nix/store/wn3rvdspafvdr1jx7hjsg2qr647cxq5w-bootstrap-tools.drv': 1 dependencies couldn't be built
cannot build derivation `/nix/store/5p9qsv7gzv6ynir2gclybfg258s858ck-patchelf-0.6.drv': 1 dependencies couldn't be built
cannot build derivation `/nix/store/1q8kzl60n04sq7fgzaad4cvqqml94jxq-stdenv.drv': 1 dependencies couldn't be built
cannot build derivation `/nix/store/871mm4avff9nq5rsm34xm2lxjpk74j4y-nixos-0.2pre-31065e8-537e3a8M.drv': 1 dependencies couldn't be built
error: build of `/nix/store/871mm4avff9nq5rsm34xm2lxjpk74j4y-nixos-0.2pre-31065e8-537e3a8M.drv' failed

I worked around this issue by adding the seemingly required packages to my environment.systemPackages.

In my case, I needed to add the following: "patchelf gnumake stdenv docbook_xsl_ns docbook5 libxslt", otherwise "nixos-rebuild switch" would always fail with being unable to download those binary packages.

If these are always required for minor configuration changes, it would be nice if they were registered as GC roots so that users wouldn't accidentally shoot themselves in the foot when nixos.org is down.

BTW, if you want to test this problem when nixos.org is up, you can simulate it is down by doing "route add -host nixos.org reject" and making sure you are not using a secondary binary cache.

Then you can do "nix-collect-garbage -d" and now try to make some configuration changes and then use "nixos-rebuild switch" to apply them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions