{"record":{"id":"3856ae5164bf8c93","repo":"gastownhall/beads","slug":"failed-to-get-wisp-dependencies-w","errorCode":null,"errorMessage":"failed to get wisp dependencies: %w","messagePattern":"failed to get wisp dependencies: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dolt/wisps.go","lineNumber":715,"sourceCode":"\t\tSourceTable:   \"wisps\",\n\t\tWriteTable:    \"wisp_dependencies\",\n\t\tIsCrossPrefix: isCrossPrefix,\n\t\tTargetKind:    &kind,\n\t\tEmitEvent:     emitEvent,\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\treturn s.commitSQLTx(ctx, \"commit add wisp dependency\", tx)\n}\n\n// getWispDependencies retrieves issues that a wisp depends on.\nfunc (s *DoltStore) getWispDependencies(ctx context.Context, issueID string) ([]*types.Issue, error) {\n\trows, err := s.queryContext(ctx, fmt.Sprintf(`\n\t\tSELECT %s AS depends_on_id 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: %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 dependency\", 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 dependencies\", err)\n\t}\n\n\tif len(ids) == 0 {\n\t\treturn nil, nil","sourceCodeStart":697,"sourceCodeEnd":733,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dolt/wisps.go#L697-L733","documentation":"This error wraps a failure of the query 'SELECT <target> FROM wisp_dependencies WHERE issue_id = ?' inside getWispDependencies. It indicates the dependencies-of-wisp lookup could not be executed; the library wraps the driver error to mark the failing query.","triggerScenarios":"Calling getWispDependencies (directly or via public dependency lookups) when the wisp_dependencies table is missing, the connection is broken, or the SQL fragment DepTargetExpr is incompatible with the current schema/engine.","commonSituations":"Schema drift after upgrading beads without migration; Dolt server unavailable; corrupted .beads database.","solutions":["Read the wrapped driver error for the root cause.","Confirm the wisp_dependencies table exists and matches the current schema (re-run migrations / bd doctor).","Restore connectivity to the Dolt database and retry.","If DepTargetExpr changed, rebuild/reopen the store so the SQL matches the schema version."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure schema present before querying\n// e.g. run: SELECT 1 FROM wisp_dependencies LIMIT 1","typeGuard":null,"tryCatchPattern":"deps, err := getWispDependencies(ctx, id)\nif err != nil {\n    return fmt.Errorf(\"cannot load dependencies for %s: %w\", id, err)\n}","preventionTips":["Run migrations after every beads upgrade","Verify table existence before dependency queries","Keep the Dolt DB directory on healthy storage"],"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"}