{"record":{"id":"9cdb768270f9f789","repo":"gastownhall/beads","slug":"resolving-attachment-id-s-w","errorCode":null,"errorMessage":"resolving attachment ID %s: %w","messagePattern":"resolving attachment ID (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_proxied_server.go","lineNumber":85,"sourceCode":"\t\t\tif !isProto(protoIssue) {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"%s is not a proto (missing '%s' label)\", protoID, MoleculeLabel)\n\t\t\t}\n\t\t\tsubgraph, err = loadTemplateSubgraph(ctx, w, protoID)\n\t\t\tif err != nil {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"loading proto: %w\", err)\n\t\t\t}\n\t\t}\n\n\t\ttype attachmentInfo struct {\n\t\t\tid       string\n\t\t\tissue    *types.Issue\n\t\t\tsubgraph *TemplateSubgraph\n\t\t}\n\t\tvar attachments []attachmentInfo\n\t\tfor _, attachArg := range in.attachArgs {\n\t\t\tattachID, err := utils.ResolvePartialID(ctx, w, attachArg)\n\t\t\tif err != nil {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"resolving attachment ID %s: %w\", attachArg, err)\n\t\t\t}\n\t\t\tattachIssue, err := w.GetIssue(ctx, attachID)\n\t\t\tif err != nil {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"loading attachment %s: %w\", attachID, err)\n\t\t\t}\n\t\t\tif !isProto(attachIssue) {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"%s is not a proto (missing '%s' label)\", attachID, MoleculeLabel)\n\t\t\t}\n\t\t\tattachSubgraph, err := loadTemplateSubgraph(ctx, w, attachID)\n\t\t\tif err != nil {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"loading attachment subgraph %s: %w\", attachID, err)\n\t\t\t}\n\t\t\tattachments = append(attachments, attachmentInfo{attachID, attachIssue, attachSubgraph})\n\t\t}\n\n\t\tvars := applyVariableDefaults(vars, subgraph)\n\n\t\tvar attachSubgraphs []*TemplateSubgraph","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_proxied_server.go#L67-L103","documentation":"When pouring with --attach arguments, each attachment argument is resolved to a full issue ID via ResolvePartialID. This error wraps the resolution failure, so the attachment argument was neither a complete ID nor resolvable to a unique existing issue. The wrapped cause from ResolvePartialID is preserved.","triggerScenarios":"Running `bd mol pour <proto> --attach <arg>` where <arg> is a typo'd partial ID, an ID that doesn't exist in the current database, or an ambiguous prefix matching multiple issues (depending on resolver behavior).","commonSituations":"Typos or truncated prefixes that don't match; attaching protos stored in a different repo/database; referencing an attachment deleted by gc or not yet synced from another machine.","solutions":["Run bd list and copy the exact attachment ID into --attach","Check you're in the repository whose database contains the attachment proto","Sync (bd dolt pull) if the attachment was created on another machine","Retry with a longer, unambiguous ID prefix"],"exampleFix":"// before\n$ bd mol pour mol-fix --attach bd-9\nError: resolving attachment ID bd-9: ...\n// after\n$ bd list | grep attach\n$ bd mol pour mol-fix --attach bd-900","handlingStrategy":"validation","validationCode":"// resolve each --attach argument before pouring\nfor _, arg := range attachArgs {\n\tif _, err := utils.ResolvePartialID(ctx, reader, arg); err != nil {\n\t\treturn fmt.Errorf(\"--attach %q does not resolve to an issue\", arg)\n\t}\n}","typeGuard":null,"tryCatchPattern":"err := pourCmd(args)\nif err != nil && strings.Contains(err.Error(), \"resolving attachment ID\") {\n\treturn fmt.Errorf(\"bad --attach value; see `bd list` for valid IDs\")\n}","preventionTips":["Copy attachment IDs verbatim from bd list output","Use long enough ID prefixes to be unambiguous","Sync before attaching protos created on other machines","Confirm attachment existence with bd show before scripting pours"],"tags":["cli","molecule","not-found","attachment"],"backgroundTag":"id-resolution-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}