{"record":{"id":"a21b52caa50b28cb","repo":"gastownhall/beads","slug":"failed-to-get-wisp-dependents-w","errorCode":null,"errorMessage":"failed to get wisp dependents: %w","messagePattern":"failed to get wisp dependents: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/wisps.go","lineNumber":745,"sourceCode":"\t_ = rows.Close()\n\tif err := rows.Err(); err != nil {\n\t\treturn nil, wrapQueryError(\"iterate wisp dependencies\", 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// getWispDependents retrieves issues that depend on a wisp.\nfunc (s *DoltStore) getWispDependents(ctx context.Context, issueID string) ([]*types.Issue, error) {\n\trows, err := s.queryContext(ctx, fmt.Sprintf(`\n\t\tSELECT issue_id FROM wisp_dependencies WHERE %s = ?\n\t`, issueops.DepTargetExpr), issueID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get wisp dependents: %w\", err)\n\t}\n\n\tvar ids []string\n\tfor rows.Next() {\n\t\tvar id string\n\t\tif err := rows.Scan(&id); err != nil {\n\t\t\t_ = rows.Close()\n\t\t\treturn nil, wrapScanError(\"scan wisp dependent\", err)\n\t\t}\n\t\tids = append(ids, id)\n\t}\n\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","sourceCodeStart":727,"sourceCodeEnd":763,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/wisps.go#L727-L763","documentation":"This error wraps failure of the query 'SELECT issue_id FROM wisp_dependencies WHERE <target> = ?' in getWispDependents, which finds issues that depend on a given wisp. The library wraps the driver error to show this specific lookup failed; nothing about dependents was returned.","triggerScenarios":"Querying dependents of a wisp when the wisp_dependencies table is absent/corrupt, the connection dropped, or the engine rejects the DepTargetExpr SQL fragment.","commonSituations":"Database partially migrated; Dolt process down; disk-full causing query errors on the embedded engine.","solutions":["Check the underlying wrapped error for the driver message.","Verify wisp_dependencies exists and matches the schema version (run migrations/doctor).","Reconnect to the Dolt database and retry the lookup.","Check disk space/health for embedded Dolt databases."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check connectivity/table first: SELECT COUNT(*) FROM wisp_dependencies","typeGuard":null,"tryCatchPattern":"deps, err := getWispDependents(ctx, id)\nif err != nil {\n    log.Printf(\"dependent lookup failed for %s: %v\", id, err)\n    return nil, err\n}","preventionTips":["Confirm schema matches binary version before queries","Check disk space for embedded Dolt","Retry on transient connection errors"],"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"}