gastownhall/beads · error

failed to get wisp dependents: %w

Error message

failed to get wisp dependents: %w

What it means

This error wraps failure of the query 'SELECT issue_id FROM wisp_dependencies WHERE <target> = ?' in getWispDependents, which finds issues that depend on a given wisp. The library wraps the driver error to show this specific lookup failed; nothing about dependents was returned.

Source

Thrown at internal/storage/dolt/wisps.go:745

	_ = rows.Close()
	if err := rows.Err(); err != nil {
		return nil, wrapQueryError("iterate wisp dependencies", err)
	}

	if len(ids) == 0 {
		return nil, nil
	}

	return s.GetIssuesByIDs(ctx, ids)
}

// getWispDependents retrieves issues that depend on a wisp.
func (s *DoltStore) getWispDependents(ctx context.Context, issueID string) ([]*types.Issue, error) {
	rows, err := s.queryContext(ctx, fmt.Sprintf(`
		SELECT issue_id FROM wisp_dependencies WHERE %s = ?
	`, issueops.DepTargetExpr), issueID)
	if err != nil {
		return nil, fmt.Errorf("failed to get wisp dependents: %w", err)
	}

	var ids []string
	for rows.Next() {
		var id string
		if err := rows.Scan(&id); err != nil {
			_ = rows.Close()
			return nil, wrapScanError("scan wisp dependent", err)
		}
		ids = append(ids, id)
	}
	_ = rows.Close()
	if err := rows.Err(); err != nil {
		return nil, wrapQueryError("iterate wisp dependents", err)
	}

	if len(ids) == 0 {
		return nil, nil

View on GitHub (pinned to 71377f2769)

Solutions

  1. Check the underlying wrapped error for the driver message.
  2. Verify wisp_dependencies exists and matches the schema version (run migrations/doctor).
  3. Reconnect to the Dolt database and retry the lookup.
  4. Check disk space/health for embedded Dolt databases.
Defensive patterns

Strategy: try-catch

Validate before calling

// check connectivity/table first: SELECT COUNT(*) FROM wisp_dependencies

Try / catch

deps, err := getWispDependents(ctx, id)
if err != nil {
    log.Printf("dependent lookup failed for %s: %v", id, err)
    return nil, err
}

Prevention

When it happens

Trigger: Querying dependents of a wisp when the wisp_dependencies table is absent/corrupt, the connection dropped, or the engine rejects the DepTargetExpr SQL fragment.

Common situations: Database partially migrated; Dolt process down; disk-full causing query errors on the embedded engine.

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/a21b52caa50b28cb. Report an issue: GitHub.