Cache.nixos.org is unreachable

I’ve downloaded the latest image version 23.05 (23.05.533.c37ca420157-x86_64, to be exact)

i’m having issues installing NixOS from the installer (Calamares GUI), i’ve read the logs and it clearly states that it cannot reach cache.nixos.org/nix-cache-info if i’m not mistaken

but tried to reach that URL thru the browser on that same time and it just works and i get the 3 Line file that is located there! but the installer somehow fails to do so

Also i’ve tried other websites and they are working in order to be sure that the network config is allright

hint: I’m located in Iran, maybe that’s the problem? (e.g sanctions etc…?), because i’ve installed NixOS earlier and it just worked perfectly! (22.11) but now it doesn’t

i think the problem should be about infrastructure

2 Likes

In case you didn’t see I replied here: Can't access cache.nixos.org from Iran · Issue #235987 · NixOS/nixpkgs · GitHub

It could very well be that Fastly started blocking Iran. You could try the Chinese NixOS cache mirror

1 Like

Must say I would find it very disappointing if Fastly stops access to nixos.org from sanctioned regimes. I understand that they can’t do business with them. But deciding to censor a publicly accessible website is just plain unfortunate

1 Like

This is what you get when you delegate all your content distribution to a single company.

2 Likes

Note that it could also very well be that Iran ISP is blocking access to fastly. Sorry I don’t want to spread FUD before we can single out the root cause.

5 Likes

Well, I’m really glad that they’re providing the CDN for free. It would be quite expensive to get a similar service otherwise.

2 Likes

Of course :slight_smile: But you lose the right to complain about decisions. The most important fact is to be aware of that, and see if it complies your ethic and wallet :smiley:

unpacking channels...
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 265 ms
^Cerror: interrupted by the user

[nixos@nixos:~]$ sudo nix-channel --list
nixos https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixos-23.05
nixos-23.05 https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixos-23.05
nixpkgs https://mirrors.tuna.tsinghua.edu.cn/nix-channels/nixpkgs-unstable

[nixos@nixos:~]$

mirrors replaced, Nix still trying to fetch cache.nixos.org for some reason?

*edit: i’ve copied the outputs wrong, the upper message that says the operation interrupted is incorrect, i’ve fixed the URLs and updated channels successfully, it’s still trying to reach cache.nixos.org

1 Like

You should change the subsituters option. Not (only) the channel options. That configures the cache

1 Like

i’ve tried to change the file /etc/nix/nix.conf but it is read-only

so i’ve used sudo and removed the file and recreated it and modified, but it still throws error timed out on cache.nixos.org

dualstack.v2.shared.global.fastly.net is just a PTR record of cache.nixos.org from your GitHub issue. That doesn’t necessarily mean their A (ipv4) or AAAA (ipv6) record is the same. So It’s okay that you can ping one but not another. Try this instead: nc -vz cache.nixos.org 443

Sure, but the problem here isn’t about pinging the address, it’s that the address is inaccessible.

And the files corresponding the config files are read-only and i can’t change mirrors on live installation media

Delete the file (it’s a symlink to the nix store) and recreate the file with the content changed. That should allow you to configure system nix until the next NixOS rebuild

I did this, no difference, looks like it reads config from somewhere else

if i add --verbose 3 option to sudo nix-channel --update it will display error error: reading symbolic link '/nix/var/nix/profiles/per-user/root/channels/nixos-23.05': No such file or directory and exit immediately! but if i don’t use --verbose 3 it won’t display any error and continue!

why would an option specifying verbosity of output should have an effect on this?

Is this logical?

nixos@nixos:/etc/nix]$ sudo nix-channel --update --option substituters https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store
unpacking channels...
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 296 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': Timeout was reached (28); retrying in 643 ms
^Cerror: interrupted by the user


Is there any options to completely disable cache? what is the function of a cache server? does it store the binaries of libraries, or the source code of them? As long as i know sources are all on github/gitlab or similar services.

Because of there are no ways to disable this cache thing then i think what we get is a great distro that is just unusable to a whole country (in my case Iran). I wonder if these services are also sanctioned for countries like russia, venezuela, Iraq, Syria

The cache provides prebuilt binaries. I believe it’s possible to disable it, but then you’d need to compile everything on your PC.

I don’t know about other sanctioned countries, but the cache still works for me in Russia.