Skip to content

batch: VM beds warn (non-allowlisted) that K3S_CLUSTER_TOKEN cannot be persisted — plugin-secrets is absent from the bed closure #655

Open

Description

@aitrawog

Summary

Every VM bed in charly/charly.yml that provisions an auto-generated secret logs a surviving, NON-allowlisted warning at deploy add:

Warning: could not persist auto-generated secret charly/secret/K3S_CLUSTER_TOKEN: InvokeProvider: no provider registered for verb:credential (the target plugin must be loaded before a peer invokes it, and no connectable candy source provides it)

(check-k3s-vm and check-k8s-deploy both; summary.yml lists it under the plain severity-prefix class, NOT any allowlisted: entry.)

RCA

GenerateAndStoreSecret (sdk/deploykit/secret_provision.go:63-67) generates the token and calls cred.Write(service, key, val); on failure it prints the warning to stderr and continues (the in-memory value is still used, so the deploy succeeds). cred.Write forwards to verb:credential, which is served OUT-OF-PROCESS by candy/plugin-secrets (charly/charly/credential_plugin.go's connectPluginByWord(ClassVerb, "credential")). The charly/charly.yml project does NOT compose or reference plugin-secrets in its candy closure, so connectPluginByWordRef's canonical-ref fallback finds no connectable source and the write fails.

So the k3s VM bed's auto-generated K3S_CLUSTER_TOKEN is generated but never persisted — the TTL/refresh semantics of the credential store don't apply to it.

Fix direction

The bed project (or the VM substrate's secret-provisioning path) must make plugin-secrets reachable — a candy:/@github ref in charly/charly.yml's closure, or the charly candy's own secrets: declaration. This is a project-closure gap, not a plugin defect: plugin-secrets is correct; it is simply not in the bed's closure.

Evidence

Retained in .check/check-k8s-deploy/2026.267.2348/deploy-add.log:19 and .check/check-k3s-vm/2026.267.2255/deploy-add.log:29 (worktree nerdctl-phase1), summary.yml severity-prefix count 1 per deploy-add step.

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

Activity

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

    @aitrawog
    ContributorAuthor

    STATUS — the row is live and its RCA holds on main; the one thing it under-states is the consequence: the unpersisted token is regenerated on every deploy, so the cluster's shared secret silently rotates.

    What was measured

    origin/main of opencharly/sdk and opencharly/charly, plus a code survey of the org.

    $ gh api "repos/opencharly/sdk/contents/deploykit/secret_provision.go?ref=main" | base64 -d | sed -n '62,69p'
    func GenerateAndStoreSecret(service, key string, cred CredentialAccess) (val, source string) {
    	val = GenerateRandomSecretToken(32)
    	if err := cred.Write(service, key, val); err != nil {
    		fmt.Fprintf(os.Stderr, "Warning: could not persist auto-generated secret %s/%s: %v\n", service, key, err)
    	}
    	return val, "auto-generated"
    
    $ gh api "search/code?q=plugin-secrets+org:opencharly" --jq '.items[].path'   # only the plugin's own repo + 2 charly CHANGELOGs
    charly/CHANGELOG/2026.256.1119.md · charly/CHANGELOG/2026.186.0029.md
    

    plugin-secrets is also absent from the 63-entry compiled_plugins: list in charly/charly.yml (measured: awk over the block, entry count 63, zero entries matching secret).

    Root cause

    Mechanism GenerateAndStoreSecret generates a 32-byte token, calls cred.Write → verb:credential (served out-of-process by candy/plugin-secrets), and on failure prints to stderr and returns the in-memory value anyway. The bed project's closure composes no connectable source for that verb, so the write always fails and the deploy succeeds with a token that exists only for that run.

    Missed control two: the closure never had to declare the credential provider (nothing in the scan requires a verb's provider to be present before a peer invokes it), and a failed persistence is a warning rather than an error on a path whose whole purpose is persistence.

    Blast radius measured for the class, not the count: every VM bed in charly/charly.yml that provisions an auto-generated secret carries a permanent, non-allowlisted warning, so those beds can never satisfy "zero warnings is the only pass". Behaviourally, each re-deploy of check-k3s-vm mints a new K3S_CLUSTER_TOKEN; a previously joined agent cannot rejoin. not measured: how many other auto-generated secrets take this path.

    Root fix make the provider reachable through the declaring project's own closure (a candy:/@github ref, or the charly candy's own secrets: declaration) — a closure fix, not a plugin fix, since plugin-secrets itself is correct. Independently, a failed persist on an auto-generated secret should be loud; silently continuing is the deeper defect and is what let this survive.

    Deps none; lands in the bed project's charly.yml closure.

    Correction to this issue's framing

    None on the mechanism. The title's "warn … cannot be persisted" understates it: the token rotates per deploy, so this is a correctness defect with a warning attached, not a cosmetic warning.

    Agent: org-triage-2026-10-09
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  3. 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

Labels

category:deliverytype:fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions