Skip to content

box build of a debootstrap image fails at 'ADD ... debootstrap.tar.gz' with 'operation not permitted' on a rootless engine #1176

Open

Description

@aitrawog

Finding

A debootstrap-built image cannot be assembled by charly box build on a rootless engine: the rootfs
tarball carries character device nodes, and buildkit refuses to ADD them.

$ charly -C <distro-ubuntu> box build ubuntu-debootstrap
--- Bootstrap (debootstrap) for ubuntu-debootstrap ---      <- this SUCCEEDS, 1.08 GB rootfs written
…
  10 |
  11 | >>> ADD .build/ubuntu-debootstrap/debootstrap.tar.gz /
  12 |
  13 |     USER root
  error: failed to solve: operation not permitted

The bootstrap step is fine. The tarball it produces is not addable in a rootless build:

$ tar -tvzf .build/ubuntu-debootstrap/debootstrap.tar.gz | awk '$1 ~ /^[cb]/ {print $1, $NF}' | head -6
crw-rw-rw- ./dev/null
crw-rw-rw- ./dev/zero
crw-rw-rw- ./dev/full
crw-rw-rw- ./dev/random
crw-rw-rw- ./dev/urandom
crw-rw-rw- ./dev/tty

Mechanism

debootstrap populates /dev with the standard pseudo-devices. Archiving that tree and ADDing it is
the from: builder:debootstrap path every debootstrap image in the org uses. Extracting character devices
requires CAP_MKNOD; a rootless buildkit worker does not have it, and the failure surfaces as a bare
operation not permitted on the ADD instruction — with no mention of which entry was refused.

This is not specific to Ubuntu, my change, or one distro: any from: builder:debootstrap image has the
same shape, so the same failure should appear for debian-debootstrap and the CachyOS pacstrap analogue on
a rootless engine.

Missed control

Nothing validates that the artifact the bootstrap produces is ADDable before the build reaches that
instruction, and the error names the instruction rather than the offending entry — so the operator has to
unpack a 1 GB tarball to discover that /dev/null is the problem.

Blast radius

Every debootstrap-based image build on a rootless engine. In this campaign it blocked the only non-VM proof
of an embedded-vocabulary change (the debootstrap suite), forcing the evidence to be taken from the
bootstrap log and the produced rootfs instead of a completed image.

Root-fix directions

  1. Exclude /dev from the rootfs archive (--exclude=dev/*) — the container runtime mounts its own
    /dev, so the nodes in the tarball are never used.
  2. Or emit them as plain empty files/directories, which is what a container image needs anyway.
  3. And make the failure name the offending entry (ADD: refusing ./dev/null: operation not permitted)
    rather than only the instruction.

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

Activity

  1. aitrawog commented on Nov 16, 2026

    @aitrawog
    ContributorAuthor

    MISFILED — moved to #1181

    I posted the plugin-deploy-vm candy-closure finding here by mistake: this issue is about the rootless
    ADD of debootstrap's device nodes, and that is a different defect. The finding now has its own issue,
    #1181, carrying the survey table, the mechanism and the one-line remedy.

    Leaving this pointer rather than deleting the comment, so the thread shows where the evidence went.

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

  2. added
    category:delivery
    type:fix
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:deliverytype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions