1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00
nix/src/libstore
Philip Wilk aef431fbd1
bugfix/3514: do not throw on substituter errors if other substituters are still enabled (#13301)
## Motivation

Nix currently hard fails if a substituter is inaccessible, even when they are other substituters available, unless `fallback = true`. 
This breaks nix build, run, shell et al entirely. 
This would modify the default behaviour so that nix would actually use the other available substituters and not hard error.

Here is an example before vs after when using dotenv where I have manually stopped my own cache to trigger this issue, before and after the patch. The initial error is really frustrating because there is other caches available.
![image](https://github.com/user-attachments/assets/b4aec474-52d1-497d-b4e8-6f5737d6acc7)
![image](https://github.com/user-attachments/assets/ee91fcd4-4a1a-4c33-bf88-3aee67ad3cc9)

## Context

https://github.com/NixOS/nix/issues/3514#issuecomment-2905056198 is the earliest issue I could find, but there are many duplicates.

There is an initial PR at https://github.com/NixOS/nix/pull/7188, but this appears to have been abandoned - over 2 years with no activity, then a no comment review in jan. There was a subsequent PR at https://github.com/NixOS/nix/pull/8983 but this was closed without merge - over a year without activity.
<!-- Non-trivial change: Briefly outline the implementation strategy. -->
I have visualised the current and proposed flows. I believe my logic flows line up with what is suggested in https://github.com/NixOS/nix/pull/7188#issuecomment-1375652870 but correct me if I am wrong.
Current behaviour:
![current](https://github.com/user-attachments/assets/d9501b34-274c-4eb3-88c3-9021a482e364)
Proposed behaviour:
![proposed](https://github.com/user-attachments/assets/8236e4f4-21ef-45d7-87e1-6c8d416e8c1c)

[Charts in lucid](https://lucid.app/lucidchart/1b51b08d-6c4f-40e0-bf54-480df322cccf/view)
<!-- Invasive change: Discuss alternative designs or approaches you considered. -->

Possible issues to think about:
- I could not figure out where the curl error is created... I can't figure out how to swallow it and turn it into a warn or better yet, a debug log.
- Unfortunately, in contrast with the previous point, I'm not sure how verbose we want to warns/traces to be - personally I think that the warn that a substituter has been disabled (when it happens) is sufficient, and that the next one is being used, but this is personal preference.
2025-09-12 17:29:34 -04:00
..
build bugfix/3514: do not throw on substituter errors if other substituters are still enabled (#13301) 2025-09-12 17:29:34 -04:00
builtins lib{store,fetchers}: Pass URLs specified directly verbatim to FileTransferRequest 2025-09-01 02:22:23 +03:00
include/nix/store hashmaps with string keys: add transparent lookups 2025-09-10 23:04:44 +02:00
linux Merge pull request #13490 from Mic92/clang-tidy-simple-warnings 2025-08-11 18:21:46 +02:00
pch libstore: Speed up builds by using precompiled headers 2025-07-20 22:01:53 +03:00
unix Merge pull request #13906 from obsidiansystems/derivation-builder-simpler 2025-09-10 09:58:07 +02:00
windows meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
.version Build nix-store with Meson 2024-06-14 10:25:14 -04:00
binary-cache-store.cc Reduce false sharing between pathInfoCache and Store 2025-09-07 14:27:38 +02:00
build-result.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
ca-specific-schema.sql Rename to "content-address*ing* derivation" 2025-02-10 01:12:56 -05:00
common-protocol.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
common-ssh-store-config.cc Add user@address:port support 2025-08-06 23:48:14 +03:00
content-address.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
daemon.cc Remove WorkerProto::Op::ImportPaths 2025-09-09 15:41:17 +02:00
derivation-options.cc Simplify handling of statuses for build errors 2025-08-27 20:05:06 -04:00
derivations.cc replace more std::unordered_* types by faster boost hash maps 2025-09-10 23:04:44 +02:00
derived-path-map.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
derived-path.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
downstream-placeholder.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
dummy-store.cc Rewrite StoreConfig::getUri in terms of new StoreConfig::getReference 2025-08-13 19:06:59 -04:00
dummy-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
export-import.cc Move exportPaths() / importPaths() out of the Store class 2025-09-10 14:22:46 +02:00
filetransfer.cc lib{store,fetchers}: Pass URLs specified directly verbatim to FileTransferRequest 2025-09-01 02:22:23 +03:00
gc.cc hashmaps with string keys: add transparent lookups 2025-09-10 23:04:44 +02:00
globals.cc Make Settings::sandboxPaths well-typed 2025-08-20 16:24:37 -04:00
http-binary-cache-store.cc Fix ParsedURL handling of %2F in URL paths 2025-08-28 22:20:04 +03:00
http-binary-cache-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
indirect-root-store.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
keys.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
legacy-ssh-store.cc Remove support for serve protocol < 5 2025-09-10 10:57:15 +02:00
legacy-ssh-store.md Add user@address:port support 2025-08-06 23:48:14 +03:00
local-binary-cache-store.cc Rewrite StoreConfig::getUri in terms of new StoreConfig::getReference 2025-08-13 19:06:59 -04:00
local-binary-cache-store.md Support per-store Markdown documentation 2023-03-21 14:03:40 +01:00
local-fs-store.cc No more globals.hh in headers 2025-08-20 16:24:37 -04:00
local-overlay-store.cc Rewrite StoreConfig::getUri in terms of new StoreConfig::getReference 2025-08-13 19:06:59 -04:00
local-overlay-store.md docs: Fix miscellaneous typos and formatting issues 2025-05-13 22:20:11 +00:00
local-store.cc Merge pull request #13932 from NixOS/move-pathInfoCache 2025-09-10 09:56:46 +02:00
local-store.md Build the local store on Windows 2024-05-10 13:05:23 -04:00
log-store.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
machines.cc Clean up Base* code 2025-08-06 11:51:44 -04:00
make-content-addressed.cc libutil: Move references.{hh,cc} to libstore 2025-08-08 10:30:09 +03:00
meson.build Revert "meson: add soversion to libraries (#13960)" 2025-09-12 20:43:34 +03:00
meson.options meson: Apply formatting universally 2025-08-07 02:58:29 +03:00
misc.cc replace more std::unordered_* types by faster boost hash maps 2025-09-10 23:04:44 +02:00
mounted-ssh-store.md MountedSSHStore: stores on shared filesystems 2023-11-21 13:34:01 -05:00
names.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
nar-accessor.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
nar-info-disk-cache.cc Bump the version of the SQLite caches 2025-08-20 20:44:58 +02:00
nar-info.cc Make a few more things use StoreDirConfig instead of Store 2025-08-15 15:35:51 -04:00
nix-meson-build-support rename: build-utils-meson -> nix-meson-build-support 2024-12-09 16:54:42 +01:00
optimise-store.cc libutil: Make HashResult a proper struct 2025-08-08 02:06:14 +03:00
outputs-spec.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
package.nix flake: Apply nixfmt 1.0.0 2025-08-18 20:29:45 +03:00
parsed-derivations.cc Deduplicate "export reference graph" logic a bit 2025-08-20 16:54:17 -04:00
path-info.cc Make a few more things use StoreDirConfig instead of Store 2025-08-15 15:35:51 -04:00
path-references.cc libstore: Remove unused overload of scanForReferences 2025-08-08 10:30:07 +03:00
path-with-outputs.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
path.cc Move some MixStoreDirMethods members to the right .cc file 2025-08-06 20:13:15 -04:00
pathlocks.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
posix-fs-canonicalise.cc Simplify handling of statuses for build errors 2025-08-27 20:05:06 -04:00
profiles.cc No more globals.hh in headers 2025-08-20 16:24:37 -04:00
realisation.cc Get rid of filterDrvOutputs 2025-08-14 00:09:08 -04:00
references.cc libutil: Move references.{hh,cc} to libstore 2025-08-08 10:30:09 +03:00
remote-fs-accessor.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
remote-store.cc Merge pull request #13951 from NixOS/drop-old-daemon-protocol 2025-09-10 10:43:48 +02:00
restricted-store.cc No more globals.hh in headers 2025-08-20 16:24:37 -04:00
s3-binary-cache-store.cc treewide: Remove getUri and replace with getHumanReadableURI where appropriate 2025-08-14 16:47:05 +03:00
s3-binary-cache-store.md fix location 2024-09-27 11:07:04 +02:00
s3.cc Fix ParsedURL handling of %2F in URL paths 2025-08-28 22:20:04 +03:00
schema.sql Build the local store on Windows 2024-05-10 13:05:23 -04:00
serve-protocol-connection.cc Remove support for serve protocol < 5 2025-09-10 10:57:15 +02:00
serve-protocol.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00
sqlite.cc SQLite: fsync db.sqlite-shm before opening the database 2025-08-26 00:42:18 +03:00
ssh-store.cc Rewrite StoreConfig::getUri in terms of new StoreConfig::getReference 2025-08-13 19:06:59 -04:00
ssh-store.md Add user@address:port support 2025-08-06 23:48:14 +03:00
ssh.cc Fix deadlock in SSHMaster::addCommonSSHOpts() 2025-09-03 17:49:24 +02:00
store-api.cc bugfix/3514: do not throw on substituter errors if other substituters are still enabled (#13301) 2025-09-12 17:29:34 -04:00
store-dir-config.cc Simplify "Store dir" superclass 2025-08-15 14:12:37 -04:00
store-reference.cc libstore: Reallow unbracketed IPv6 addresses in store references 2025-09-09 00:41:03 +03:00
store-registration.cc No more globals.hh in headers 2025-08-20 16:24:37 -04:00
uds-remote-store.cc libstore: Do not normalize daemon -> unix://, local -> local:// 2025-09-05 04:14:36 +03:00
uds-remote-store.md Enable the unix:// store on Windows 2024-04-18 16:58:32 -04:00
worker-protocol-connection.cc Remove WorkerProto::Op::ImportPaths 2025-09-09 15:41:17 +02:00
worker-protocol.cc Apply clang-format universally. 2025-07-18 12:47:27 -04:00