gastownhall/beads · error

check blocker status: %w

Error message

check blocker status: %w

What it means

Wraps a failure from loadStatusByIDInTx when fetching statuses of blocker issues inside IsBlockedInTx. Edges were collected successfully, but resolving each blocker's status (to decide if the issue is genuinely still blocked) failed, so the blocked answer cannot be computed.

Source

Thrown at internal/storage/issueops/dependency_queries.go:968

			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
	}

	blockerIDs := make([]string, 0, len(edges))
	for _, e := range edges {
		blockerIDs = append(blockerIDs, e.dependsOnID)
	}
	statusByID, err := loadStatusByIDInTx(ctx, tx, blockerIDs)
	if err != nil {
		return false, nil, fmt.Errorf("check blocker status: %w", err)
	}
	var blockers []string
	for _, e := range edges {
		status, ok := statusByID[e.dependsOnID]
		if !ok {
			continue
		}
		if status == types.StatusClosed || status == types.StatusPinned {
			continue
		}
		if e.depType != "blocks" {
			blockers = append(blockers, e.dependsOnID+" ("+e.depType+")")
		} else {
			blockers = append(blockers, e.dependsOnID)
		}
	}

	return true, blockers, nil

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped error from loadStatusByIDInTx
  2. Verify the issues table schema (id, status columns) is current
  3. Retry on lock/deadlock errors after the conflicting transaction finishes
  4. If IN-clause size is the problem, ensure ids are batched (buildSQLInClause chunking) or update storage version
Defensive patterns

Strategy: try-catch

Validate before calling

_ = db.QueryRow("SELECT COUNT(*) FROM issues").Scan(&n) // issues table must be readable

Try / catch

if err := issueops.IsBlocked(ctx, id); err != nil {
	if strings.Contains(err.Error(), "check blocker status") {
		// inspect issues-table health; retry after locks clear
	}
	return err
}

Prevention

When it happens

Trigger: The batch status lookup for the collected blockerIDs fails due to issues-table query errors: schema problems, lock contention, driver failures, or a very large ID batch exceeding driver limits.

Common situations: Missing/migrated issues table; deadlock or lock timeout under concurrent writes; extremely long IN lists on constrained drivers.

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


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/7482efc1c3a97624. Report an issue: GitHub.