{"record":{"id":"70c0ae4ce9cea86e","repo":"gastownhall/beads","slug":"missing-required-variables-s-70c0ae","errorCode":null,"errorMessage":"missing required variables: %s","messagePattern":"missing required variables: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/wisp.go","lineNumber":302,"sourceCode":"\t\tPrefix:    types.IDPrefixWisp,\n\t\tRootOnly:  rootOnly,\n\t})\n\tif err != nil {\n\t\treturn HandleError(\"creating wisp: %v\", err)\n\t}\n\n\treturn renderWispCreateResult(result)\n}\n\nfunc checkRequiredVars(subgraph *TemplateSubgraph, vars map[string]string) error {\n\tvar missingVars []string\n\tfor _, v := range extractRequiredVariables(subgraph) {\n\t\tif _, ok := vars[v]; !ok {\n\t\t\tmissingVars = append(missingVars, v)\n\t\t}\n\t}\n\tif len(missingVars) > 0 {\n\t\treturn fmt.Errorf(\"missing required variables: %s\", strings.Join(missingVars, \", \"))\n\t}\n\treturn nil\n}\n\nfunc firstMissingVar(subgraph *TemplateSubgraph, vars map[string]string) string {\n\tfor _, v := range extractRequiredVariables(subgraph) {\n\t\tif _, ok := vars[v]; !ok {\n\t\t\treturn v\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc renderWispCreateDryRun(protoID string, subgraph *TemplateSubgraph, vars map[string]string, rootOnly bool) {\n\tif rootOnly {\n\t\tskipped := len(subgraph.Issues) - 1\n\t\tfmt.Printf(\"\\nDry run: would create wisp with 1 issue (root only) from proto %s\\n\", protoID)\n\t\tif skipped > 0 {","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/wisp.go#L284-L320","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Read the error's list and pass each variable: --var name=value","Run with --dry-run or check the proto template to see all required variables","Fix variable-name typos in your script or command"],"exampleFix":"// before\nbd mol pour deploy-proto\n// after\nbd mol pour deploy-proto --var env=prod --var region=us-east","handlingStrategy":"validation","validationCode":"required := extractRequiredVariables(subgraph)\nvar missing []string\nfor _, v := range required {\n    if _, ok := vars[v]; !ok {\n        missing = append(missing, v)\n    }\n}\nif len(missing) > 0 {\n    return fmt.Errorf(\"missing required variables: %s\", strings.Join(missing, \", \"))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List required variables with a dry run before pouring","Keep --var names in sync with template updates","Validate variable names in CI scripts that invoke pour"],"tags":["cli","molecules","validation"],"backgroundTag":"missing-required-variable","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}