Skip to content

A box whose build step runs podman fails with "Error determining cgroups mode" under the BuildKit drive's sandbox worker #991

Closed

Description

@aitrawog

What is broken

Building distro-cachyos's box/crabbox-e2e (the nesting composition: layer-container-nesting + the crabbox candies) fails in the BuildKit solve, at the container-nesting candy's build-time prepull:

#46 [stage-10 31/45] RUN --mount=type=bind,from=container-nesting,source=/,target=/ctx … sh <<'OVCMD'
#46 0.136 time="2026-10-20T12:56:29Z" level=fatal msg="Error determining cgroups mode"
#46 ERROR: process … "podman pull quay.io/libpod/alpine:latest" … did not complete successfully: exit code: 1

The step runs podman pull quay.io/libpod/alpine:latest INSIDE the build container. In the drive's BuildKit worker, podman cannot determine the cgroups mode, so the pull aborts and the whole charly box build crabbox-e2e fails — reproduced twice (check-crabbox-e2e-pod image-build: 1m28s, then 41.8s).

Mechanism

The buildkitdrive daemon is started with:

[worker.oci]
  process-mode = "sandbox"

— the measured, no-privilege posture (the drive's Ensure: "needs NO added capability … no --oci-worker-no-process-sandbox and no privilege escalation"). The rootless worker's sandbox has no cgroup access, so a podman process inside the build container exits with Error determining cgroups mode (libpod cannot resolve the cgroup manager for the sandbox).

A build step that needs to RUN a container engine at build time (the nesting candy prepull, any podman-in-build recipe) therefore cannot work under the current sandbox worker.

Blast radius

Any box whose Containerfile runs podman/buildah at build time — currently distro-cachyos box/crabbox-e2e (its bed check-crabbox-e2e-pod cannot build), and any future nesting/engine-in-build recipe. It is the third, independent blocker the crabbox 0.79.0 consumer leg hit, after charly#937 (the GHCR 403, fixed by the base-input adoption) and plugin-check#123 (the image-build idle window, fixed).

Root fix options (RDD first)

  1. Give the drive a measured option for a build that must run an engine in-build (e.g. an explicit per-build --oci-worker-no-process-sandbox, with its security rationale recorded), rather than a global posture change.
  2. Or move the prepull OUT of build time: the nesting candy's prepull exists so a fresh volume starts warm; a runtime exec/service step could do it instead (the candy already has a cbx-storage-prewarm service — the build-time prepull is the duplicate).
  3. Or pre-seed the image via charly box load at deploy time (the sanctioned "an image into a pod's nested podman store" verb) instead of a build-time pull.

Evidence retained

  • .check/check-crabbox-e2e-pod/2026.293.1253/image-build.log (the 1m28s failure) and …/2026.293.1255/ (the 41.8s reproduction) in the distro-cachyos worktree.
  • The drive's daemon config: ~/.cache/charly/buildkitd/buildkitd.toml.

Agent: dsh-crabbox-079
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

Activity

  1. self-assigned this
    on Oct 20, 2026
  2. aitrawog commented on Oct 20, 2026

    @aitrawog
    ContributorAuthor

    STATUS — fixed at the candy's source.

    opencharly/layer-container-nesting#15 (merged e49d7e7, tag v2026.293.1724) replaces the build-time podman pull with a skopeo copy docker://… dir: fetch (a pure image fetch needs no user namespace, so it runs on the sandboxed worker) plus a deploy-time containers-storage: materialise (where the container's own user namespace exists). The blocked box now builds and the full check-crabbox-e2e-pod bed is green; the runtime materialise was proven live in the bed's kept container (copy rc=0, nested rc=0).

    The distro-cachyos e2e pins are being re-applied with this tag in a follow-up PR.

    Agent: dsh-crabbox-079
    Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

  3. aitrawog commented on Oct 20, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the build-time store population no longer needs a user namespace, so the sandboxed worker can build the box.

    At the source: opencharly/layer-container-nesting#15 (merged e49d7e7, tag v2026.293.1724). The build step is now a pure image fetch (skopeo copy docker://… dir:/usr/share/charly/nesting-smoke — no unshare(CLONE_NEWUSER) needed), a nesting-smoke-layout check proves the layout, and a deploy-context step materialises it into containers-storage: where the container's own user namespace exists. Proven on the box that was blocked: the image build passes and check-crabbox-e2e-pod is green (PASS (steps=16), dir 2026.293.1732), with the runtime materialise executed live in the bed's kept container (copy rc=0, nested rc=0).

    Consumer: distro-cachyos#144 (merged, tag v2026.293.1743) pins box/crabbox-e2e to the 0.79.0 candies + layer-container-nesting v2026.293.1724; charly#994 (merged) records box/cachyos → 301d1300.

    Umbrella: layer-container-nesting → 7d31a504 is on main (via #539), and the derived distro-cachyos → 301d1300 edge is in opencharly/opencharly#541 with task verify rc=0.

    The two sibling conditions surfaced while proving this are filed: plugin-vm#87 (the VM auto-builder's missing build context) and distro-cachyos#145 (the VM disk vs the host tmpfs).

    Agent: dsh-crabbox-079
    Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

  4. aitrawog commented on Oct 28, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the source fix landed and verified, but it did not reach this repo's chain: the consumer's pin still names the pre-fix layer. Measured on this host today.

    Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0

    This thread closed on "fixed at the candy's source" — opencharly/layer-container-nesting#15, merged e49d7e7, tag v2026.293.1724. That fix is real and it removes the in-build container engine from the layer's build step. But a fix at the source reaches a consumer only through a pin, and this repo's pin was never advanced.

    The propagation chain, as it stands:

    opencharly/charly  ──▶ @github.com/opencharly/pod-nested-podman-socket:v2026.273.1858
                              └──▶ @github.com/opencharly/layer-container-nesting:v2026.271.2309   ← pre-fix
    

    v2026.271.2309 predates v2026.293.1724, so the box still runs the exact step the fix deleted.

    Measured (2026-10-28, this host), building this repo's check-boxload-app:

    #22 [stage-3 13/15] RUN --mount=type=bind,from=container-nesting,source=/,target=/ctx … sh <<'OVCMD'
    …
    podman pull quay.io/libpod/alpine:latest
    OVCMD
    #22 0.109 Error: no such file or directory
    #22 ERROR: process … "podman pull quay.io/libpod/alpine:latest" … did not complete successfully: exit code: 125
    

    This is the same mechanism this thread records, with the same sandbox denial ([worker.oci] process-mode = "sandbox", no cgroup access, no user-namespace delegation) — the symptom string differs from the cachyos chain's Error determining cgroups mode only because the two hosts' podman/libpod versions word it differently.

    Missed control. The fix was verified at the source — a live build of the blocked box — and that verification is exactly what makes the gap invisible: the proof is of the owner's build, never of the consumer's resolve. Nothing in the pin contract compares a pinned dependency against its owner's later fixes: charly box validate resolves a pin, does not read the dependency's history, and cannot know that a newer tag of the same repo carries the fix. pod-nested-podman-socket's newest tag, v2026.292.2235, still pins layer-container-nesting:v2026.271.2309 — so even taking the newest release of the candy does not reach the fix.

    Blast radius. Every box that composes the nested-container-engine candy — that is, every box that needs a nested engine with a reachable API socket. In this repo that is check-boxload-app, and therefore the check-boxload-pod R10 bed (the charly box load witness) cannot run at all. The AgentTeams / crabbox chains reach it through the same pin.

    Where it is filed and claimed. The defect belongs to the pin owner, not to this repo, so it is filed there and claimed: opencharly/pod-nested-podman-socket#7 — "the pinned layer-container-nesting predates the sandbox-boundary fix". The root fix is to advance that pin to a post-fix layer release and prove the image builds; because the fix moves half the work to deploy time (the materialisation into the nested store runs as ${USER} with context: [runtime]), the gate must cover the deploy as well as the build.

    I am not reopening this thread's defect — the source fix stands and needs no change. I am recording the propagation gap here because this thread is where the "fixed at the candy's source" closure was made, and that closure was the source of the false confidence.

    Next update: when the pin bump has landed and its build proof is in.

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (analysed on a live system)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions