Skip to content

fix(al2023): prevent truncated /etc/eks/pause.tar in AMIs - #2858

Merged
lawraa merged 3 commits into
awslabs:mainfrom
lawraa:fix-truncated-pause-tar
Oct 19, 2026
Merged

lawraa merged 3 commits into
awslabs:mainfrom
lawraa:fix-truncated-pause-tar

Conversation

@lawraa

@lawraa lawraa commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available: Fixes #2855

Description of changes:
Root Cause: cache-pause-container exports the pause image with ctr image export, which by default goes through containerd's Transfer API. In containerd 2.x the client writes the streamed archive from a goroutine that Transfer() does not wait for (ImageExportStream.MarshalAny in core/transfer/archive/exporter.go), so ctr can exit 0 before the file is fully written. This is what produced the truncated /etc/eks/pause.tar in nvidia v20261003: the file in that AMI is byte-for-byte the first 323,584 bytes of a healthy archive.

This PR (AL2023):

  1. Exports with ctr image export --local, which builds the archive in-process and returns only after the last write.
  2. Adds a check in validate.sh that fails the build if /etc/eks/pause.tar is missing, unreadable, missing its last entry (oci-layout), or not a whole number of 512-byte blocks (for truncation inside end marker).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

  • Reproduced the race on containerd 2.2.7 (5,000 exports under CPU load): 182/5,000 outputs were truncated (all exit 0, all clean prefixes of a healthy file, 22 of them still passing tar tf check)
  • With --local 0/5,000. Output is byte-identical to the current archive
  • Tested validate.sh check against truncated pause.tar (every 512-byte boundary and every byte of the last 4 KiB) and real race truncations, all truncated archives that break the import are blocked by the check; all healthy archives pass the check.
  • Built an AL2023 1.35 AMI ; validate.sh reported the archive valid; import /etc/eks/pause.tar succeeds during boot

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

@lawraa
lawraa requested a review from a team as a code owner October 15, 2026 16:24
################################

# prevent truncated archive of /etc/eks/pause.tar
PAUSE_ARCHIVE=/etc/eks/pause.tar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to port this over to AL2027 provisioners as well. It uses the same flow for pause image.

Nit: I don't really think we need the last check (% 512). The way I understand it, tar always writes in chunks of 512 bytes. So a cut between entries would also be a multiple of 512?

@lawraa lawraa Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder. Ported to AL2027 in 599cce0.

On % 512, a cut between entries is multiples of 512 but the tar data isn't written in 512-byte chunks (during test, I saw race truncations at 318,108 and 324,056 bytes). tar tf catches cuts inside an entry like those, but not a cut part-way through the trailing end marker: that passes tar tf but fails ctr images import. I only reproduced that last case with synthetic cuts.

@kummatty

Copy link
Copy Markdown
Contributor

/ci

@github-actions

Copy link
Copy Markdown
Contributor

@kummatty roger that! I've dispatched a workflow. 👍

@lawraa
lawraa merged commit c6e62cc into awslabs:main Oct 19, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@kummatty the workflow that you requested has completed. 🎉

AMI variantBuildTest
1.31 / al2023success ✅success ✅
1.32 / al2023success ✅success ✅
1.33 / al2023success ✅success ✅
1.34 / al2023success ✅success ✅
1.35 / al2023success ✅success ✅
1.36 / al2023success ✅success ✅
1.37 / al2023success ✅success ✅

catinspace-au added a commit to hyperi-io/dfe-infra that referenced this pull request Oct 25, 2026
v20261023 is still a GitHub prerelease, and the node-image release gates skip prereleases. v20261019 (2026-10-21) is the newest full release: it prevents a truncated /etc/eks/pause.tar (awslabs/amazon-eks-ami#2858) on the same kernels as v20261012. The node-pools goldens follow on the alias line only.
catinspace-au added a commit to hyperi-io/dfe-infra that referenced this pull request Oct 25, 2026
* fix: cut the 2.2.1-rc.22 stack with engine v1.22.74, culvert v2.1.28 and dfe-hyperdx v0.3.17

dfe-stack cut clones rc.21 and moves current to rc.22. dfe-engine v1.22.74 rebuilds on the python:3.14-slim 35caba8 and uv d8e7328 base image digests (#985). culvert v2.1.28 moves to watchtower v1.23.2 (#103). dfe-hyperdx v0.3.17 moves to Node.js v24.22.1 (#173) and still carries upstream HyperDX 2.41.0. The cut also records dfe-docker at 86963503, its main. Every image and thin chart is digest-pinned, amd64 and arm64.

* fix: pin rc.22's dfe-ui v1.7.33 and clear the held Renovate rows

dfe-ui v1.7.33 rebuilds on the node base image digest 43b9ba1 (#606).

The Redpanda operator moves to 26.2.5, built on Go 1.26.10 for the eMudhra CA rejection and defaulting to broker v26.2.6, the one DFE runs. Its NodePool image change does not reach DFE, whose Redpanda CR renders no NodePool. The Karpenter AL2023 alias moves to v20261023, which adds CAs to the AL2023 blocklist, with the node-pools goldens following. The forgejo setup Job's curl 8.23.0 moves to its 2026-10-20 re-push digest, and the aws and aws-state locks move to hashicorp/aws 6.70.0 and redpanda-data/redpanda 2.6.0 within their existing constraints.

* fix: match the engine contract fixture to the v1.22.74 chart

The published 1.22.74 chart's contract names the python:3.14-slim 35caba8 base image.

* fix: hold rc.22's Karpenter AL2023 alias at v20261019

v20261023 is still a GitHub prerelease, and the node-image release gates skip prereleases. v20261019 (2026-10-21) is the newest full release: it prevents a truncated /etc/eks/pause.tar (awslabs/amazon-eks-ami#2858) on the same kernels as v20261012. The node-pools goldens follow on the alias line only.
@lawraa
lawraa deleted the fix-truncated-pause-tar branch November 11, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(nvidia): truncated /etc/eks/pause.tar in v20261003 breaks nodes using FastImagePull

2 participants