Skip to content

nixos-rebuild --fallback doesn't work #807

Closed as not planned
Closed as not planned

Description

@wizeman

It turns out I regularly run into issue #719 with my Hydra server.

Apparently, now nixos-rebuild switch --fallback doesn't even work as a workaround:

$ nixos-rebuild switch --fallback                                                     
building Nix...
building the system configuration...
fetching path ‘/nix/store/n2rhmzj3hy7b2gg1ba4dipsrqxrxwixy-rg-src’...

*** Downloading ‘http://homeserv:3000/nar/n2rhmzj3hy7b2gg1ba4dipsrqxrxwixy-rg-src’ to ‘/nix/store/n2rhmzj3hy7b2gg1ba4dipsrqxrxwixy-rg-src’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 410 Gone

bzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

error: unexpected end-of-file
download of ‘http://homeserv:3000/nar/n2rhmzj3hy7b2gg1ba4dipsrqxrxwixy-rg-src’ failed: No such file or directory
could not download ‘/nix/store/n2rhmzj3hy7b2gg1ba4dipsrqxrxwixy-rg-src’ from any binary cache
fetching path ‘/nix/store/n2rhmzj3hy7b2gg1ba4dipsrqxrxwixy-rg-src’ failed with exit code 1
error: some substitutes for the outputs of derivation ‘/nix/store/c7sm6c47l9s6aijimsnxnkl2sv0gk5jj-rg-src.drv’ failed (usually happens due to networking issues); try ‘-
-fallback’ to build derivation from source                                                                                                                             
(use ‘--show-trace’ to show detailed location information)

Activity

  1. wizeman commented on Apr 14, 2016

    @wizeman
    MemberAuthor

    I can confirm that if I use this command, I get the above failure:

    $ nixos-rebuild switch --fallback
    

    But if I use this command instead, it actually falls back and successfully builds the missing derivation locally:

    $ nixos-rebuild switch --option build-fallback true
    

    So I would guess that the error must be somewhere in the argument parser or the handover to nix-store?

  2. NotaseCretagen commented on Apr 27, 2016

    @NotaseCretagen

    man nixos-rebuild doesn't list --fallback EDIT: it is listed in man nix-env though.
    but it seems to be working for me.

    nix-build --version
    nix-build (Nix) 1.11.2
    
  3. wizeman commented on Apr 27, 2016

    @wizeman
    MemberAuthor

    @NotaseCretagen did you try --fallbackwhen nixos-rebuild told you to do so, or did you try it despite it didn't?

    Using --fallback doesn't stop nixos-rebuild from working, it's just that it doesn't seem to do anything (for me), even though that's what Nix tells me to do to solve the 410 Gone problem.

  4. NotaseCretagen commented on Apr 27, 2016

    @NotaseCretagen

    Both. But lately I was trying it despite.
    When it asked me to try it the first time, I remember it worked, or at least, it worked eventually (assuming it worked because I reran it after it failed - don't really remember, since nixos-rebuild keeps failing and on next run it works; EDIT: it usually fails apparently due to not being able to restart services, or something like that, but wtw it is, on next rerun of same command it just works!)

  5. wizeman commented on Mar 9, 2017

    @wizeman
    MemberAuthor

    I have ran into this issue again and I think it only happens when using import-from-derivation.

  6. stale commented on Feb 15, 2021

    @stale

    I marked this as stale due to inactivity. → More info

  7. stale commented on May 2, 2022

    @stale

    I closed this issue due to inactivity. → More info

  8. tomberek commented on Aug 13, 2026

    @tomberek
    Contributor

    Closing as stale. Re-open if needed.

  9. added a commit that references this issue on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions