gastownhall/beads · error

runtime mode requires all variables to have values Missing:

Error message

runtime mode requires all variables to have values
Missing: %s
Provide with: --var %s=<value>

What it means

In `--mode=runtime`, `bd cook` requires every variable declared by the formula to be supplied via `--var`. Before cooking, it diffs the formula's declared vars against the provided input vars and fails, listing all missing names and hinting the `--var <name>=<value>` syntax for the first one. Runtime mode cooks an ephemeral subgraph, so unresolved variables cannot be left symbolic.

Source

Thrown at cmd/bd/cook.go:301

// outputCookEphemeral outputs the resolved formula as JSON (ephemeral mode)
func outputCookEphemeral(resolved *formula.Formula, runtimeMode bool, inputVars map[string]string, vars []string) error {
	if runtimeMode {
		// Apply defaults from formula variable definitions
		for name, def := range resolved.Vars {
			if _, provided := inputVars[name]; !provided && def.Default != nil {
				inputVars[name] = *def.Default
			}
		}

		// Check for missing required variables
		var missingVars []string
		for _, v := range vars {
			if _, ok := inputVars[v]; !ok {
				missingVars = append(missingVars, v)
			}
		}
		if len(missingVars) > 0 {
			return fmt.Errorf("runtime mode requires all variables to have values\nMissing: %s\nProvide with: --var %s=<value>",
				strings.Join(missingVars, ", "), missingVars[0])
		}

		// Substitute variables in the formula
		substituteFormulaVars(resolved, inputVars)
	}
	return outputJSON(resolved)
}

// persistCookFormula creates a proto bead in the database (persist mode)
func persistCookFormula(ctx context.Context, resolved *formula.Formula, protoID string, force bool, vars, bondPoints []string) error {
	// Check if proto already exists
	existingProto, err := store.GetIssue(ctx, protoID)
	if err == nil && existingProto != nil {
		if !force {
			return fmt.Errorf("proto %s already exists (use --force to replace)", protoID)
		}
		// Delete existing proto and its children

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the `Missing:` list in the message and pass each variable: `bd cook <formula> --mode=runtime --var name1=value1 --var name2=value2`
  2. Run `bd formula show <formula>` to list the formula's declared variables and their expected values
  3. Fix typos: a provided var with a misspelled name still counts as missing because it doesn't match a declaration
  4. Switch to interactive mode (omit `--mode=runtime`) if you want to be prompted for values instead

Example fix

// before
bd cook deploy --mode=runtime
// after
bd cook deploy --mode=runtime --var env=prod --var region=us-east-1
Defensive patterns

Strategy: validation

Validate before calling

missing := []string{}
for _, v := range declaredVars {
    if _, ok := inputVars[v.Name]; !ok {
        missing = append(missing, v.Name)
    }
}
if len(missing) > 0 {
    return fmt.Errorf("missing vars for runtime cook: %v", missing)
}

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "runtime mode requires all variables") {
        // parse Missing: list, prompt user or supply defaults
    }
    return err
}

Prevention

When it happens

Trigger: Running `bd cook <formula> --mode=runtime` while omitting one or more `--var` flags for variables the formula declares; providing vars with misspelled names that don't match declarations.

Common situations: Formula gained a new required variable after the user's script/alias was written; copy-pasting a cook command from docs without filling in vars; shell quoting dropping a `--var` argument; confusing runtime mode's all-vars-required rule with interactive mode's prompting.

Related errors


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