Skip to content

spored: a launch-time plugin whose config fails to resolve leaves no state, so plugin status says 'not installed' #1226

Closed

Description

@scttfrdmn

Found while doing #1116 (PR #1210).

In pkg/pluginruntime/runtime.go, InstallWithProvenance calls spec.ResolvedConfig(cfg) before it saves any PluginState. When resolution fails, it returns the error, and the launch-time path (LoadFromDeclarations) only logs it:

if err := rt.Install(ctx, spec, d.Config); err != nil {
    log.Printf("Plugin %s: install failed: %v", spec.Name, err)
}

So a spawn launch --config launch.yaml whose plugin entry is missing a required key, or after #1210 has an undeclared one (a typo, or tailscale's old auth_key), produces an instance where spawn plugin status <name> answers "not installed". The reason is only in spored's log.

The same goes for a spec-resolution failure (resolver.Resolve) in LoadFromDeclarations.

spawn plugin install is not affected: it resolves config on the controller and reports the error.

Fix: on a resolve or config failure in the declaration path, save a StatusFailed state carrying the error, so plugin status and plugin list show it. Alternatively, have spawn launch resolve declared plugins' specs and config before launching. That is a network fetch per plugin, but it would catch the error before any spend.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions