You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to install or build anything, it usually downloads a lot of packages, but some others time out on cache.nixos.org (only some of the mirrors seem to be down, so it's always different packages), and I have to retry the build a few times before it succeeds.
Okay, I gathered some more info:
cache.nixos.org resolves to (among others) server-54-240-184-235.ams50.r.cloudfront.net
Now, try curl -H 'Host: cache.nixos.org' http://54.240.184.235/nix-cache-info
a whole bunch of times in rapid succession, until an invocation takes multiple minutes to complete. (querying this server this rapidly is what nix does too, and it does eventually have downloads that take multiple minutes to complete).
I suspect cloudfront is doing throttling or firewalling.
Thought I'd add my 2 cents on cache download issue.
I've seen two types of network errors. One that leads to a hang when initiating many downloads with download-from-binary-cache.pl: I will paste the error message next time I get it.
The other leads to this error:
*** Downloading ‘http://cache.nixos.org/nar/0jlld4di2l1yygx6qnchv5kpvgar91lzqaiih57wh6n0vfwx7lc0.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/sl866aqxc10aa63pb1clvgxsrv8dywnw-hook’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 250 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 229 100 229 0 0 1523 0 --:--:-- --:--:-- --:--:-- 1523
/nix/store/skdijd3r067cbhh5dn6ya83cz33and2w-xz-5.2.2-bin/bin/xz: (stdin): File format not recognized
error: unexpected end-of-file
download of ‘http://cache.nixos.org/nar/0jlld4di2l1yygx6qnchv5kpvgar91lzqaiih57wh6n0vfwx7lc0.nar.xz’ failed: No such file or directory
Both are fixed by waiting and retrying.
They occur often enough that I get them about 3 times each on a nixos-rebuild that downloads the full OS.
Hang that I often get doing be nixos-rebuild build:
$ nixos-rebuild build
building Nix...
building the system configuration...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/ayihwm5jssbcawzwnll0p60p2xb46bzg.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/bkk6372sxn426b8lmjd46c8ji584j80i.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/8wc89sw7rb3fx5jvns4fhbpkyg4yq0a3.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/0zh45az50cqdlmk5npzrb25gnvq1di10.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/algs2c6nvrbsc4zsyd17q28sw0kvq537.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/bkb66y2qmvc3f9v03hi643inbh8cx6ga.narinfo’ after 5 seconds...
download-from-binary-cache.pl: still waiting for ‘http://cache.nixos.org/adc8zvk7cxw53l2nvp99dv1x35093yw2.narinfo’ after 5 seconds...
[… many more times…]
Sometimes it gets unstuck on its own, sometimes it doesn't.
Thanks for the tip for connect-timeout, I'm encountering this issue when attempting to rebuild many things at once... (things that aren't in the caches) and that options helps put an upper-bound on how long things wait. Playing with parallel connections (1,25,150) didn't seem to help but it did change how many times I saw the warning messages :).
I'm actually getting a lot of 404s, also for libssh2. Is this related to the S3 outage? Mabye builds during that period couldn't be uploaded to S3 but somehow their metadata (link to it) was still saved in the cache db? (not really sure how it works though)
@domenkozar I was on the newest nixos-unstable branch from nixpkgs-channels (when I'm home I can check for the specific commit), but I think it's that one, since it was the most current this morning (5 hours ago).
I did nix-env -i all -f ~/git/nixpkgs/all is a meta package in my ~/nixpkgs/config.nix. I'll try just installing ed when I'm home.
Hm, I can't really explain the 404. It could be a cached response from Cloudfront. However, BinaryCacheStore uploads the .nar.xzbefore the .narinfo, so I can't see how somebody could have requested that .nar.xz earlier. I can dig in the Cloudfront logs...
*** Downloading ‘https://cache.nixos.org/nar/19hi73szwgv062pnfg96gdb26sh4062qi9k3akq2adnnraf0bvr9.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/gvqyqdlcwfqldb99q6kzixm5786al1ka-ed-1.14.1’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 42952 100 42952 0 0 27736 0 0:00:01 0:00:01 --:--:-- 27728
@edolstra Can't you just do a handover of this service to someone else, since it seems clear that the people currently responsible for running cache.nixos.org are not capable of doing so?
Also, this code can be improved to use the upload method instead of PutObject. (See the documentation for upload for why.)
auto result = checkAws(format("AWS error uploading ‘%s’") % path,
s3Helper.client->PutObject(request));
I couldn't be bothered to look at what checkAws does, but if it merely checks (as opposed to asserts), then this method is not guaranteed to work, obviously. So, I would say that the problem is not as to "that it is weird that it doesn't work", but that you failed to show in your source code with any convincing argument that it should work in the first place. If checkAws does exit the process or abort in some way, then the name should be changed.
These one-issue-fits-all always end up the same way: no positive outcome.
Please, open a new issue if you think something can be fixed and please remember to describe exactly what's going on in your case. Pasting just that S3 retrieval failed is not enough, it could happen due to a few dozen reasons.
@butterflya pointing fingers and passive aggressive blaming won't help. It never did. Please calm down and unless you can:
suggest exactly and how the current situation can be fixed
pay someone to implement a fix
join the club and wait until we pin down these issues.
What an aggressive reaction from @butterflya! The binary cache is provided completely for free, despite costing real money and lots of work of the community, and outages/problems have seem to be relatively rare in the past few years. Besides, the reliability of upgrades is primarily meant in a slightly different way...
Activity
edolstra commentedon Apr 21, 2016
Sorry, but there is not much info here that would allow us to reproduce the problem. The report doesn't even include an error message...
yorickvP commentedon Apr 21, 2016
Okay, I gathered some more info:
cache.nixos.org resolves to (among others)
server-54-240-184-235.ams50.r.cloudfront.netNow, try
curl -H 'Host: cache.nixos.org' http://54.240.184.235/nix-cache-infoa whole bunch of times in rapid succession, until an invocation takes multiple minutes to complete. (querying this server this rapidly is what nix does too, and it does eventually have downloads that take multiple minutes to complete).
I suspect cloudfront is doing throttling or firewalling.
obadz commentedon Apr 22, 2016
Thought I'd add my 2 cents on cache download issue.
I've seen two types of network errors. One that leads to a hang when initiating many downloads with
download-from-binary-cache.pl: I will paste the error message next time I get it.The other leads to this error:
Both are fixed by waiting and retrying.
They occur often enough that I get them about 3 times each on a
nixos-rebuildthat downloads the full OS.Also see #9081
obadz commentedon Apr 25, 2016
Hang that I often get doing be
nixos-rebuild build:Sometimes it gets unstuck on its own, sometimes it doesn't.
boobiesinc commentedon May 17, 2016
This happens at the beginning with
nixos-installbut is ignored, I wonder if I'm missing something though:Which apparently means:
boobiesinc commentedon May 21, 2016
EDIT: looks like it's this: https://github.com/NixOS/nix/blob/4f3cf06c97cb1f15c74b51b60673a0ed9af0a603/scripts/download-from-binary-cache.pl.in#L461-L469
EDIT: looks like activeRequests shouldn't go past maxParallelRequests which is
binary-caches-parallel-connections = 3in my case, BUT sincenixPathsetting in myconfiguration.nixIS IGNORED which is why I have to pass it as an env. NIX_PATH, then I can safely deduce that this is also ignored and thus fallback to maxParallelRequests being 25 ... I guess I should add--optioninstead! So the bigger issue then is, why are some settings in/mnt/etc/nixos/configuration.nixignored!Why does it do that ?

It seems like it's trying to download EVERYTHING at once, instead of only 3 at a time, serially.
I have set
EDIT: sheet:

obadz commentedon May 21, 2016
nix-enving my user environment (which contains ~ 7GB) often crashes 5-10 times due to network issues.I now run it in a shell loop:
vcunat commentedon May 22, 2016
@boobiesinc: I believe
nixos-installruns with configuration specified for the system it runs on, not the one you're trying to install.yorickvP commentedon Sep 20, 2016
I'm not getting this problem anymore. @obadz, you? Otherwise, we can close this.
obadz commentedon Sep 20, 2016
As of last week I was still getting the error.
dtzWill commentedon Oct 12, 2016
Thanks for the tip for
connect-timeout, I'm encountering this issue when attempting to rebuild many things at once... (things that aren't in the caches) and that options helps put an upper-bound on how long things wait. Playing with parallel connections (1,25,150) didn't seem to help but it did change how many times I saw the warning messages :).cessationoftime commentedon Oct 22, 2016
I was unable to use the command:
nixos-rebuild build -I nixpkgs=/home/cvanvranken/nixpkgsuntil I added to nix.extraOptions in my /etc/nixos/configuration.nix
This also prevented me from doing a fresh installation of nixos 16.09. Had to copy my vm from an existing installation and edit.
14 remaining items
despairblue commentedon Mar 3, 2017
I'm actually getting a lot of 404s, also for libssh2. Is this related to the S3 outage? Mabye builds during that period couldn't be uploaded to S3 but somehow their metadata (link to it) was still saved in the cache db? (not really sure how it works though)
domenkozar commentedon Mar 3, 2017
@desiderius what channel are you on? What's the version of the channel? How are you installing ed?
despairblue commentedon Mar 3, 2017
@domenkozar I was on the newest nixos-unstable branch from nixpkgs-channels (when I'm home I can check for the specific commit), but I think it's that one, since it was the most current this morning (5 hours ago).
I did
nix-env -i all -f ~/git/nixpkgs/all is a meta package in my~/nixpkgs/config.nix. I'll try just installing ed when I'm home.vcunat commentedon Mar 3, 2017
nix-store --realize /nix/store/8xvkriqhp9f47y6kwciha4wsg1nqfq7p-ed-1.14.1succeeds for me (fetches from cache.nixos.org).edolstra commentedon Mar 3, 2017
Hm, I can't really explain the 404. It could be a cached response from Cloudfront. However, BinaryCacheStore uploads the
.nar.xzbefore the.narinfo, so I can't see how somebody could have requested that.nar.xzearlier. I can dig in the Cloudfront logs...despairblue commentedon Mar 4, 2017
I was on 45344fd. But now it works 😕
It also downloaded a different file:
butterflya commentedon Mar 7, 2017
@edolstra Can't you just do a handover of this service to someone else, since it seems clear that the people currently responsible for running
cache.nixos.orgare not capable of doing so?butterflya commentedon Mar 7, 2017
Also, this code can be improved to use the
uploadmethod instead ofPutObject. (See the documentation foruploadfor why.)I couldn't be bothered to look at what
checkAwsdoes, but if it merely checks (as opposed toasserts), then this method is not guaranteed to work, obviously. So, I would say that the problem is not as to "that it is weird that it doesn't work", but that you failed to show in your source code with any convincing argument that it should work in the first place. IfcheckAwsdoes exit the process or abort in some way, then the name should be changed.domenkozar commentedon Mar 7, 2017
@butterflya patches welcome :)
edolstra commentedon Mar 8, 2017
@butterflya You probably should have bothered to look at what
checkAwsdoes, because it throws an exception.And no, I'm not going to drop S3/Cloudfront because of an occasional 404.
butterflya commentedon Mar 8, 2017
domenkozar commentedon Mar 8, 2017
These one-issue-fits-all always end up the same way: no positive outcome.
Please, open a new issue if you think something can be fixed and please remember to describe exactly what's going on in your case. Pasting just that S3 retrieval failed is not enough, it could happen due to a few dozen reasons.
@butterflya pointing fingers and passive aggressive blaming won't help. It never did. Please calm down and unless you can:
join the club and wait until we pin down these issues.
Half of this thread is already resolved:
So we're working on it.
vcunat commentedon Mar 8, 2017
What an aggressive reaction from @butterflya! The binary cache is provided completely for free, despite costing real money and lots of work of the community, and outages/problems have seem to be relatively rare in the past few years. Besides, the reliability of upgrades is primarily meant in a slightly different way...