{"record":{"id":"08c1079a62d895be","repo":"gastownhall/beads","slug":"failed-to-get-wisp-dependencies-with-metadata-w","errorCode":null,"errorMessage":"failed to get wisp dependencies with metadata: %w","messagePattern":"failed to get wisp dependencies with metadata: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/wisps.go","lineNumber":775,"sourceCode":"\t_ = rows.Close()\n\tif err := rows.Err(); err != nil {\n\t\treturn nil, wrapQueryError(\"iterate wisp dependents\", err)\n\t}\n\n\tif len(ids) == 0 {\n\t\treturn nil, nil\n\t}\n\n\treturn s.GetIssuesByIDs(ctx, ids)\n}\n\n// getWispDependenciesWithMetadata returns wisp dependencies with metadata.\nfunc (s *DoltStore) getWispDependenciesWithMetadata(ctx context.Context, issueID string) ([]*types.IssueWithDependencyMetadata, error) {\n\trows, err := s.queryContext(ctx, fmt.Sprintf(`\n\t\tSELECT %s AS depends_on_id, type FROM wisp_dependencies WHERE issue_id = ?\n\t`, issueops.DepTargetExpr), issueID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get wisp dependencies with metadata: %w\", err)\n\t}\n\n\ttype depMeta struct {\n\t\tdepID, depType string\n\t}\n\tvar deps []depMeta\n\tfor rows.Next() {\n\t\tvar depID, depType string\n\t\tif err := rows.Scan(&depID, &depType); err != nil {\n\t\t\t_ = rows.Close()\n\t\t\treturn nil, wrapScanError(\"scan wisp dependency metadata\", err)\n\t\t}\n\t\tdeps = append(deps, depMeta{depID: depID, depType: depType})\n\t}\n\t_ = rows.Close()\n\tif err := rows.Err(); err != nil {\n\t\treturn nil, wrapQueryError(\"iterate wisp dependencies\", err)\n\t}","sourceCodeStart":757,"sourceCodeEnd":793,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/wisps.go#L757-L793","documentation":"This error wraps failure of the query 'SELECT <target> AS depends_on_id, type FROM wisp_dependencies WHERE issue_id = ?' in getWispDependenciesWithMetadata (exposed via GetDependenciesWithMetadata). It marks that dependency rows with their type metadata could not be fetched.","triggerScenarios":"Calling GetDependenciesWithMetadata on a wisp when the connection fails, wisp_dependencies is missing, or the type column is absent (older schema) making the SELECT invalid.","commonSituations":"Schema upgraded/created before the type column existed; Dolt server unavailable; corrupted database file.","solutions":["Inspect the wrapped driver error for the precise cause (missing column vs connection).","Run schema migration/verification (bd doctor) so wisp_dependencies has the expected columns.","Restore Dolt connectivity and retry.","Re-create the .beads database from sync if corruption is indicated."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify column exists: SHOW COLUMNS FROM wisp_dependencies LIKE 'type'","typeGuard":null,"tryCatchPattern":"meta, err := GetDependenciesWithMetadata(ctx, id)\nif err != nil {\n    if strings.Contains(err.Error(), \"Unknown column\") {\n        return migrateSchema(ctx) // older schema: run migration then retry\n    }\n    return err\n}","preventionTips":["Run bd doctor after upgrades to catch schema drift","Never hand-edit the Dolt database","Take backups before schema-affecting operations"],"tags":["database","sql","dolt"],"backgroundTag":"sql-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}