[Nix#4533] Nix cached truncated files downloaded #140
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#140
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream-Issue: NixOS/nix#4533
Describe the bug
In cases of some network error or proxy server error, downloading is ended too early and gives a truncated file. But the truncated file is still cached by nix, leading to immediate
truncated gzip input
every next time without refetching.This issue happens because:
Content-Length
, which makescurl
not possible to validate the output length.curl
returns zero but gives truncated file.curl
returns zero, but before extracting. It results in cached truncated files.Steps To Reproduce
nix-build -A osu-lazer https://github.com/r-ryantm/nixpkgs/archive/cc77f910fc1a06b7cb7eb43639c5904540483c70.tar.gz
or with other github archive URL.nix
will fail withtruncated gzip input
truncated gzip input
again without network access.Expected behavior
Nix caches the downloaded file only if it can be unpacked successfully.
So it can re-download the file and re-build in the next time.
nix-env --version
outputnix-env (Nix) 2.4pre20201205_a5d85d0