gastownhall/beads · error
journal: iterate derived is_blocked from %s: %w
Error message
journal: iterate derived is_blocked from %s: %w
What it means
After scanning all rows, rows.Err() reported an iteration-level failure (driver/connection error mid-result-set). The wrapper aborts the journal snapshot and fails the transaction.
Source
Thrown at internal/storage/issueops/journal.go:246
args...)
if err != nil {
if optionalBlockedTable(target.table) && isTableNotExistError(err) {
break
}
return nil, fmt.Errorf("journal: snapshot derived is_blocked from %s: %w", target.table, err)
}
for rows.Next() {
var id string
var blocked int
if err := rows.Scan(&id, &blocked); err != nil {
_ = rows.Close()
return nil, fmt.Errorf("journal: scan derived is_blocked from %s: %w", target.table, err)
}
snapshot[blockedJournalKey{table: target.table, id: id}] = blocked != 0
}
if err := rows.Err(); err != nil {
_ = rows.Close()
return nil, fmt.Errorf("journal: iterate derived is_blocked from %s: %w", target.table, err)
}
if err := rows.Close(); err != nil {
return nil, fmt.Errorf("journal: close derived is_blocked from %s: %w", target.table, err)
}
}
}
return snapshot, nil
}
// recordBlockedJournalChanges compares the stable post-maintenance state with
// the captured state and journals only beads whose derived is_blocked value
// actually changed. The emitted update carries the complete post-mutation
// snapshot, allowing a cursor consumer to stay correct without graph queries.
func recordBlockedJournalChanges(
ctx context.Context,
tx DBTX,
before blockedJournalSnapshot,
issueIDs, wispIDs []string,View on GitHub (pinned to 71377f2769)
Solutions
- Inspect the wrapped driver error
- Retry the operation; if transient, it should succeed
- Reduce the id-list size / batch the IN clause to shorten result streaming
- Check server logs and connection stability
Example fix
null
Defensive patterns
Strategy: retry
Validate before calling
if err := db.Ping(); err != nil { /* reconnect before starting the transaction */ } Type guard
null
Try / catch
for attempt := 0; attempt < 3; attempt++ {
snap, err := runRecomputeTx(ctx)
if err == nil { break }
if !isTransient(err) { return err }
time.Sleep(backoff(attempt))
} Prevention
- Keep the IN (...) id lists batched to avoid long streaming result sets
- Set sane server query timeouts above expected query duration
- Use connection pooling with health checks
When it happens
Trigger: Connection dropped or the underlying SQL session errored while streaming rows of the is_blocked snapshot SELECT.
Common situations: Network interruption to the Dolt/SQL server; server-side query kill/timeout; connection pool closure during long IN (...) queries with many ids.
Related errors
- iterate dependency sources: %w
- iterate dependency targets: %w
- count edges in %s: rows: %w
- search %s (hydrate): rows: %w
- failed to open server connection: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/f1d2c2ab7e898354.
Report an issue: GitHub.