gastownhall/beads · error

missing required variables: %s

Error message

missing required variables: %s

What it means

Molecule templates (subgraphs) can declare required variables. checkRequiredVars compares the supplied vars map against extractRequiredVariables(subgraph) and fails creation when any required variable is absent, listing all missing names comma-separated.

Source

Thrown at cmd/bd/wisp.go:302

		Prefix:    types.IDPrefixWisp,
		RootOnly:  rootOnly,
	})
	if err != nil {
		return HandleError("creating wisp: %v", err)
	}

	return renderWispCreateResult(result)
}

func checkRequiredVars(subgraph *TemplateSubgraph, vars map[string]string) error {
	var missingVars []string
	for _, v := range extractRequiredVariables(subgraph) {
		if _, ok := vars[v]; !ok {
			missingVars = append(missingVars, v)
		}
	}
	if len(missingVars) > 0 {
		return fmt.Errorf("missing required variables: %s", strings.Join(missingVars, ", "))
	}
	return nil
}

func firstMissingVar(subgraph *TemplateSubgraph, vars map[string]string) string {
	for _, v := range extractRequiredVariables(subgraph) {
		if _, ok := vars[v]; !ok {
			return v
		}
	}
	return ""
}

func renderWispCreateDryRun(protoID string, subgraph *TemplateSubgraph, vars map[string]string, rootOnly bool) {
	if rootOnly {
		skipped := len(subgraph.Issues) - 1
		fmt.Printf("\nDry run: would create wisp with 1 issue (root only) from proto %s\n", protoID)
		if skipped > 0 {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the error's list and pass each variable: --var name=value
  2. Run with --dry-run or check the proto template to see all required variables
  3. Fix variable-name typos in your script or command

Example fix

// before
bd mol pour deploy-proto
// after
bd mol pour deploy-proto --var env=prod --var region=us-east
Defensive patterns

Strategy: validation

Validate before calling

required := extractRequiredVariables(subgraph)
var missing []string
for _, v := range required {
    if _, ok := vars[v]; !ok {
        missing = append(missing, v)
    }
}
if len(missing) > 0 {
    return fmt.Errorf("missing required variables: %s", strings.Join(missing, ", "))
}

Prevention

When it happens

Trigger: `bd mol pour <name>` / wisp create without the required --var key=value pairs (or vars passed programmatically) for a proto whose template references those variables.

Common situations: Forgetting a newly added template variable after a proto update; typos in variable names (--var timout=5 vs timeout=5); running pour from scripts with incomplete env-derived vars.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/70c0ae4ce9cea86e. Report an issue: GitHub.