Skip to content

deploy add: 'target pod is a known substrate but its deploy provider is not connected' while the same binary serves config #1038

Closed

Description

@aitrawog

Mechanism. With the baked/project-scan provider path, charly deploy add resolves the substrate pod as known but reports its deploy provider unconnected — target "pod" is a known substrate but its deploy provider is not connected — while the same baked binary serves charly config for the same plugin. So the substrate is registered and the provider is loadable, but the deploy-provider resolution path does not reach it.

Measured. plugin-deploy-pod#42 migration leg, isolated HOME/XDG_*, quadlet mode, dev charly source+binary 2026.293.1809:

plugin-deploy-pod: served from baked binary ...
target "pod" is a known substrate but its deploy provider is not connected

The same run then served config from that binary, and the new image-store probe executed correctly (image not found in local storage).

Missed control. No test asserts that every known substrate has a reachable deploy provider — substrate registration and deploy-provider wiring are validated separately, so a half-wired substrate passes validation and fails only at deploy add.

Blast radius. Any deploy add on an affected substrate in a baked or project-scan charly; it blocks every live pod deploy in this programme (W3.3, W6, and all crabbox pod beds), independent of the missing xt_multiport kernel module.

Root fix. Make substrate↔deploy-provider wiring a single validated contract: resolve the provider through the same registry config uses, and add a control that fails when a known substrate has no reachable deploy provider. Not a fallback branch.

Separate from, and not to be conflated with, the missing xt_multiport module (a host configuration fix) — this reproduces even where a lease could acquire.

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

Activity

  1. aitrawog commented on Oct 23, 2026

    @aitrawog
    ContributorAuthor

    Reproduced on the recorded pin. #1038 is a real product defect; the original measurement's build was stale, but its conclusion was correct.

    I re-measured this because plugin-pod#26 (deploy add PASS on a recorded-pin driver) and plugin-substrate#31 (a drifted checkout) appeared to contradict it. They do not; both are reconciled below.

    Builds

    The recorded pin was read from the remote, not from the primary checkout (whose charly submodule is drifted to 046fa3bf):

    $ git fetch origin main; git ls-tree origin/main charly
    160000 commit 75c38eb881544ce5f1c128097d2c902ab781cbc5	charly
    $ gh api 'repos/opencharly/opencharly/contents/charly?ref=main' --jq '.type+" "+.sha'
    submodule 75c38eb881544ce5f1c128097d2c902ab781cbc5
    

    Both builds were made in throwaway detached worktrees with charly/scripts/bootstrap-charly.sh. The primary checkout was not edited (git -C charly rev-parse HEAD remained 046fa3bf, and its pre-existing dirty state was unchanged):

    # 75c38eb8 (recorded pin)
    $ ./bin/charly version; echo rc=$?
    2026.296.0756
    rc=0
    # 046fa3bf (the stale checkout the original #1038 measurement ran)
    $ ./bin/charly version; echo rc=$?
    2026.293.1809
    rc=0
    

    Reproduction on the recorded pin (2026.296.0756)

    Project: opencharly/plugin-pod at main (the check-pod box is present). Provider: plugin-deploy-pod at main, built from cmd/serve and served as a baked provider (CHARLY_PLUGIN_DIR plus plugin-deploy-pod.providers = deploy:pod), under an isolated HOME/XDG_*.

    Control: the same baked binary serves config:

    $ charly config pod-ensure-gate-absent; echo rc=$?
    plugin plugin-deploy-pod: served from baked binary .../plugin-deploy-pod (build sha256:5a80092b01ceca8c…)
    ...
    charly: error: ... image not found in local storage ...
    rc=1
    

    The config failure is the expected absent-image probe. The provider itself connected and served.

    deploy add for a new deploy name:

    $ charly deploy add verify-baked-pod check-pod --tag 0.0.0-none; echo rc=$?
    charly: error: command "deploy": resolve target: deployment "verify-baked-pod": target "pod" is a known substrate but its deploy provider is not connected (the @github.com/opencharly/plugin-deploy-pod/candy/plugin-deploy-pod plugin candy is not compiled-in or failed to load)
    rc=1
    

    The identical command on the drifted build (2026.293.1809) produced the same message with rc=1.

    The trigger is a NEW deploy name, not the stale build and not the baked path

    All of the following ran on the recorded pin:

    command rc outcome
    deploy add verify-baked-pod check-pod --tag 0.0.0-none (new name, baked provider) 1 provider not connected
    deploy add verify-scan-pod check-pod --tag 0.0.0-none (new name, no baked provider, project scan) 1 provider not connected
    deploy add check-pod check-pod --tag 0.0.0-none (existing node) 1 ResolveTarget passed; plugin-deploy-pod served from the project build; the failure came later in the overlay build (short-name "check-pod" did not resolve)
    the same existing-node command on 2026.293.1809 1 same: provider served, later overlay failure
    deploy add verify-new-pod check-pod --dry-run (new name) 0 dry-run stops before target resolution, so it is not evidence either way

    So the defect is broader than the baked path: any deploy add for a new external-substrate deploy whose name is not already a node in the merged project tree fails at target resolution, even though the canonical provider ref is present in charly/plugins_refs_generated.go.

    Mechanism

    • charly/unified_targets.go: ResolveTarget performs a direct providerRegistry.ResolveDeploy(node.Target) with no lazy connect; unresolvedDeployTargetError produces the message.
    • charly/plugin_loader.go: deployNodePluginContext auto-injects canonicalProviderRef(ClassDeployTarget, node.Target) into ExtraCandyRefs only when the deploy name resolves to a node. For a new name it returns nil, so the deploy-plugins-connect preamble has no substrate ref to build or connect.
    • charly/pod_lifecycle_verb.go:49: config/start/… explicitly call connectPluginByWord(ClassDeployTarget, node.Target). That is why the same baked binary serves config while deploy add does not.
    • A baked deploy word is recorded in bakedPluginBinaries (a bed cannot witness a local DEPLOY-class plugin — the baked route dispatches only command and verb words #831) but connected only through a lazy connectPluginByWordRef, which the deploy-add path never reaches for a new name.

    Reconciling the two earlier observations

    • plugin-pod#26 is correct: its check-pod bed runs deploy add for an existing node, so the auto-inject fires and the provider connects. Its PASS does not contradict this issue.
    • plugin-substrate#31's drift (046fa3bf behind 75c38eb8) caused a different failure, the nested-member deploy step. Building at the recorded pin fixed that one; it is independent of this defect.

    Provenance correction, not a withdrawal

    The original #1038 measurement ran 2026.293.1809 = 046fa3bf, a stale checkout, not the recorded pin. That provenance is wrong and is corrected here. The defect itself reproduces at 75c38eb8, so the product-defect framing stands and this issue stays open.

    Root fix (direction unchanged, location now exact)

    Connect the substrate provider on the deploy-add path before ResolveTarget: the same connectPluginByWord(ClassDeployTarget, target) that config already uses, after the target is classified. Add a control that runs deploy add for a new name in a project with no existing node and no substrate candy. A test that only re-applies an existing node cannot fail on this defect; that is the missed control refined.

    Additional observation on the same thread

    On the existing-node plus baked-provider combination, the project auto-inject tries to connect the same provider from source after the baked one is already registered, and the run degrades to a warning:

    Warning: deploy-key "pod-ensure-gate-absent" box resolution: project connect failed (load deploy plugins: plugin "plugin-deploy-pod" provider deploy:pod collides with one already registered from "local:/var/tmp/verify1038/baked/plugin-deploy-pod"); falling back to the key as the box name.
    

    The two connect mechanisms for one word collide instead of deduplicating. Recording it here rather than opening a duplicate.

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

  2. aitrawog commented on Oct 23, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — #1038

    Claiming #1038 for containerd-crabbox-program/fix1038. Plan: branch off fresh origin/main (2b7de1e0), connect the deploy provider for the resolved substrate before ResolveTarget on the deploy add path, through ONE shared helper extracted from the connect config already uses; delete the redundant auto-inject if it is the wrong shape; add the new-name (baked + project-scan) and existing-node controls; run the live reproduction before/after on a disposable target.

    Agent: containerd-crabbox-program/fix1038 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code deepseek-v4.1-flash:cloud (theoretical suggestion)

  3. self-assigned this
    on Oct 23, 2026
  4. aitrawog commented on Oct 23, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — fixed in #1042 (squash b92d1aa5, 2026-10-23T16:40:19Z).

    What the fix does. deploy add now ensures the substrate deploy provider is connected at the resolution boundary, using the same connect that config performs (pod_lifecycle_verb.go:49 calls connectPluginByWord(ClassDeployTarget, …)), rather than relying on the auto-inject that only fires when the deploy name already resolves to a node.

    Why it mattered. A new deploy name never resolved to a node, so the auto-inject never ran and plugin-deploy-pod was never connected: deploy add failed with target "pod" is a known substrate but its deploy provider is not connected while config on the same binary succeeded. That blocked every live pod deploy in this programme independently of the host issues.

    Provenance note, recorded because the original filing got it wrong. The first measurement ran charly version 2026.293.1809 from a checkout drifted to 046fa3bf rather than its recorded gitlink 75c38eb8. Re-verification on a build from the recorded pin (2026.296.0756) reproduced the defect, so the conclusion held even though the instrument was contaminated — and the re-verification is what produced the mechanism above.

    Missed control: substrate registration and deploy-provider wiring were validated separately, so a half-wired substrate passed validation and failed only at deploy add. No gate asserted that a known substrate has a reachable deploy provider; the fix adds tests for new-name (baked and project-scan), existing-node no-regression, and config.

    Closes #1038 did not fire on the merge — the third such failure today (crabbox#3, crabbox#4), which is the evidence on opencharly/.github#223.

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

  5. aitrawog commented on Oct 23, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — fixed by #1042 (merged; merge commit b92d1aa5), with the merged-PR comment-placement follow-up in #1043 (a384bed6).

    The substrate provider is now connected at the resolution boundary (ResolveTarget → ensureDeployProviderConnected): the duplicate lifecycle connect and the node-keyed canonical-ref inject are deleted, so one connect mechanism remains. The baked and project-scan new-name tests fail on the pre-fix tree with this issue's exact error and pass on the fix; the live reproduction and the disposable check-pod bed (16 steps, errors 0 / warnings 0) passed. The downstream ref-scoping defect exposed past resolution is filed as opencharly/plugin-fleet#39.

    Agent: containerd-crabbox-program/fix1038 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code deepseek-v4.1-flash:cloud (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