404 from cache.nixos.org preventing rebuild on darwin

When I update any of my flake inputs, I am unable to rebuild/switch due to cache 404s:

error: unable to download 'https://cache.nixos.org/yd9prhidcy8fsm9j5aik1gbvmkc03drm.narinfo': HTTP error 404 ()

response body:

The hash of the 404 changes, depending on which input I try to update.

curl to the URL confirms the 404, and there are no other DNS/connection issues on my machine.

I ran this diagnostic script as suggested, and this is the output. It looks like there is no problem connecting to the cache in general terms.

I would be grateful for any ideas, this is currently blocking all upgrades for me.

hello the Problem seems to bee in your inputs:

nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

The repo is actually NixOS.
Maybe try this instead:

nixpkgs.url = "nixpkgs/nixos-unstable";

Thanks for the quick reply.

It looks like these are 2 different channels with access to nearly the same packages.

I think most darwin users would use the nixpkgs version. But in any event, changing it had no effect on the 404s.

That introduces a dependence on the registry which is strictly worse.

In any case the flake input isn’t the issue, if you can’t reach cache.nixos.org then either you have a network issue or Fastly’s CDN PoP is unreachable for you. It seems to be a problem particularly for users based in Asia. You can try the TUNA mirror as a workaround in that case.

Just to be clear, I can reach cache.nixos.org with a generic curl, I am just getting 404s for those specific narinfo files.

I tried setting nix.settings.substituters to the TUNA mirror, but nix-darwin still looks for the narinfo files at cache.nixos.org.

I also tried passing --option substituters with the URL of the TUNA mirror, but nix-darwin won’t allow it because my user isn’t trusted.

Passing --option substituter false fails due to a build failure on libthai-0.1.29, which is apparently somewhere in my dep tree.

EDIT: I temporarily used a trusted user to pass:

darwin-rebuild switch --flake ~/.config/nix-darwin --impure --option substituters https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store

and this gives the same 404s as cache.nixos.org, so it seems like the problem really is that my config is looking for hashes that aren’t present in the store. Any idea why that would be?

Ah, it looks like it’s this issue with Lix…

It’s supposedly fixed on main already, but I’m running nightly and still hitting it with 2.93.0-dev-pre20250121-9b29008.

1 Like

Ok, I was able to fix this by rolling back to Lix 2.91, which I had locally, and then using that to update to the latest Lix nightly, which has a fix for the issue above. Thanks @Postboote and @waffle8946 for taking the time to reply.

2 Likes

That’s incorrect. Use the nixpkgs-unstable branch for darwin. The nixos-unstable branch won’t wait for darwin packages to be built.

1 Like

BTW (i am one of the lix developers), if you have weird stuff happening on lix nightly, please ask about it in the lix-beta channel on matrix or file a bug report; it’s the most likely place it will be seen. We generally don’t monitor this forum and it can confuse people to see weird bugs that we had in tree for about 2-3 days total.

I’ve been trying my best to post in there about mistakes like this one that we’ve fixed, since not everyone is (or should need to be) paying attention to the change stream.

Other than watching that channel or if we hypothetically added an online update check (specifically for nightlies), it’s going to be hard to notify people about this kind of thing appropriately.

1 Like

Fair point about the bug tracker, but OP didn’t mention lix, we wouldn’t necessarily know it was a lix specific bug anyway. I assumed they were using nix and ended up searching on nix’s issue tracker instead.

But for other topics, is there an alternative communication channel for those who don’t want to maintain a matrix homeserver?

Apologies @jade , I had no idea this was a Lix bug at the time of posting.