gastownhall/beads · error

searching children of %s: %w

Error message

searching children of %s: %w

What it means

This error wraps a failure from IssueUseCase().SearchIssues when listing the children of a parent issue during label propagation. The parent was resolved successfully, but querying issues filtered by ParentID failed (storage/backend error). It is wrapped with %w so the underlying storage error is preserved for errors.Is/As inspection.

Source

Thrown at cmd/bd/label_proxied_server.go:163

	}

	var (
		children []*types.Issue
		parentID string
	)
	err := uow.RunTx(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (string, error) {
		parent, _, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(uw), args[0])
		if errors.Is(rerr, storage.ErrNotFound) {
			return "", fmt.Errorf("resolving parent %q: not found", args[0])
		}
		if rerr != nil {
			return "", fmt.Errorf("resolving parent %q: %w", args[0], rerr)
		}
		parentID = parent.ID

		page, err := uw.IssueUseCase().SearchIssues(ctx, "", types.IssueFilter{ParentID: &parentID})
		if err != nil {
			return "", fmt.Errorf("searching children of %s: %w", parentID, err)
		}
		children = page.Items
		if len(children) == 0 {
			return "", nil
		}
		// THE ONE SURVIVING WISP SWITCH, and it is named rather than hidden.
		// This is the same four-way shape ga-26w10 deleted from `bd label` and
		// ga-2ltro.12 deleted from `bd tag`, `bd set-state` and the molecule
		// port — the branch a front door can get backwards and put a wisp's
		// label in the durable table. It survives because propagate is a search
		// plus a fan-out that must land as ONE transaction over N children, and
		// a per-child Lifecycle.Update is N transactions: the atomicity this
		// command has today would be the price of the migration. The shape that
		// keeps both is issueops.BatchApplier.ApplyBatch with one ItemUpdate per
		// child carrying this same label patch, and it is blocked on a cmd/bd
		// accessor for that role. That is the follow-up this waiver names
		// (ga-2ltro.12); it is the last one on this list that WRITES.
		for _, child := range children {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Check the wrapped root cause in the error chain and fix the underlying storage/connection issue first
  2. Verify the workspace database is healthy (e.g. bd doctor) and that the Dolt server/DB is reachable
  3. Re-run the label command once storage is restored; the operation is a read of children plus label fan-out and is safe to retry
Defensive patterns

Strategy: try-catch

Validate before calling

// before propagating, verify storage is reachable
if _, err := uw.IssueUseCase().SearchIssues(ctx, "", types.IssueFilter{ParentID: &parentID, Limit: intPtr(1)}); err != nil {
    return fmt.Errorf("storage unavailable: %w", err)
}

Type guard

func isStorageError(err error) bool {
    var serr *storage.StorageError
    return errors.As(err, &serr)
}

Try / catch

page, err := uw.IssueUseCase().SearchIssues(ctx, "", types.IssueFilter{ParentID: &parentID})
if err != nil {
    if isStorageError(err) { /* retry or report backend down */ }
    return fmt.Errorf("searching children of %s: %w", parentID, err)
}

Prevention

When it happens

Trigger: Calling the label propagate flow where args[0] resolves to a parent issue, and SearchIssues(ctx, "", IssueFilter{ParentID: &parentID}) returns a non-nil err — e.g. Dolt/storage backend unavailable, corrupt database, or query timeout.

Common situations: Database server down or unreachable mid-command; corrupted .beads/Dolt workspace; permission errors on the storage backend while running `bd label <parent> --propagate` style commands.

Related errors


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