Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos.containerTarball images are created with trailing garbage, confusing tar --ignore-zeros (e. g. machinectl import-tar) #187816

Closed
intelfx opened this issue Aug 22, 2022 · 0 comments · Fixed by #187817
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Comments

@intelfx
Copy link
Contributor

intelfx commented Aug 22, 2022

Describe the bug

nixos.containerTarball.x86_64-linux images produce errors when extracted with tar --ignore-zeros (as systemd-importd does, cf. systemd/systemd@e4ec782).

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to https://hydra.nixos.org/build/188075138 (which is the last nixos.containerTarball.x86_64-linux build at the time of reporting)
  2. Click on the link to download nixos-system-x86_64-linux.tar.xz
  3. Download the tarball, verify SHA-256 (which is a5cb7e645c6d282ae917730800d834dbd0934ceee17d8799a12b81dbdfe82907 at the time of reporting)
  4. Attempt to extract the tarball with GNU tar using a tar -x --ignore-zeros or a variation thereof, OR run machinectl import-tar
  5. Observe a non-zero tar exit code

Expected behavior

The tarball is expected to extract cleanly.

Example output

$ curl -fLOJ 'https://hydra.nixos.org/build/188075138/download/1/nixos-system-x86_64-linux.tar.xz'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  111M  100  111M    0     0  6264k      0  0:00:18  0:00:18 --:--:-- 7059k

$ sha256sum nixos-system-x86_64-linux.tar.xz
a5cb7e645c6d282ae917730800d834dbd0934ceee17d8799a12b81dbdfe82907  nixos-system-x86_64-linux.tar.xz

$ btrfs sub create out
Create subvolume './out'

# tar -xaf nixos-system-x86_64-linux.tar.xz --ignore-zeros -C out; echo $?
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
2

Additional context

Notify maintainers

N/A, hydra job page does not list maintainers

Metadata

N/A, not on a Nix system

@intelfx intelfx added the 0.kind: bug Something is broken label Aug 22, 2022
intelfx added a commit to intelfx/nixpkgs that referenced this issue Aug 22, 2022
Pass `-t` to pixz to prevent it from appending an index to the end of
the uncompressed stream, confusing tools such as `machinectl import-tar`.

Fixes: NixOS#187816
@veprbl veprbl added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants