nix
nix copied to clipboard
Curl error when fetching file using http2
Describe the bug
Fetching a tarball from a URL prints several warning: error: messages
Steps To Reproduce
- Copy this flake:
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
archive.url = "https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz";
archive.type = "file";
archive.flake = false;
};
outputs = { self, nixpkgs }: {
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
};
}
- Run
nix flake update - See it fetching everything fine
- Run
nix flake update - Prints:
warning: error: unable to download 'https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz': HTTP error 200 (curl error: Failure when receiving data from the peer); retrying in 262 ms
warning: error: unable to download 'https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz': HTTP error 200 (curl error: Failure when receiving data from the peer); retrying in 518 ms
warning: error: unable to download 'https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz': HTTP error 200 (curl error: Failure when receiving data from the peer); retrying in 1409 ms
warning: error: unable to download 'https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz': HTTP error 200 (curl error: Failure when receiving data from the peer); retrying in 2367 ms
warning: error: unable to download 'https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz': HTTP error 200 (curl error: Failure when receiving data from the peer); using cached version
Expected behavior
The command to execute without warning or error.
nix-env --version output
nix-env (Nix) 2.18.5
Additional context
Adding --option http2 false works around the issue but:
- nix-direnv only passes it to
nix print-dev-env nix flake archivesilently ignores it anyways becauseignoring the client-specified setting 'http2', because it is a restricted setting and you are not a trusted user
Running with nix flake update --debug -v shows the following lines right before the warning: error::
curl: Failure writing output to destination, passed 60 returned 0
curl: process_pending_input: nghttp2_session_mem_recv() returned -902:The user callback function failed
curl: Connection #4 to host developer.arm.com left intact
finished download of 'https://developer.arm.com/-/cdn-downloads/permalink/Fixed-Virtual-Platforms/FM-11.26/FVP_Base_RevC-2xAEMvA_11.26_11_Linux64.tgz'; curl status = 56, HTTP status = 200, body = 0 bytes
Priorities
Add :+1: to issues you find important.
+1 for this.
It makes sense to just check out the branch actually needed and without all the history. This can reduce the cloning time enormously for large repositories with a lot of history.
This seem like it would be a fairly simple change with something like this added to the git invoke:
--branch <rev> --single-branch --depth 1
Ran into this exact issue here: https://github.com/python-poetry/poetry/issues/2094#issuecomment-1203314891
I had a similar issue when a branch used submodules and the other not, and the non-default would have been the preferred one: #9612