-
Notifications
You must be signed in to change notification settings - Fork 215
Description
When running the rechunker on the rhelai1/bootc-nvidia-rhel9:1.5.2 image, it fails due to too many links:
$ sudo ./target/debug/rpm-ostree experimental compose build-chunked-oci --bootc --from=registry.redhat.io/rhelai1/bootc-nvidia-rhel9:1.5.2 --output=containers-storage:localhost/rhelai-chunked --format-version=2
...
time="2025-09-02T10:53:42-04:00" level=fatal msg="writing blob: adding layer with blob \"sha256:2310bbd4ad94b60f60f21ece791c09114912c4b7f0b35e6de010e3af186bee31\"/\"\"/\"sha256:b1347579e08522fb06d6553728f02cc9a93d287bf47ea6d881633255e491f79b\": unpacking failed (error: exit status 1; output: too many links)"
So far, I've determined the cause is related to the xattrs links. This file sysroot/ostree/repo/objects/12/f1919b020c8e252f21a7bee1986e14a5bfa902e572e893d72e206f30461de3.file-xattrs has a ton of links to it.
This was tested on both a btrfs system and ext4.
Outputing the rechunked image to an oci directory works because it doesn't run through skopeo copy which unpacks the layer's tar file with too many links. This lets me reproduce the too many links error by trying to extract the problematic tar file from the rechunked oci directory:
$ sudo ./target/debug/rpm-ostree experimental compose build-chunked-oci --bootc --from=registry.redhat.io/rhelai1/bootc-nvidia-rhel9:1.5.2 --output=containers-storage:localhost/rhelai-chunked --format-version=2
# this is the rpmostree-unpackaged-content layer
$ tar -xf ./chunked/blobs/sha256/44b88d87b5a69f9884ad726b910cc5577819a05882bb39a765e41ae4b9105fed -C extract
tar: sysroot/ostree/repo/objects/d1/34928f289ddc130c362806f366f76387d5af6f9ef752f2180962373c500204.file-xattrs-link: Cannot hard link to ‘sysroot/ostree/repo/objects/12/f1919b020c8e252f21a7bee1986e14a5bfa902e572e893d72e206f30461de3.file-xattrs’: Too many links
This is the contents of *.file-xattrs:
cat ./file-xattrs/sysroot/ostree/repo/objects/12/f1919b020c8e252f21a7bee1986e14a5bfa902e572e893d72e206f30461de3.file-xattrs
security.selinuxsystem_u:object_r:lib_t:s0user.containers.override_stat0:0:0644-T%
Maybe we need to set a limit on hardlinks to an xattrs file and split it into multiple files? i.e.
file-xattr-A (10,000 links)
file-xattr-B (10,000 links)
where file-xattr-A and file-xattr-B are duplicates.