{"record":{"id":"618ff1080ef16119","repo":"gastownhall/beads","slug":"check-blockers-from-s-w","errorCode":null,"errorMessage":"check blockers from %s: %w","messagePattern":"check blockers from (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/issueops/dependency_queries.go","lineNumber":942,"sourceCode":"\t}\n\tif !found || !blocked {\n\t\treturn false, nil, nil\n\t}\n\n\ttype depEdge struct {\n\t\tdependsOnID, depType string\n\t}\n\tvar edges []depEdge\n\tfor _, depTable := range []string{\"dependencies\", \"wisp_dependencies\"} {\n\t\trows, err := tx.QueryContext(ctx, fmt.Sprintf(`\n\t\t\tSELECT %s AS depends_on_id, type FROM %s\n\t\t\tWHERE issue_id = ? AND type IN ('blocks', 'waits-for', 'conditional-blocks')\n\t\t`, DepTargetExpr, depTable), issueID)\n\t\tif err != nil {\n\t\t\tif optionalBlockedTable(depTable) && isTableNotExistError(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn false, nil, fmt.Errorf(\"check blockers from %s: %w\", depTable, err)\n\t\t}\n\t\tfor rows.Next() {\n\t\t\tvar e depEdge\n\t\t\tif err := rows.Scan(&e.dependsOnID, &e.depType); err != nil {\n\t\t\t\t_ = rows.Close()\n\t\t\t\treturn false, nil, fmt.Errorf(\"scan blocker edge: %w\", err)\n\t\t\t}\n\t\t\tedges = append(edges, e)\n\t\t}\n\t\t_ = rows.Close()\n\t\tif err := rows.Err(); err != nil {\n\t\t\treturn false, nil, fmt.Errorf(\"blocker edge rows from %s: %w\", depTable, err)\n\t\t}\n\t}\n\n\tif len(edges) == 0 {\n\t\treturn true, nil, nil\n\t}","sourceCodeStart":924,"sourceCodeEnd":960,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/issueops/dependency_queries.go#L924-L960","documentation":"Wraps a SQL failure while selecting dependency edges (blocks / waits-for / conditional-blocks) for an issue inside IsBlockedInTx. Like the is_blocked read, missing optional tables are skipped, but any other query error aborts with this message naming the failing table.","triggerScenarios":"Close-policy enforcement calls IsBlockedInTx and the edges SELECT (WHERE issue_id = ? AND type IN (...)) fails on one of the dependency tables with a non-table-not-exist error.","commonSituations":"Schema drift or failed migrations; embedded Dolt/SQLite corruption; lock timeouts with concurrent writers; wrong database opened (empty/partial schema).","solutions":["Inspect the wrapped error for the driver-level cause","Apply pending migrations to restore dependency table schema","Confirm you are operating on the intended database (bd doctor can help)","Resolve transient lock/connection issues and retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"_, err := db.Query(\"SELECT issue_id, type FROM deps WHERE 1=0\")\nif err != nil { /* dep table missing/broken: migrate first */ }","typeGuard":null,"tryCatchPattern":"if err := tx.CloseIssue(ctx, id); err != nil {\n\tif strings.Contains(err.Error(), \"check blockers from\") {\n\t\t// identify table name in message, repair/migrate that table\n\t}\n\treturn err\n}","preventionTips":["Run bd migrate after upgrades and restores","Avoid manual schema changes to dependency tables","Use bd doctor to validate storage before bulk operations"],"tags":["go","sql","dependencies","query"],"backgroundTag":"sql-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}