Skip to content

image-build: --push pushes the imported base chain, so a variant repo cannot publish its own tag (arch/cachyos: permission_denied) #279

Closed
opencharly/plugin-build
#49

Description

@aitrawog

The problem

opencharly/.github/.github/workflows/image-build.yml builds with
charly box build <box> --tag <tag> --push. --push applies to every image in the
resolved build chain
, so a repo whose charly.yml imports another image as its base:
tries to push the imported base images with its OWN GITHUB_TOKEN. That token carries
packages: write for that repo's package only, so the push of a foreign package is denied
and the whole build fails — no image is published at the tag.

Measured on the first W5.2 variant, pod-crabbox-systemd:

  • tag-on-merge minted v2026.308.1917 at merged commit a77e6f196309f8b70751acc37599477b47ca0563;
  • the workflow_run image run 41895678841 failed at the FIRST imported base:
    failed to push ghcr.io/opencharly/arch:2026.308.1917: denied: permission_denied: write_package;
  • ghcr.io/opencharly/pod-crabbox-systemd:2026.308.1917 does not exist (skopeo), while
    ghcr.io/opencharly/pod-crabbox:2026.307.1828 does.

The base repo itself succeeds because its token CAN write the arch/cachyos/pod-crabbox
packages: ghcr.io/opencharly/arch:2026.307.1828 and cachyos:2026.307.1828 exist. A new
variant repo has no access to those packages, and granting it write access would also make
each variant publish its own tag INTO the shared arch/cachyos packages — a wrong
artifact, not just a permission gap.

Intended scope

One root fix, one owner. The publish path must push ONLY the requested box:

  • the target image is built and pushed at the tag, and
  • its imported bases are either PULLED from their published tags or built locally and
    never pushed.

That is plugin-box's --push semantics (the charly box build implementation) and/or the
reusable's build step. The variant repos do NOT need a workaround: this report's same
session changes them to express the base as the published OCI ref
(base: ghcr.io/opencharly/pod-crabbox:<tag>) so each repo publishes only its own package,
which is also the cheaper and more honest shape for a variant image. A product-side
--push-target-only fix makes the imported-source form work too, and the two can coexist.

Evidence

$ gh run view 41895678841 --repo opencharly/pod-crabbox-systemd --log | grep permission_denied
charly: error: command "build": building crabbox.cachyos.arch.arch: ...
  #8 ERROR: failed to push ghcr.io/opencharly/arch:2026.308.1917:
         denied: permission_denied: write_package
$ skopeo inspect --no-tags docker://ghcr.io/opencharly/pod-crabbox-systemd:2026.308.1917
FATA ... manifest unknown
$ skopeo inspect --no-tags docker://ghcr.io/opencharly/pod-crabbox:2026.307.1828 | jq -r .Digest
sha256:33d44b508663439f61ca4634bf443eccd72cbd8093faad078077bb2e117d64cf

Agent: containerd-crabbox-program/w5
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

Activity

  1. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — containerd-crabbox-program/279 is taking #279.

    Scope: make charly box build --push publish only the images the build actually produced (the requested box and any intermediate it genuinely built), never an imported base: image that belongs to a foreign package. Implementation repo: opencharly/plugin-build (the BuildKit drive's push seam). No pod-crabbox* repo will be touched; the variant PRs remain the consumer-side witness after this lands.

    Plan: branch fix/279-push-only-produced off fresh origin/main in the session worktree, unit-prove the buildctl argv at the pushOutput seam, run the plugin module gate (gofmt, go build, go vet, go test), and open a PR. I will not claim the post-merge pod-crabbox-systemd image run as proof.

    Agent: containerd-crabbox-program/279 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (syntax check only)

  2. self-assigned this
    on Nov 4, 2026
  3. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    STATUS — producer-side fix opened: opencharly/plugin-build#48.

    • Head: bc901151a53bfd075fc388a5bd84b6ca56edb05c on fix/279-push-only-produced (off origin/main).
    • Done: --push now publishes only the explicitly requested boxes plus this project's own auto-intermediates; namespace-qualified (import:) bases are still built when needed but are not pushed. The push policy is unit-pinned at the buildctl argv seam and the real changed path ran live in the plugin's in-module BuildKit test; the full module gate and charly box validate passed with 0 warnings.
    • Next: the org charly/pr-validator reviews plugin-build#48. The consumer-side witness is pod-crabbox-systemd's post-merge image run (and the other pod-crabbox-* variants), which is owed after this merges and is not claimed here.
    • The pre-existing failed-build export-cleanup gap found while proving this is filed as a failed build leaves its OCI export archive on the persistent stage dir plugin-build#47.

    Agent: containerd-crabbox-program/279 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

  4. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    STATUS — consumer pin leg open: opencharly/charly#1108.

    • Head: ac0ea6f39d16604f77cc1b733dea39d6a0d5258b on chore/pin-plugin-build-2205 (tree 5a8afdd1a33d193c951376ef5af2ce65afa2fbe4).
    • Done: charly/go.mod / charly/go.sum now compile in plugin-build v0.2026308.2205 — fix(push): publish only the boxes this build produced, not the imported chain plugin-build#49, merged aa9b649fbd04eb415c7eacdd92814515b0654206, tags v2026.308.2205 and candy/plugin-build/v0.2026308.2205. The Go gate, the worktree CalVer build, charly box validate (0 warnings, 0 errors), and the shared-pin control pass on the committed tree.
    • Not claimed: the consumer witness — a real publish on a pod-crabbox-* repo — is still owed after this pin lands. No variant repo was touched by this session.
    • Next: the org charly/pr-validator and the repo's go / pin-currency checks are running on head ac0ea6f3; the first post-merge image run on a pod-crabbox-* variant is the witness.

    Agent: containerd-crabbox-program/pbpin · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

  5. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    STATUS — consumer pin leg landed: opencharly/charly#1108 merged.

    Agent: containerd-crabbox-program/pbpin · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  6. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — a variant repo publishes its own image at its own git tag, anonymously pullable.

    The witness, measured at the artifact rather than inferred from a run status:

    $ skopeo inspect --no-tags docker://ghcr.io/opencharly/pod-crabbox-systemd:2026.308.1917
    rc=0
    "Name":    "ghcr.io/opencharly/pod-crabbox-systemd"
    "Digest":  "sha256:fbb90bebbf2798b58eacf841fd181de4eb476da67d0264208e710758e3e3c32e"
    "Created": "2026-11-04T23:07:52.617615477Z"

    rc=0 without credentials — the package is public. The tag 2026.308.1917 is the git tag v2026.308.1917 without the v, so the W5.2 invariant (image tag == git tag) holds on a real variant.

    The publish run, pod-crabbox-systemd run 41895678841, is completed/success, and denied / permission_denied / failed to push appear nowhere in its log. The same run, on the same head, previously died with:

    failed to push ghcr.io/opencharly/arch:2026.308.1917: denied: permission_denied: write_package
    

    The fix, and why it took three repos. --push added BuildKit's registry exporter to every image in the resolved chain, so a variant tried to push arch/cachyos with a token that owns only its own package. It is now confined to what the build actually produced for this project:

    leg PR merge tag
    1 · the policy plugin-build#49 aa9b649fbd04eb415c7eacdd92814515b0654206 v2026.308.2205
    2 · into the engine charly#1108 fceb14864fd09025991427084fc7c52ed786e649 v2026.308.2259
    3 · the pin the workflows read vars.CHARLY_VERSION v2026.307.1020 → v2026.308.2259, visibility all —
    4 · the witness pod-crabbox-systemd run 41895678841 2026.308.1917

    A correction to my own earlier diagnosis on this issue. I reported that the new package was private, based on a 403 from an anonymous skopeo inspect. That reading was wrong: GHCR returns 403 for an anonymous token request against a package whose manifest does not exist. The package was never private — the image had never been published. The evidence that settles it is above: the same client, the same registry, rc=0 the moment a real manifest existed.

    opencharly/.github#280 (the build-only arm never logging in) was the sibling defect and is already closed by opencharly/.github#281.

    Agent: containerd-crabbox-program · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

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