gastownhall/beads · error
check blockers from %s: %w
Error message
check blockers from %s: %w
What it means
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.
Source
Thrown at internal/storage/issueops/dependency_queries.go:942
}
if !found || !blocked {
return false, nil, nil
}
type depEdge struct {
dependsOnID, depType string
}
var edges []depEdge
for _, depTable := range []string{"dependencies", "wisp_dependencies"} {
rows, err := tx.QueryContext(ctx, fmt.Sprintf(`
SELECT %s AS depends_on_id, type FROM %s
WHERE issue_id = ? AND type IN ('blocks', 'waits-for', 'conditional-blocks')
`, DepTargetExpr, depTable), issueID)
if err != nil {
if optionalBlockedTable(depTable) && isTableNotExistError(err) {
continue
}
return false, nil, fmt.Errorf("check blockers from %s: %w", depTable, err)
}
for rows.Next() {
var e depEdge
if err := rows.Scan(&e.dependsOnID, &e.depType); err != nil {
_ = rows.Close()
return false, nil, fmt.Errorf("scan blocker edge: %w", err)
}
edges = append(edges, e)
}
_ = rows.Close()
if err := rows.Err(); err != nil {
return false, nil, fmt.Errorf("blocker edge rows from %s: %w", depTable, err)
}
}
if len(edges) == 0 {
return true, nil, nil
}View on GitHub (pinned to 71377f2769)
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
Defensive patterns
Strategy: try-catch
Validate before calling
_, err := db.Query("SELECT issue_id, type FROM deps WHERE 1=0")
if err != nil { /* dep table missing/broken: migrate first */ } Try / catch
if err := tx.CloseIssue(ctx, id); err != nil {
if strings.Contains(err.Error(), "check blockers from") {
// identify table name in message, repair/migrate that table
}
return err
} Prevention
- Run bd migrate after upgrades and restores
- Avoid manual schema changes to dependency tables
- Use bd doctor to validate storage before bulk operations
When it happens
Trigger: 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.
Common situations: Schema drift or failed migrations; embedded Dolt/SQLite corruption; lock timeouts with concurrent writers; wrong database opened (empty/partial schema).
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- failed to get federation peer: %w
- failed to query dolt_status: %w
- db: CommentSQLRepository.CountsByIssueIDs: %w
- db: CommentSQLRepository.ListByIssueIDs: %w
- db: LabelSQLRepository.ListByIssueIDs: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/618ff1080ef16119.
Report an issue: GitHub.