'Graceful' fallback when one or more substituters fail #1061

Closed
opened 2025-12-02 13:16:24 +00:00 by cyrneko · 5 comments

Yes, nix/lix entirely fails if one or more subsituters isn't reachable. This was fixed upstream in cppnix with this PR: https://github.com/nixos/nix/pull/13301

Describe the solution you'd like

A fallback to other substituters, or just plain copying upstream's solution would be nice.

Describe alternatives you've considered

uh, switching back to cppnix?????? /hj

Additional context

N/A

## Is your feature request related to a problem? Please describe. Yes, nix/lix entirely fails if one or more subsituters isn't reachable. This was fixed upstream in cppnix with this PR: https://github.com/nixos/nix/pull/13301 ## Describe the solution you'd like A fallback to other substituters, or just plain copying upstream's solution would be nice. ## Describe alternatives you've considered uh, switching back to cppnix?????? /hj ## Additional context N/A
Owner

@cyrneko do you have a reproducer? I closed a similar issue recently because I was unable to reproduce this issue on modern Lix.

@cyrneko do you have a reproducer? I closed a similar issue recently because I was unable to reproduce this issue on modern Lix.
Author

I can give https://git.vulpecula.zone/tasiaiso/nixos-config, where it happens when cache.vulpecula.zone is down

I can give https://git.vulpecula.zone/tasiaiso/nixos-config, where it happens when `cache.vulpecula.zone` is down
raito added this to the 2.95 milestone 2025-12-05 01:15:53 +00:00
Owner

Reproducer (courtesy of @pennae)

$ NIX_REMOTE=/tmp/store nix-build --no-link --builders '' -E 'with import <nixpkgs> {}; runCommand "foo" {} "touch $out"'
$ NIX_REMOTE=/tmp/store nix copy [INSERT THE DRV YOU JUST GOT] --to 'file:///tmp/sub?compression=none' --no-check-sigs
$ NIX_REMOTE=/tmp/store nix-collect-garbage
$ truncate -s0 /tmp/sub/nar/*.nar                                                   
$ NIX_REMOTE=/tmp/store nix-build --builders '' --no-link -E 'with import <nixpkgs> {}; runCommand "foo" {} "touch $out"' --substituters 'file:///tmp/sub https://cache.nixos.org' --no-require-sigs
Reproducer (courtesy of @pennae) ``` $ NIX_REMOTE=/tmp/store nix-build --no-link --builders '' -E 'with import <nixpkgs> {}; runCommand "foo" {} "touch $out"' $ NIX_REMOTE=/tmp/store nix copy [INSERT THE DRV YOU JUST GOT] --to 'file:///tmp/sub?compression=none' --no-check-sigs $ NIX_REMOTE=/tmp/store nix-collect-garbage $ truncate -s0 /tmp/sub/nar/*.nar $ NIX_REMOTE=/tmp/store nix-build --builders '' --no-link -E 'with import <nixpkgs> {}; runCommand "foo" {} "touch $out"' --substituters 'file:///tmp/sub https://cache.nixos.org' --no-require-sigs ```
Owner

much better reproducer:

export NIX_REMOTE=/tmp/store

rm -rf /tmp/sub
nix copy nixpkgs#bat --to 'file:///tmp/sub?compression=none'
nix-collect-garbage
chmod -r /tmp/sub/*.narinfo
nix build nixpkgs#bat -v --no-link --substituters 'file:///tmp/sub https://cache.nixos.org' --no-require-sigs
much better reproducer: ``` export NIX_REMOTE=/tmp/store rm -rf /tmp/sub nix copy nixpkgs#bat --to 'file:///tmp/sub?compression=none' nix-collect-garbage chmod -r /tmp/sub/*.narinfo nix build nixpkgs#bat -v --no-link --substituters 'file:///tmp/sub https://cache.nixos.org' --no-require-sigs ```
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/5128 ("libstore: treat more substituter failures as recoverable")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/5128", "number": 5128, "kind": "commit message"}], "cl_meta": {"5128": {"change_title": "libstore: treat more substituter failures as recoverable"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/5128](https://gerrit.lix.systems/c/lix/+/5128) ("libstore: treat more substituter failures as recoverable")
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1061
No description provided.